东南大学CPU报告.docx

上传人:b****7 文档编号:15377378 上传时间:2023-07-04 格式:DOCX 页数:35 大小:639KB
下载 相关 举报
东南大学CPU报告.docx_第1页
第1页 / 共35页
东南大学CPU报告.docx_第2页
第2页 / 共35页
东南大学CPU报告.docx_第3页
第3页 / 共35页
东南大学CPU报告.docx_第4页
第4页 / 共35页
东南大学CPU报告.docx_第5页
第5页 / 共35页
东南大学CPU报告.docx_第6页
第6页 / 共35页
东南大学CPU报告.docx_第7页
第7页 / 共35页
东南大学CPU报告.docx_第8页
第8页 / 共35页
东南大学CPU报告.docx_第9页
第9页 / 共35页
东南大学CPU报告.docx_第10页
第10页 / 共35页
东南大学CPU报告.docx_第11页
第11页 / 共35页
东南大学CPU报告.docx_第12页
第12页 / 共35页
东南大学CPU报告.docx_第13页
第13页 / 共35页
东南大学CPU报告.docx_第14页
第14页 / 共35页
东南大学CPU报告.docx_第15页
第15页 / 共35页
东南大学CPU报告.docx_第16页
第16页 / 共35页
东南大学CPU报告.docx_第17页
第17页 / 共35页
东南大学CPU报告.docx_第18页
第18页 / 共35页
东南大学CPU报告.docx_第19页
第19页 / 共35页
东南大学CPU报告.docx_第20页
第20页 / 共35页
亲,该文档总共35页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

东南大学CPU报告.docx

《东南大学CPU报告.docx》由会员分享,可在线阅读,更多相关《东南大学CPU报告.docx(35页珍藏版)》请在冰点文库上搜索。

东南大学CPU报告.docx

东南大学CPU报告

Micro-programmedCPU

Report

COACourseDesign

止于至善

contents

Purpose.........................................................................................................................2

ExperimentPrinciple.....................................................................................................2

InstructionSet........................................................................................................2

InternalRegistersandMemory..............................................................................3

MAR(MemoryAddressRegister)....................................................................3

MBR(MemoryBufferRegister).......................................................................4

PC(ProgramCounter).....................................................................................4

IR(InstructionRegister)...................................................................................4

ACC(Accumulator)..........................................................................................5

MR(MultiplierRegister)..................................................................................5

DR(DivisionRegister)......................................................................................5

LPM_RAM_DQ.................................................................................................5

ALU(ArithmeticLogicUnit).............................................................................6

Micro-programmedControlUnit....................................................................6

CPUArchitecture............................................................................................8

ControlsignalsinControlMemory................................................................8

ContentsofControlMemory.........................................................................9

Toplevelcircuitdiagram.............................................................................................11

Simulationresults:

.......................................................................................................12

Problem1:

Calculatethesumofallintegersfrom1to100.........................12

Problem2:

Calculate300and275...............................................................14

ResultsAnalysis............................................................................................14

FurtherImprovement.................................................................................................15

Reference....................................................................................................................15

Appendix.....................................................................................................................15

1.MBRmodule...........................................................................................15

2.BRmodule..............................................................................................16

3.ALUmodule............................................................................................17

4.IRmodule...............................................................................................18

5.PCmodule..............................................................................................19

6.MARmodule...........................................................................................20

7.control_unitmodule..............................................................................21

8.MRmodule.............................................................................................22

1

止于至善

Purpose

ThepurposeofthisprojectistodesignasimpleCPU(CentralProcessingUnit).ThisCPUhasbasicinstructionset,andwewillutilizeitsinstructionsettogenerateaverysimpleprogramtoverifyitsperformance.Forsimplicity,wewillonlyconsidertherelationshipamongtheCPU,registers,memoryandinstructionset.Thatistosayweonlyneedtoconsiderthefollowingitems:

Read/WriteRegisters,Read/WriteMemoryandexecutetheinstructions.

AtleastfourpartsconstituteasimpleCPU:

thecontrolunit,theinternalregisters,theALUandinstructionset,whicharethemainaspectsofourprojectdesignandwillbestudied.

ExperimentPrinciple

InstructionSet

Single-addressinstructionformatisusedinoursimpleCPUdesign.Theinstructionwordcontainstwosections:

theoperationcode(opcode),whichdefinesthefunctionofinstructions(addition,subtraction,logicoperations,etc.);theaddresspart,inmostinstructions,theaddresspartcontainsthememorylocationofthedatumtobeoperated,wecalleditdirectaddressing.Insomeinstructions,theaddresspartistheoperand,whichiscalledimmediateaddressing.

Forsimplicity,thesizeofmemoryis256×16inthecomputer.Theinstructionwordhas16bits.Theopcodeparthas8bitsandaddressparthas8bits.TheinstructionwordformatcanbeexpressedinFigure1

Figure1theinstructionformat

TheopcodeoftherelevantinstructionsarelistedinTable1.InTable1,thenotation[x]representsthecontentsofthelocationxinthememory.Forexample,theinstructionword00000011101110012(03B916)meansthattheCPUaddswordatlocationB916inmemoryintotheaccumulator(ACC);theinstructionword00000101000001112(050716)meansifthesignbitoftheACC(ACC[15])is0,the

