0% ont trouvé ce document utile (0 vote)
3 vues51 pages

CH 8

Le chapitre traite de l'unité centrale de traitement (CPU), en expliquant son architecture, son fonctionnement et les opérations de base qu'elle effectue. Il aborde également l'organisation des registres, les micro-opérations et la gestion de la pile, en détaillant les opérations d'insertion et de suppression. Enfin, le chapitre décrit comment les instructions sont exécutées et comment la mémoire est gérée dans le contexte du CPU.

Transféré par

chrtveyf
Copyright
© All Rights Reserved
Nous prenons très au sérieux les droits relatifs au contenu. Si vous pensez qu’il s’agit de votre contenu, signalez une atteinte au droit d’auteur ici.
Formats disponibles
Téléchargez aux formats PDF ou lisez en ligne sur Scribd
0% ont trouvé ce document utile (0 vote)
3 vues51 pages

CH 8

Le chapitre traite de l'unité centrale de traitement (CPU), en expliquant son architecture, son fonctionnement et les opérations de base qu'elle effectue. Il aborde également l'organisation des registres, les micro-opérations et la gestion de la pile, en détaillant les opérations d'insertion et de suppression. Enfin, le chapitre décrit comment les instructions sont exécutées et comment la mémoire est gérée dans le contexte du CPU.

Transféré par

