Professional Documents
Culture Documents
1.whatismips, Mipsinstruction, Mipsimplementation: Mips R2000 Isa
1.whatismips, Mipsinstruction, Mipsimplementation: Mips R2000 Isa
1.whatismips, Mipsinstruction, Mipsimplementation: Mips R2000 Isa
WhatisMIPS,MIPSInstruction, MIPSImplementation
MIPS is implementation of a RISC architecture
MIPS Instructions
For allinstructions,thefirsttwostepsarecommon:
Settheprogramcounter(PC)tothememorylocationthatcontainsthecodeandfetchtheinstructionfr
omthatmemorylocation.
Read oneortworegisters,usingthefieldsoftheinstruction.
Afterthesetwosteps,theactionsrequiredtocompletetheinstructiondependsontheinstruct
ionclass.
Foreachofthethreeinstructionclassestheactionsareexactlythesame,independentofthe
exactopcode.
Across instructionstherearesome similarities.
o Forexample,allinstructionclasses,exceptjump,usethearithmetic-
logicalunit(ALU)afterreadingtheregisters.
o Thememory-referenceinstructionsusethe ALU
foranaddresscalculation,thearithmetic-
logicalinstructionsfortheoperationexecution,andbranchesforcomparison.
AfterusingtheALU,theactionsrequiredtocompletevariousinstructionclassesdiffer.
ReferAbovediagram,instructionsanddatamovegenerallyfromlefttorightthroughthefive
stagesastheycompleteexecution.
Thereare, however, twoexceptions to this left-to-right flow ofinstructions:
o Thewrite-back stage, which places theresultbackinto the registerfilein
themiddle ofthe datapath.
o Theselection ofthe next valueof thePC, choosingbetween the
incrementedPC and the branch address from theMEM stage.
Dataflowingfromrighttoleftdoesnotaffectthecurrentinstruction;thesereversedatamoveme
ntsinfluence onlylater instructions in the pipeline.
o The firstright-to-left flow ofdatacanlead todata hazards
o Thesecondright-to-left leads to controlhazards.
Toretainthevalueofanindividualinstructionfor
itsotherfourstages,thevaluereadfrominstructionmemorymustbesavedinaregister.Similarar
gumentsapplytoeverypipelinestage,sowemustplaceregisterswherevertherearedividingline
sbetweenstages.