资源描述:
《VHDL-8位CPU设计-包含程序》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、ComputerOrganizationandArchitectureCourseDesignTheExperimentReportOfCPUI•PurposeThepurposeofthisprojectistodesignasimpleCPU(CentralProcessingUnit).ThisCPUhasbasicinstructionset,andwewillutilizeitsinstructionsettogenerateaverysimpleprogramtoverifyitsperformance.Forsimplicity,
2、wewillonlyconsidertherelationshipamongtheCPU,registers,memoryandinstructionset.Thatistosayweonlyneedconsiderthefollowingitems:Read/WriteRegisters^Read/WriteMemoryandExecutetheinstructions.AtleastfourpartsconstituteasimpleCPU:thecontrolunit,theinternalregisters^theALUandinstr
3、uctionset.whicharethemainaspectsofourprojectdesignandwillbestudied.II.InstructionSetSingle-addressinstructionformatisusedinoursimpleCPUdesign.Theinstructionwordcontainstwosections:theoperationcode(opcode),whichdefinesthefunctionofinstructions(addition,subtraction,logicoperat
4、ions,etc.);theaddresspart,inmostinstructions,theaddresspartcontainsthememorylocationofthedatumtobeoperated,wecalleditdirectaddressing.Insomeinstructions,theaddresspartistheoperand,whichiscalledimmediateaddressing.Forsimplicity,thesizeofmemoryis256X16inthecomputer.Theinstruct
5、ionwordhas16bits.Theopcodeparthas8bitsandaddressparthas8bits.TheinstructionwordformatcanbeexpressedinFigure1:OPCODE[15..0]ADDRESS[7..0]Figure1theinstruct!onformatTheopcodeoftherelevantinstructionsarelistedinTable1.InTable1,thenotation[x]representsthecontentsofthelocationxint
6、hememory.Forexample,theinstructionword00000011101110012(03B916)meansthattheCPUaddswordatlocationB9i6inmemoryintotheaccumulator(ACC);theinstructionword00000101000001112(050716)meansifthesignbitoftheACC(ACC[15])is0,theCPUwillusetheaddresspartoftheinstructionastheaddressofnexti
7、nstruction,ifthesignbitis1,theCPUwillincreasetheprogramcounter(PC)anduseitscontentastheaddressofthenextinstruction.Table1ListofopcodeoftherelevantinstructionsINSTRUCTIONOPCODECOMMENTSSTOREX0IHACC-[X]LOADX02H[XLACCADDX03HACC+[X]->ACCSUBX04HACC・[XLACCJMPGZX05HIFACC>0THENX->PCE
8、LSEPC+1-PCANDX06HACCand[X]-ACCORX07HACCor[X]-ACCNOTXOSHNot[X]-*ACCSHIFTRX09