资源描述:
《《多级存储器练习》word版》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、6.823ComputerSystemArchitectureDatapathforDLXSpring2002ProblemSet#2Studentsareallowedtocollaborateingroupsofupto3people.Agrouphandsinonlyonecopyofthesolutiontoaproblemset.Homeworkassignmentsaredueatthebeginningofclassonthesuedate.Tofacilitategrading,eachproblemmustbestapled
2、separately.Homeworkwillnotbeacceptedoncesolutionsarehandedout.Problem1:MicroprogrammingandBus-BasedArchitecturesProblem1.AHowmanycyclesdoesittaketoexecutethefollowinginstructionsinthemicrocodedDLXmachine?UsethestatesandcontrolpointsfromDLX-Controller-2andassumeMemorywillnot
3、assertitsbusysingal.Whichinstructiontakesthemostcyclestoexecute?Whichinstructiontakesthefewestcyclestoexecute?Problem1.BBenBitdiddleneedstocomputefactorialsforsmallnumbers.RealizingthereisnomultiplyinstructioninthemicrocodedDLXmachine,heusesthefollowingcodetocalculatethefac
4、torialofanunsignednumbern.ThevariablesI,j,n,temp,andresultareunsigned32-bitvalues.12WritetheDLXassemblythatimplementsBen’sfactorialcode.UseonlytheDLZinstructionsthatcanbeexecutedonthemicrocodedDLXmachine(ALU,ALUi,LW,SW,J,JAL,JR,JALR,BENQ,andBENS).ThemicrocodedDLXmachinedoes
5、nothavetobepreserved.HowmanyDLXinstructionsareexecutedtocalculateafactorial?Howmanycyclesdoesittaketocalculateafactorial?Again,usethestatesandcontrolpointsfromDLX-Controller-2andassumeMemorywillnotassertitsbusysignal.Problem1.CAlyssaP.HackertellsBenthathisfactorialcodewillr
6、unmuchfasterifheimplementsanunsignedmultiplyinstructioninthemicrocodedDLXmachine.ThenBencanreplacetheinnerloopinstructionswiththenewmultiplyinstruction.ThedetailsofAlyssa’snewproposedunsignedmultiplyinstructionare:ThevalueofRs1isaddedRs2timesandtheresultstoredintoRd.Rs1andR
7、s2aretreatedasunsigned32-bitvalues.IfRs2orRs1is0,thentheresultofRdwillalsobe0.TheformatoftheMULUinstructionisR-type.InordertobeabletowritemicrocodeforMULU,Alyssaaddsanadditionalregister,TO(33),totheregisterfile.Thisregister,likethePCregister,isnotvisibletotheprogrammer.Shea
8、lsoadds33asaninputtotheregisterfilemultiplexer.UsingWorksheet1,writemicrocodetoimp