2

止于至善

CPUwillusetheaddresspartoftheinstructionastheaddressofnextinstruction,ifthesignbitis1,theCPUwillincreasetheprogramcounter(PC)anduseitscontent

InternalRegistersandMemory

MAR(MemoryAddressRegister)

MARcontainsthememorylocationofthewordtobereadfromthememoryorwrittenintothememory.Here,READoperationisdenotedastheCPUreadsfrommemory,andWRITEoperationisdenotedastheCPUwritestomemory.Inourdesign,MARhas8bitstoaccessoneof256addressesofthememory.

Inmyexperiment,theMARblockisasfigure2

mar

inst6

Figure2

3

止于至善

MBR(MemoryBufferRegister)

MBRcontainsthevaluetobestoredinmemoryorthelastvaluereadfrommemory.MBRisconnectedtotheaddresslinesofthesystembus.Inourdesign,MBRhas16bits.

Inmyexperiment,theMBRblockisasfigure3

mbr

inst3

Figure3

PC(ProgramCounter)

PCkeepstrackoftheinstructionstobeusedintheprogram.Inourdesign,PChas8bits.

Inmyexperiment,thePCblockisasfigure4

Figure4

IR(InstructionRegister)

IRcontainstheopcodepartofaninstruction.Inourdesign,IRhas8bits.BR(BufferRegister)BRisusedasaninputofALU,itholdsotheroperandforALU.Inourdesign,BRhas16bits.

Inmyexperiment,theInstructionregisterisasfigure5

4

止于至善

Figure5

ACC(Accumulator)

ACCholdsoneoperandforALU,andgenerallyACCholdsthecalculationresultofALU.Inourdesign,ACChas16bits.

MR(MultiplierRegister)

MRisusedforimplementingtheMPYinstruction,holdingthemultiplieratthebeginningoftheinstruction.Whentheinstructionisexecuted,itholdspartoftheproduct.

Inmyexperiment,theMRisasfigure6

Figure6

DR(DivisionRegister)

DRisusedforimplementingtheDIVinstruction,youcandefineitaccordingtoyourdivisionalgorithm.It’soptional.Here,weignoreit.

LPM_RAM_DQ

LPM_RAM_DQisaRAMwithseparateinputandoutputports,itworksasmemory,anditssizeis256×16.Althoughit’snotaninternalregisterofCPU,weneedittosimulateandtesttheperformanceofCPU.Alltheregistersarepositive-edge-triggered.AlltheresetsignalsfortheregistersareALU.

5

止于至善

Figure7

ALU(ArithmeticLogicUnit)

ALUisacalculationunitwhichaccomplishesbasicarithmeticandlogicoperations.Inourdesign,someoperationsmustbesupportedwhicharelistedasfollowsesynchronizedtotheclocksignal.

Inmyexperiment,theALUblockisasfigure8

Figure8

Table2ALUoperations

Micro-

programmedControlUnit

WehavelearnttheknowledgeofMicro-programmedcontrolunit.Here,weonlyreviewsometermsandbasicstructures.IntheMicro-programmedcontrol,themicro-programconsistsofsomemicroinstructionsandthemicro-programisstoredincontrolmemorythatgeneratesallthecontrolsignalsrequiredtoexecutethe

6

止于至善

instructionsetcorrectly.Themicroinstructioncontainssomemicro-operationswhichareexecutedatthesametime.

Microinstructionsarestoredinthecontrolmemory.Thecontroladdressregistercontainstheaddressofthenextmicroinstructionstoberead.Whenamicroinstructionisreadfromthecontrolmemory,itistransferredtoacontrolbufferregister.Theregisterconnectstothecontrollinesemanatingfromthecontrolunit.Thus,readingamicroinstructionfromthecontrolmemoryisthesameasexecutingthatmicroinstruction.Thethirdelementshowninthefigure9isasequencingunitthatloadsthecontroladdressregisterandissuesareadcommand.

ControlMemory

ControlBufferRegister

Figure9ControlUnit

InmyCPU,thecontroladdressisdefinedasavariable,withoutasinglepart.Thecontrolunitisasfigure10.Andthecontrolmemoryisasfigure11.

7

止于至善

control_unit

inst2

Figure10

lpm_rom0

inst8

Figure11

CPUArchitecture

Figure12

ControlsignalsinControlMemory

Table3ControlSignals

8

止于至善

Bitinread-only

controlmemory

(BitofROM)

Micro-operation

Controlsignalname

C0

CAR←CAR+1

IncreaseCAR

C1

CAR←**

Controladdressing

C2

CAR←0

ResetCAR

C3

MBR←memory

ReadRAM

C4

IRopcode←MBR(15..8)

MBRintoIRopcode

C5

MAR←MBR[7..0]

MBRintoMAR

C6

PC←PC+1

IncreasePC

C7

BR←MBR

MBRintoBR

C8

ACC←0

reset_ACC

C9

ACC←ACC+BR

AD

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 医药卫生 > 基础医学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2