chrtveyf
Copyright
© All Rights Reserved
Nous prenons très au sérieux les droits relatifs au contenu. Si vous pensez qu’il s’agit de votre contenu, signalez une atteinte au droit d’auteur ici.
Formats disponibles
Téléchargez aux formats PDF ou lisez en ligne sur Scribd
CHAPTER EIGHT +— Central Processing Unit 1 treatin 82 Geer Reger Opsntn 5 Adbeaig Mad 87 Progen Corea 841_Introduction Theft ofthe computer that pesos the bao dat rocening peas ital th cen proeing unit nd rene ase CPO Tec ‘isd op of ee mar prs a shown aig. Te ogo ee ‘Remenedaa urd erg ihe estan eins The animes Inge en (ALU) performs the que muopeaions for ecatig the tntracons Thee spertoe the eer fran sage 242 uma. Conn Peng Ui l= Ll Ss 61 Maj commen f PU tuk that in are partnvelies chasing the hardware for implementing the ‘machine insrctons. The tue who program the computer in machine oF ssmlylnpuage mast be aware of fe fog e he meory ste, {he typeof dts supported bythe iarecsons, andthe fae that each Deel peters ‘Deng example of simple CPUs are cared out in Chaps Sand 7. The chapter describes the cranznton and archer of thePUwithan Pha "ton the aor va of the computer We rely desobe how the esters ‘Frnmomsste withthe ALL tag bose andthe operat te ‘memory tack We then presen he ype of insracton formats avalible, the odes undo rereve Sit om memory, nd pl ntraons ommany incorporated in compaere Tela secon presente cance ok ‘eduedinrscton et computer (50) 8:2 General Register Organization tetramer ovr es ag ey aon ate Ger on te mph tease eee eee ‘ent and more ecient ore hee intermedi asin prcene ei {hor Wher Inge umber of epsters re iced inthe CPU, most ‘Scena cnoes he hough common bs ystom. Theveiters comma ‘Bese withenchotherntonl for et da anes, tao wile perfor [ng ranous masooperaos. Hence is neemay to provide a commen unt The can pestorn i he arnet, lope and St mcrooperasans in the Prosser "tus oxpsiation for sven CPU reir i shown in Fig 82. The utp leach oir isconnesed ow apeners (UX) toto th two [akelandTheseletion nes neachmaltpnner acetone reste the "iputatsfo se pacar bos The Aan’ baer frm the inputs te scr: Ginn Rage Opie 243, 244 cu ot Crm Pace Unt common antheticlopc uni (ALL). The operation nected in the ALU dete ‘nines the anther lie mrooperaton hat etobe [Link] {th mroperton aval for output dats and alo goes nthe inputs ‘tal the regaes The register ta eae the information fom the output Sut sleced by decoder The decode ates one of he register oad ‘put, har providing rane path between te dta inthe ouput Das nd {he inputs of he sted destin rete "Paco un tht operates the CPU bus ye diets the information| uw trowgn tne reper tha ALL by seecting he varus components he ‘tem For snmp, prior he operation the conel mat provide nary ssletion vale to the flowing selector Input: 1. MUX Asser (ELA): to place the content of £2 nt bas A 2. MUX B selector (SELB: to place the content of 3 into bus 3. ALU operation selector (OPR: 10 provide the arithmetic ation 4. Decaderderntion sector (ELD: to tanaer the content ofthe cutpt buw nto R “The four coi selection vaiabes are generated inthe contol nit and smustbesvalsblestthebepnningofacoakeyce, The daar the two arc ‘ote propagate through the patente mapleners andthe ALU, tthe ‘utp, andi hemp the destination reer ling the ook {nena Then, when the next ok transi crs, the inary fora ‘Shnirom he output busin tanatered into. Toschievea fst respon me, {he ALU ir consrcted with highspeed caste The Bares se plemented ‘th mlplaers or thcetate gates a8 shown i See 3 Control Word ‘Thre ae 14 binary slestion inputs i the unit, and thelr combined vale ‘Species contol Word The Lt conta word is dened in Fg, 820) 1 ‘insite four fas Te eli conan tee ts each, and one felt hat feb. The the bes of SELA sles sore eter othe Apt of te ‘ALU. The tee Bs of SELB sles reper for he B inp ofthe ALU. The ‘ee Bits of ELD sca estration reise sing the decoder and seven Jnadoupats. The ve bits of OP ant ane a the Speratonain he ALL The 1ebailwrd when apd te esi pt pens price "Te encoding o the register selections i speci in Table 61. The 3-0 5782 Gene Regier npn 245 ‘TABLE Ereng Rie Sein Ft a oR rH ‘inary cade ited inthe Sint column of the tbl speci the binary code for ‘Sichof the he eld The eit selected by far SELA, SELB, an SELD {tthe ane whe decinalmamber reuse fo the Binary number nthe {ode When SELA ox SELB 00, the corresponding muliplene es the ‘xternal input data When SELD =O, no desaton repr slo at ‘he conten ofthe cups bus ae svat in he ener out “The ALU provides artmeti and loi operations Inaion, the CPU mast provide si operstons. The ser maybe placed nthe pt ofthe [AW fe provide a presi capability, oat the ouput ofthe ALU fo provide ‘osteiting apa In sone case the shit operason ar ncladed with {pe ALU. Ananth lpe and sit ant war designed in Sa 47. The fcton ‘able or hs ALU sited in Tate € 8” The encoding ofthe ALU ‘penton forthe CPU sr tkan fom So 47 and especie in Table 82. The ‘Shei hae ve tan ach operations designated wth ybo aa. TABLE 2 fale ALU Open Sa 246 umm ort Ca Psnng Uni Examples of Micropertions ‘Acontel wordof 1 Bs isnceded to spect a micoperationin the CPU-The anirol word for 2 pen mirooperaton canbe dere fom the selection ‘bes For example, the sabe msrooperaton pen bythe statement mie k2— 83 species R2 or he A input ofthe ALU. R3 forthe B inp of he ALU RI for ‘he desinaton reper and an ALL open fo sbat A~ B. Ths the ‘orl word specie the ou fds and the coesponding bina ale {reach eld bined fom the ending ted in Tables 8 and 2 The ‘Bary onl wer forthe sabre eropertion O10 CM OO G00 and ‘nue a flows Felt SELA SELB SELD OR spa mR SUB CConrat wont 010 Gt ott co “Te contol word for hi miropeaton and few others ae ted in The increment and ant miooperatons do not the Bing ofthe ‘Aw Ferthwe en the Bed sank ahs dash We nig 0 any used fld when orang the tnay Contra ward although ay her Binary mumbo ay be used ace the Cntnt of reper mo he utp ‘ermal we lace the content fhe reste into the Amp of the AW, but Swath pn ae cd tm cpt at Te AL openton 1S ‘ste daa rom the regater, ough the ALU, tothe outpat terminal Fe des wansfer rm pot ouput is sconpished wih conta word ‘Syme Deapaton Meopenton “SEA SELB ELD OP Sipatna Se epe np aiiiiige aegpeee SE990595| g| stack potter secre Sack Onminn 247 ‘ofall (aking the B eld 0. reser can be cere to Oh an ‘eiclusiveOR operation. This is bens 281 ~ 0. tisapprent fom these examples that any fhe microperaon can begenentedinthe CU The mates way tpenrste cont! word ith ge number of tsetse them ins memory en A memory unt tat ‘Noes contol wordlereferred tara contol emery. By eaingcnancave ‘ntl words rm memory ts posse to nate the dese sequen of ‘microperaton fr the CPU. This type of conta eeted to a6 mirono- (gamed coral. Amusoprogamumed contol nts shown ini 78 The {Eta conta word forthe CU wl come from the outputs of he contol weary masked micoops 3 Stack Organization ‘Asef fate thats included in the CPU of mnt computers ack or {inn fiorout (IFO) ba A ack ins trage device tha etre information ‘pesto fash compared ssc ye Tea oy ed "Phe sack in dpi computers emently 2 memory unit with an ‘dco eter that cout oly fe anna! onded into) The reper atholdrtheaddres forthe achiral ack pointer (SP) bene [valu aaye pnt the top tom nthe tack. Contrary 0 ack of ays ‘where the way tol ay be ken ut or acted the peal egies 2 ‘ackare sways svalate fr reading orweng Ii the content fhe word {hat niet o dete “The two operations oa stack ae the inserton an deletion of es. The operon non ales fat oso) etn ab a thet puna tomo. Theopemtnl aon ed Fprlorpopap) because canbe thought afarthe ronal removing one tem ‘ehuine nate pops up However ochng pushes or popped in or puter sack The operations re smalted by mererentngo decrement he mace pointer epiter Register Stack ‘Atacan e cina porn fag nena tannin ot ‘coleson of nite number f memory words repens Figure 83 chee {he oraniaton of Seward sega mack. The sack ers? ‘etal ana uber whens vlue equal tothe dss ofthe word tat ‘Seumenty an op ofthe sack Tree eae pice inthe tc: nd (CSinthat oder. em Cis on op af the stack ap hat the coment of SPs no ‘Slo remove he op em, te Zack poppe by aang the memory ord 248 ours Cons! Peeing Ue Ce ue) Bak dagen fs Hee ak st address 3 and decrement the content of SP em Bis now on apo the ‘Suck since Sols sda To ur ew ery the stacks pusbed by Incrementng SP and wetting a word in the ox-gher eaten the Sack "Nott tery Chas bee end ot Bat not phystaly removed, Ts dos not rater because when the Sack pushed, new sem is weiter sts place Tnastword stack, thestack outer contains Sis bese?” ~ 6 Since SP hs only sx bt cannot exceed a mumber geste than 9 QUIT Thru) When sinrementedy theres g0since 11011 + 1 = 10000) Inbirasy tat sca econo nthe sx east sigan Srl ‘then 00 & decremented by the seus TID. The one bt regener FUL is setto when the stacks al, andthe ne it egies ETY ae Tehen he stackisempty ots Die data eget ols thebinary ‘itt be wan itso ed to he mack Inia SPs eared. EMITY ise 1, and FULL eared t0 20 hat Spottt the word at adreseOand the sacs athedempy and at fs fe stack nef (CULL Oa ew er inserted wih ash nw ‘operon The push operon sinplemented withthe following sequen at isropertions sPesP 41 Increment tack ponte tse) —DR We ea. op ofthe stack stents Sack Orpanion 249) (SP = 0) then ULL 1) Cheek stacks fal mury—0 Mack he tack ot empty “The stack pointer ia incremented 4 htt pins tothe adden ofthe nest fgher wor. A memory wt operon irs the ward fom Di nto Thetop ofthe sac Note tat SP hele the adres ofthe topo the ack and that {SP denotes the memory word speced by the arene prventy [Sstre at addres 0 SP reaches 0, the sack fll oes, so FULL et to'1 Ths condition ig eached ithe top em poet the ast push wasn Tocaion 6 and after nrementngSP, heist tem sstovedin lection Once ttm tore in oat 0 there ren ore empty registers inte sak IWanitem eriten ite stc,obviosl the stack cannot beep, S0EMITY (dear 08 ‘Arne ers is delete from the sack the sack i not empty Gi Eur =) The pop oprton cons of he alwing sequence of mace operons! beets?) Read item rom the tp of tack sPesP=1 Decrement tuck pointe GSP =0)Hhen (EMTYH1) Check stack empty ruu—o Mack the sack ntl “The top tem ed rom the sttck ito DR. The sack pointer i then decerented Ite valu reaches sr, te sack is empty, EMTY i ae f 1s condition seabed the em rend was i cation 1. Once hi ter SSrendout Ps decremented and reaches the alt 0, whichis he sal value {of 5P. Note that fs pop operation reads the tem rom cation and then SP 'S decremented, SP changes to IIIT, which equalent to deal in {escenario the ord ina ei he tn take [Noto hat an roncou operon wl out the tack pushed when FLL = lor popped when EY = La Memory Stack ‘Astckcan eet asa standalone ui asin Fig. 83 or canbe implemented in ‘findooeaces memory attached to + CPU The implerentaton af ac inthe CPUs dane by estignnga pation of memory oe sack operon and ing a processor register su stuck printer, Figure 64 shows potion of ‘Somputer memory purtione olive segments prorat end Sack “The prope counter PC pons a the aes of the et srt in the Proieo the addrns reget prot ana fe The stack per 250 cure Con! Ping Ue ‘hase o Yad an opera SP sed fo pash Of pop ems nt or om the moa ‘As shown ln Fig. 84, the inital value of SPs 401 and the stack ows itn decreasing adresses. Thus the fst te stowed the stack at aes. {800 the secon stored at adres 9°, acl the at adres tat ca ‘esed forthe tack 300 No provision ae salable or sack itches. secTONe) Sk Oinon 251 ‘We assume tht he em in he tack communicate witha data eiter DDR. Anew ies uted with the push sper flows spesP-1 Misei~pR ‘The sack pointer is decrement 0 tat point a the addres ofthe ext Inurl stony wit open ass the werd om Eine heap the "Eick A new tem edited wath pop operation as faows R- MIS?) “Te tp em rad from he ack ito DR, The stack pointer then ere ‘ened to pln at he mow tem in he stack Mow Computes So ot prove Pardwareto check for ack veo ll stack or under epiy sac) The saci can be checked sing v0 roenor reir eto old the upper int ain sete andthe oer E"fathe omer limi (001 im ue cael Alter « push operon, SP ls ‘Smpued with he upper in rpier ana afer pop operation SP is care aed ih the owe int ete "The wo micooperations needed for ether the push or pop ae) an costo memory ough SP and updating SP. Which of he two mo ‘peraone done fat snd whether Se wpe by incrementing ot Ser seing depend onthe organisation ofthe tack In i the sack ro by dean the memory adress. The stack may Be conarcted fo grow by Stoning te menory adden asin 83 lnsuchs cane, Pts need {Sethe push operason and decrement forthe pop operation. enc My ‘rcamtacted ss thats poi the nex emp fan shove the fp of te ‘ad In thi case the aur of micoopastons mont be interchanged, ‘Acc pester lnnded wth an ola elon Tonal lee mest be thebotomadrerafanansged actin merry. Hensorth, $store ‘age fs merry sack att he CPU caret aot ving Speci tn adres, seth adress avayesvalele and satay Piatt nthe stk pine Reverse Polish Notation ‘Anackorganisation ey cllecvefor etaluang rth expressions. The omimon mathemati! method of wring athe expressions impos it ‘eaten whenevatsted by computer The common armel expressions 252 court Cen Pasig ne are wren nn station, with each operator wt eer the operands ‘Conair the simple the expression Ae +CeD, “Te sar (denoting mltpiaton i placed between to operand Aand Bor {Cand D. Tne pts between the two products To crate this athe ‘expres ts necesny fo compute the product A=B, sore this progut ‘eElccompusngt oO, andtnen ln thetwo proguc Pom tus exape we Sc that o evaluat artnet expressions ini notations necessary Sean back and forth slong the expression determine the neat person 2 Be peromed | "The FoathmateraticanLukasewie showed that arithmetic expres sion can be eprested in pf alton, Tia epesentaton, een feed to's Pull tation, aces the operator ele the operands. The tc ‘ston, relened tas hse Pash nation (RP places operate afer the operands: The lowing xanplesdemonstzate the tee representation ASB lofi station ‘The revere Fash notation i form stable fr sack maniplton, The expression aBecos+ and vlute a fos: Scan the expression from fight. Wham an ‘pentose ached, ptr the operation with the two opera fd ot {he let aide of the operator Remove the two opeande andthe oper an ‘place them bythe number bined fromthe eat Of te operaon CoN {Stoeto sean the expression and repeat the procedure for Sry Operator ‘cnoniyed unl tha meno mere peo Ta the epremion above we Bnd the opertor * ater A and 8. We pevorm the operation AB and eplace A,B and» bythe product © bin (asco where (A+) single quanti otnne rm the roduc. The next operator secre) Sack npn 253 Sa» and ts previous wo operand are Cand D, 20 we perform C+D and ‘hin an expression with Ww operands and oe opeor caeayceD) + ‘The ext operators + andthe two operands to be addedare th two products, Saver ad the wo quanes oan the res “The conversion om in oan fo reverse Polsh notton mus tke into conser te pestonlNesachy odoptd for at nctaton Tt ‘euch datenat we at pecorval amen er parece, then nae outer peremheses and do malspcaon and dsvon operations ‘nor aio ae eiacton operons, Conse the exreioh sarc syst “To esate the expression we mus fest perform the arth inside the prcnthees (© By and (Ds E) Nevt te must cleat the expesion Eide the tare Brcet. The malipiaton of C=(D +) must be done Port the addition a since malpton har presedenceoveraéaiton The operation the mulation af the to cms betwen the parentheses snd tacts The expresso can be covered fo reverse Poh own, ‘oct the use of parenthees, by taking into conaderton the open Flare The converted expetn ie ABS DESC + + Proceeding from fio ight, we ft ad Aan, hen add Dan EA this pont we te eh says Eee here (A + Band + E)are each sige number atsined fom he sm, ‘Theo operand forthe next» ae Cand (DE) These to mubers re Imp andthe produc added The fal * cae the mulation valuation of Arithmetic Expressions Reverse Pluh oan, combined wih asackarangementof reir the ‘os een may known lor ealaning sree exrenons Ta proce ‘Soe employed in some clecronicaleltors and aso in seme computes ‘esac pry atl nding cls prong tr eddres Gel my dng emery eddies or procs vgater Moreover ss dicused in te preceding scion he inracton may Rave ‘ore than one adress Eel and each acest Bld maybe ssc with ‘Bown percolreddreming ode “Anu mos addreming modes may the addres dof the inte ‘son, thre ae ve modes tat eedno addressed ata. Thane te the ‘plod and unmade modes Implied Mode: tn this mode the operands ar spcitd imply inthe ompamen representation) which can be ether postive oe negate, When {his number i added he cote of he program counter, heres p= ‘cer aneffecve adress whore poston in memory rele tothe adress ‘tthe net ineracton. To day with an example, acume ht the pogath “ntaine the number 2: The nstuctonsiacton 2s read om memany ‘ring te fete pase and tne progam counters then incremented by one {9 00, The etecine adaree computation forthe rate adese mode ‘634 as Thee 24 memory lations forward fom the adeno the ‘es intracton. Relative addresang soften sed wath branch ype are ‘ons when the branch address inthe ses rroundingthe auton word ‘eat Trea in a shorter adress lin he nario format nce the ‘elt eddren canbe opeced witha smaller nue of bs compared the ‘uber of is eed fo designate the ente memory aes. Indexed Addreing Mode:_In thi mode the conten ofan ndox repre [othe sade pare thelton ncounste ete sare The 264 ‘ar Con cei Ut index register « spec CPU register that contains an index vale. The (Hires fed ote nsracton does the beionng adres os st ary in memory. Each operand inthe aay is sored in memry rate tthe ‘opinning adres Tne distance Benween the beginning adress and the "daresr ofthe operandi the index vue fed in the index reper Any {pend in he aay can be asened with he sae ineacton provided that the inex register carta the coc index value. The index eiter a be Increment fact acceso conseetve operands. Note ta ian dex ‘Speinsracton des notin nodes eld in frat, theron covers othe eit nde mode of operation. ‘Some computers dete one CPU reper function sly aan index segiter. This ete saved imply when the index node nao [Steed In computers wit many processor registers ny one ofthe CTU ‘epee can contin te index tes auch cae the eter tt be Specied ely i egies Geld win the insracton frat Base Reiser Adesing Mode: In this made the content ofa base register [added tothe adress part f the struct o obtain the elective addres ‘Tass sat the need adaressng mode exept tha he eters now (aed toe ogiterinatund af an nde rite Te deence betwen tha ‘wo modes si the way they ae aed rier tha nthe way that they are omputed. An index reste sasumed to old an index aumbe ta is ‘elite tothe adres pao theinatucion A ace eiers nse toh ‘tas adden and the aden eld of the nstucon gives daplacrment feltve to this base adds. The base restr adarening mode used in Compuesto facta the relocation of programs in memary. When programs {dda are moved fom one segent of memory to anaher, a ejused in ‘muluprogtemmng systems the arse values 0 iatrucSons mun rele {hs change of positon. With a tase fegster, the duplacementtalues of Insractons donot nave to change, Onl the vali fhe ase episteregules “Updating to rete he begining ofa new memory seen [Nomerial Example To show the diferenes betwen the various mde, we wil show the eft th adaresing modes onthe ineracton defined ini 87, The two-word ‘Seracionstaddress00and301 ra londo AC intron wan adress ‘eidequl 9 Tne wordfthentracon spetieshe operon ce {nd mode, and he second word species he adarees part. PC ha he vise 10 for etching ths instacton. The content of procemor rier Rs 40, nd the content ofan indes reper Xe 100. AC reeves te operand ee {he intact is eared. ‘The Sgure ie ew pertinent ens and ‘Shows the emery content tcc ofthese aden.

Vous aimerez peut-être aussi