资源预览内容
第1页 / 共33页
第2页 / 共33页
第3页 / 共33页
第4页 / 共33页
第5页 / 共33页
第6页 / 共33页
第7页 / 共33页
第8页 / 共33页
第9页 / 共33页
第10页 / 共33页
亲,该文档总共33页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
毕业设计说明书基于VHDL语言的8位RISC-CPU的设计学院:专业:学生姓名:学号:指导教师:2011年5月ARISCDesign:SynthesisoftheMIPSProcessorCoreA full die photograph of the MIPS R2000 RISC Microprocessor is shown above. The 1986 MIPS R2000 with five pipeline stages and 450,000 transistors was the world fsrst commercial RISC microprocessor. Photograph ?1995-2004 courtesy of Michael Davidson, Florida State UniversityJimrm.-i I 不广封*SA14.1TheMIPSInstructionSetandProcessorTheMIPSisanexampleofamodernreducedinstructionsetcomputer(RISC)developedinthe1980s.TheMIPSinstructionsetisusedbyNEC,Nintendo,Motorola,Sony,andlicensedforusebynumerousothersemiconductormanufacturers.Ithasfixed-length32-bitinstructionsandthirty-two32-bitgeneral-purposeregisters.Register0alwayscontainsthevalue0.Amemorywordis32bitswide.AsseeninTable14.1,theMIPShasonlythreeinstructionformats.OnlyI-formatLOADandSTOREinstructionsreferencememoryoperands.R-formatinstructionssuchasADD,AND,andORperformoperationsonlyondataintheregisters.Theyrequiretworegisteroperands,RsandRt.Theresultoftheoperationisstoredinathirdregister,Rd.R-formatshiftandfunctionfieldsareusedasanextendedopcodefield.J-formatinstructionsincludethejumpinstructions.Table 14.1 MIPS32-bitInstructionFormatsFieldSize6-bits5-bits5-bits5-bits5-bit$6-bitsR-FormatOpcodeRsRtRdShiftFunction1-FormatOpcodeRs一RtAddress/immedialevalueJ-FormatOpcodeBranchtargetaddressLWisthemnemonicfortheLoadWordinstructionandSWisthemnemonicforStoreWord.ThefollowingMIPSassemblylanguageprogramcomputesA=B+C.LW$2,B;Register2=valueofmemoryataddressBLW$3,C;Register3=valueofmemoryataddressCADD$4,$2,$3;Register4=B+CSW$4,A;ValueofmemoryataddressA=Register4TheMIPSI-formatinstruction,BEQ,branchesiftworegistershavethesamevalue.Asanexample,theinstructionBEQ$1,$2,LABELjumpstoLABELifregister1equalsregister2.Abranchinstructionaddsessfieldcontainstheoffsetfromthecurrentaddress.ThePCmustbeaddedtotheaddressfieldtocomputethebranchaddress.ThisiscalledPC-relativeaddressing.LWandSWinstructionscontainanoffsetandabaseregisterthatareusedforarrayaddressing.Asanexample,LW$1,100($2)addsanoffsetof100tothecontentsofregister2andusesthesumasthememoryaddresstoreaddatafrom.Thevaluefrommemoryisthenloadedintoregister1.Usingregister0,whichalwayscontainsa0,asthebaseregisterdisablesthisaddressingfeature.Table 14.2 MIPSProcessorCoreInstructionsMnemonicFormatOpcodeFieldFunctionFieldInstructionAddR032AddAddi18-AddlimmediateAdduR033AddUnsignedSubR034SubtractSubuR035SubtractUnsignedAndR036BitwiseAndOrR0137BitwiseORSilR00ShiftLeftLogicalSrlR02ShiftRightLogical8ltR042SetifLessThanLui115-LoadUpperImmediateLw135-LoadWordSw143StoreWordBeq14-BramchonEqualBns5-BranchonNotEqualJJ2-JumpJalJ3-JumpandLink(usedforCall)JrR08JumpRegister(usedforReturn)AsummaryofthebasicMIPSinstructionsisshowninTable14.2.IndepthexplanationsofallMIPSinstructionsandassemblylanguageprogrammingexamplescanbefoundinthereferenceslistedinsection14.11.AhardwareimplementationoftheMIPSprocessorcorebasedontheexampleinthewidelyusedtextbook,ComputerOrganizationandDesignTheHardwareSoftwareInterfacebyPattersonandHennessy,isshowninFigure14.1.ThisimplementationoftheMIPSperformsfetch,decode,andexecuteinoneclockcycle.StartingattheleftinFigure14.1,theprogramcounter(PC)isusedtofetchthenextaddressininstructionmemory.Sincememoryisbyteaddressable,fourisaddedtoaddressthenext32-bit(or4-byte)wordinmemory.Atthesametimeastheinstructionfetch,theadderaboveinstructionmemoryisusedtoaddfourtothePCtogeneratethenextaddress.Theoutputofinstructionmemoryisthenext32-bitinstruction.TheinstructionsopcodeisthensenttothecontrolunitandthefunctioncodeissenttotheALUcontrolunit.Theinstructionregisteraddressfieldsareusedtoaddressthetwo-portregisterfile.Thetwo-portregisterfilecanperformtwoindependentreadsandonewriteinoneclockcycle.Thisimplementsthedecodeoperation.4frar jc:d- :3b2aADD A.DD InstruelionMemoryPee dI MFuCl A:3i-0|Oontrcll*s:r_:l =-mr -ub75-51jCior;20-1&Rud月苗15 t三rRend二二”三,R由d口啊 !ltr2D-ata M emeryMu电独Reac 0fll9Inaf jcton曰nebMamWritflALUSre Rac;-恒-sf jcton?i3in 4ENtend/ALUALLI R白-i胃”Da:aCflntrnlFigure14.1MIPSSingleClockCycleImplementationThetwooutputsoftheregisterfilethenfeedintothedataALUinputs.ThecontrolunitssetuptheALUoperationrequiredtoexecutetheinstruction.Next,LoadandStoreinstructionsreadorwritetodatamemory.R-formatinstructionsbypassdatamemoryusingamultiplexer.Last,R-formatandLoadinstructionswritebackanewvalueintotheregisterfile.PC-relativebranchinstructionsusetheadderandmultiplexershownabovethedataALUinFigure14.1tocomputethebranchaddress.Themultiplexerisrequiredforconditionalbranchoperations.Afteralloutputshavestabilized,thenextclockloadsinthenewvalueofthePCandtheprocessrepeatsfort
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号