You are on page 1of 818
Carl Hamacher et al.: Computer Organization, SE(ISBN 0-07-112218-4). Copyright © 2002 by The McGraw-Hill Companies, Ine. All rights reserved. Jointly published by China Machine Press/McGraw-Hill. This edition may be sold in the People's Republic of China only. This book cannot be re- exported and is not forsale outside the People's Republic of China, ATE SC EDN Ha 3 BEM cGraw- HilL ZS BEALL TW CAE ASNT, AANA, MLE MTR. NRT RAB POETS, UIA, LLIE. APMIS: BF: 01-2002-2178 BEM (CIP) Bie SEOEULELR CEA HESHE) / SR) MBE (Hamacher, C. ) 95%. ~ 20K: BURIAL RGAE, 2002.6 (SUIS HIE) BLINK: Computer Organization, SE ISBN 7-111-10346-7 Losi UD ML HEBER AH 3X WV. TP30R SP RURCASIR SACIPRCHR EF (2002 ) 550380143 SUT HILAE Comma Ke2 9 aE 100037) SERA: TEEPE COIL EIB, BE AR RAT ERAT 2002466 381A eK EN 850mm x 1168mm 1/32 + 26 AIK Fi: 0001-3 000% SEO: 48.0076 AOA, SUA, BO RH, TERED |s s eS VERSION ADDS NO WA TERMARK &, < efint-arwe RSE REBAR, WA KOA EEE OER IRIE, PEI REARPEOE TORRE TRMTEORE, HIERN, HE EM BRRRROA TS AREY BOR. ERC, ALR SRAABROR OAS, TER POS Rt et SRR OAC RAR, ATT BRE RE, ART TERY EM, BRT PROM, BAER, RASA ME, SOAS ABE PITTI. TF, ASRARAM HET, RENAL RRE, we WAA BITE F210). ROLE AA MABE OL, tL A; HLA OAREAT RL PAK ASH, ERARARAA RA FIRES ALA RD ANBAR, SRT RES a ETCH LAE OL, T+FAREOEREM AAS EZ A. Alt, 31a PREMERA AMATO RRR OTE E A, tse STA Th, BRAEMAR MASH OHH. PUTA He RCL SCA A RAS “He CE TRS” 9 19984F Re, EES Rat LPR CE TR, BERNER AHL. & TLLAE AMES A, BATGPrentice Hall, Addison-Wesley, McGraw-Hill, Morgan Kaufmann Fit #4 Hi Ala T RMA, WEI SCHR PREY Tanenbaum, Stroustrup, Kernighan, Jim Gray FAIR R PALIT, DL LAA” AR, RAE. OPER Sh. KBAR, HEART Re “SHU E A” ACLS) T ASE ai Ea, Ae RT PROS, ERATE T ARLE mT RAIA A SUE SPE ARTE eM, NES MAIN AE FF. G4, “HROEAS” CRMMTEA TAM, Ree ne UT REHOM, FRASHRRANERAHMSS AM, Bs SRT ET BAER és REGISTERED © VERSION ADDS NO BE RE BOB eA OE EL, BORE TOL SOL ANTE R AL AB A — BR. Falk, RES HAS ER OD A, Ce “PRA” OBMUZ FMS TRIALS: eR AIBOTRE, BOOMER “UME” 231; SEM, TSR FE A I BS” EMAC EWS “HEIL SPOS” ORPRREIOR AS URS, MESH SUB RRAE. Oy T BRIE = SEA 5H SURE, FU TS PRESS, RAAT PA Be. RAR, EAA, PEAS. MAKE, PHAR. HO KE. UAE. PRAY, ARIMA, RAE, TRA RAK, MMEMAAE. RMA, PLAC, REAL A, SHAE, MILF, PRM RSME FARRER ATOMATROLME TOROS CHAM “PRESB AS”, WR ‘Pes IA RSE “BRIE” LACT BPEL BOE ES, A PORCH ARCA BESTE 9 HES PE MUGER SFU BUA HY “ERE SHAS” (RIL, RARE TOS AEE. VRE eet, Ht “PASASIC SAEMLLT., Stanford, U.C. Berkley, CMUAFEAZ MAKER. DBA T BARB. BGS. BRE. TOR Re, BRA, RR, KAT, FE, De SR, RAH ATA ORE, ASAE AM AAR. HAS HERA, ANE RULE BBR. FESO EH MEE OHSS, TEETER SMA BUBITES. SISO. HERR. PRR, HAN, AARERNIMN BA T RMR, ARN ARERR, TR REA RAAB — He BREE A). Bb A RA FARE. RA IDE MAA BAO TL PE RI PIE, AVR Dr tek Fs AAFP: hzedu@hzbook.com BERIIS: (010) 68995265 SERIAL: ITA EES 455%: 100037 & > REGISTERED VERSION ADDS NO RGA BEE kim BRS AAR AAR wet REE ERESERS (BEERS MUF ) Lm 3B PE Be FUSE HAH & RF BS HAH EE Bi Bik Ee BBR @ ie RUM RAM KES RNR zp BAR Bae AE ame DA BER RRL fant | BPE Se we 19) > REGISTERED ON VERSION ADDS NO WATERMARK &, & erin tare ABOUT THE AUTHORS Cart Hamacher recived bis Se. degre inenginsing physics om the Univesity of Waterloo, Canada, an M.Sc. degree in electrical engineering from Queen's Univer- sity, Kingston, Canada, and a Ph.D. degree in electrical engineering from Syracuse Univers New Yrk Pom 196801990 e was a the Universi of Tern, where te was a Profesor inte Departments of Hetil Engnerng and Computer Si ence. He served rca ofthe Computer Systems Reseach nse ding 1984 101988, ands chaiman ofthe Divison of Engnering Science uring 1988 to 1950 Since Jnary 191 be has ben a Profesor af lecial and Computer Exgnerng at Quee's Unies. He served asthe dean ofthe Facaly of Applied Science fom 1991 to 1996, Daring 1978 to 1979, he wat avsting scientist the IBM Research Laborato in San Joe, Califo in 186, he was a rerch Vitor tthe Labon- ey for Cts and yates astocited wih he Unversity of Grenoble in Franc. 1996 o 1987, be wasa visting rfessorin he Compu Science Deprtent athe Univer of California at Riverside and in the LIPS Laborstory ofthe Univesity of Pris VI rence. isresech interest ain ultpoestn and miami, focusing onthe interconnection networks ‘Zvonko Vranesic recived his B.A.Sc., MLAS, and PhD. degrees, in electrical engineering from the University of Toronto, From 1963 to 1965 he worked asa design engineer with the Northem Electric Co, Lid. in Bramalea, Ontario n 1968, he joined the University of Toronto, where be is now a Professor inthe Department of Electrical and Computer Engineering and the Department of Computer Science. During 1978 to 1979, he was senior visitor a the University of Cambridge, England, nd ducing 1984 101985 ie was atthe University of Paris VI, France. In 2000 to 201, he was a principal saftware engineer at Altera Corporation in Toronto, From 1995 to 200, be served chair of the Division of Engincering Science a the University of Toronto. His caren research interests include computer architecture, fe\-programmable ‘VLST technology, and mulile-valued logic systems. He isa coauthor of three other books: Fundamental of Digial Logic with VDL Design, Microcomputer Structures, and Field-Programmable Gate Array. In 1990 he received the Wighton Fellowship {or “innovative and distinctive contributions to undergradute laboratory instruction.” Safwat Zaky received his B.Sc. depree in elecical engineering and B.S. in ‘mathematics, bot rom Cairo University. Egypt, and his M.A.Sc. and PhD. epfics and magnetics in mas storage and leone switching. In University of Toronto, where hei nw a Profesor in the A sad Compe neigh Darn of Copies Sa D>, > REGISTERED VERSION ADDS NO WATERMARK & < efint-arwe Aout AvIORS serves as cai ofthe Department of Electrical and Computer Engineering. Prom 1980 1 1981, he was a senior visitor tthe Computer Laboratory, University of Cambridge, England, His research interests are inthe areas of computer architecture, reliability of digital ‘eit, andelectromagnetic compatibility. Hes a coauthor ofthe book Microcomputer ‘Structures and isa recipient ofthe IEEE Third Millennium Meds. ERED |e S eS oO eS S > REGISTERED ON VERSION ADDS NO WA TERMARK &, & : re > CONTENTS Preface vl Chopter ¥ Basic STRUCTURE oF COMPUTERS 1 1A Compoter Types. 2 12 Functional Unis 3 121 pest 4 122 Menery Unit 4 123° Artimescand Lope Unk 5 124 Capa tait 6 125 Court Usk 6 1.3 Basic Operational Concepts 7 14 BusStuctares 9 1S Software 10 16 Performance 13, 161 PreeuerCleck 14 L682 Base Perfomance Equion 4 163 Patio nd Supeale Operation 15 164 CokRae 16 USS —nsretion Se CISC and RISC 16 1.7 Maliroceseas and Muticomputers 18 18 Historical Perspective. 19 2.1 Numbers, Arithmetic Operations and Cures 27 262. Asemtiy wi Excuton of Progams. 62 263 NamerNotsion 64 VERSION ADDS NO WATERMARK & cones 210 Logic tnsrcions 81 2102 ShitendRowe tutions #2 2.103 Motipctin ané Divison 86 211 Bxample Pognms 86 DILL VevorDet Protect Progra 8 2112 ByteSoring Progam 87 2113 Linked Liss 38 212 Encoding of Machine Instructions 94 2.13 Concluding Remarks 98 Problems 98 Part] The ARM Example 104 uM a2 33 Registers, Memory Acces, and Data ‘Transfer 104 BLL Regier Sucre 105 3.1.2 Memory Acces Isrtons and Addresing Modes 106 313 RegiteeMove stots 113 ‘Arithmetic and Logic Instructions 113, 321 Atm Inumctions 13 322 Logs taerecions 115 Branch Insructions 116 331 Seting Condon Codes_117 332 ALog Progam for Aang Nombes 118 Assembly Language 118 341 Preedolasmctions 120 WO Operations 121 Subroutines 122 Program Examples 126 374 VecorDot Prot Progam 126 372 ByteSoning Progam 127 373 Linke ist serion ad Deleion Subrosins 127 Part The 68000 Example 130 38 39 Registers and Addressing 131 381 The6l000 Regier Smewe BI 382 Aldessing 31 Tnsructions 136 3110 Assembly Language 140 3.11 Progam ow Cont 41 BALL Condon Cade Fags. 1 3112 BranchIninetons14t 342 WO Operations 145 313 ‘Stacks and Subroutines 146 314 Logic fasructions 151 3S Program Examples 152 BASIL Verwr Dot Produ Progam 152 3152 ByteSoning Progam 153 3.153 Liked List rion nd Deion Subrouine 154 Pact I ‘The A-32 Pentium Example 155 216 Registers and Adiressng, 156 3161 ASD Repiser Sie 156 3162 32 Adiesing Modes 159 317 TAS32fasructions 166 BAT. Mache Insmeon Format 168 318 TA32 Assembly Language 170, 4.19 Program Flow Cootol 171 319.1 Condos imps and Condition Code Fag 171 3192 Unconditional mp 173 3.20 Logi and ShifVRotate Instructions 173 3201 Logic Operations 173 3202 Shit md Rowe Operations 173 3.21 WO Opernions 174 3211 Menor Mapped 10 174 3212 teiaed vO 175 3213 Block Tranter 116 322 Subrowines 177 323 Other Isructons 182 323.1 Mubiply and Divide strucons 152 3232 Muliedi Exension (MMX) Tosrvcins 183 3233 Vecor (SIMD) Iurctions 184 3.24 ProgramExamples 184 32K Vector Dat rode rg 184 3242 ByteSoning Progam 185 + ‘3243 Linked List scion nd Delon Subrosins 85 325 Concluding Remarks 18 45 REGISTERED 9) VERSION ADDS NO WA cai & 7 Z tint-dtwe

You might also like