



























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




























Control
Datapath
Memory
Processor Input
Output
Next PC
Operand
Fetch Instruction
Fetch
nPC_sel
Reg File^ Ext^ ALU
Reg. File
Mem Acces
s
DataMem
Result Store
MemRd MemWr^ RegDst^ RegWr
Equal MemToReg ExtOp^ ALUSrc^ ALUctr
A
B
R-type
A <= R[rs] B <= R[rt]
S <= A fun B
R[rd] <= S PC <= PC + 4
S <= A or ZX
R[rt] <= S PC <= PC + 4
ORi
S <= A + SX
R[rt] <= M PC <= PC + 4
M <= MEM[S]
S <= A + SX
MEM[S] <= B PC <= PC + 4
Next(PC)
“instruction fetch”
“decode”
Execute
Memory
Write-back
op-code
Map ROM
Counter
zero inc load
i
i+
i
None of above: Do nothing (for wait states)
Control Value Effect
Adder
Dispatch ROM
Mux
Opcode Dispatch State R-type 000000 0100 BEQ 000100 0011 ori 001101 0110 LW 100011 1000 SW 101011 1011
Microprogram
Main Memory
execution unit
control memory
User program plus Data
this can change!
AND microsequence
e.g., Fetch Calc Operand Addr Fetch Operand(s) Calculate Save Answer(s)
one of these is mapped into one of these
μseq μaddr A-mux B-mux bus enables register enables
Horizontal Vertical
src (^) dst
other control fields next states^ inputs
0 cond next address
1 dst src alu
Branch Jump
Register Xfer Operation
Register File
to control
enable signals from control
Control Value Effect
Adder
Dispatch ROM
Mux
Opcode Dispatch State R-type 000000 0100 BEQ 000100 0011 ori 001101 0110 LW 100011 1000 SW 101011 1011
Microprogram
IR <= MEM[PC] PC <= PC + 4
R-type ALUout <= A fun B
R[rd] <= ALUout
ALUout <= A or ZX
R[rt] <= ALUout
ORi ALUout <= A + SX
R[rt] <= M
M <= MEM[ALUout]
ALUout <= A + SX
MEM[ALUout] <= B
“instruction fetch”
“decode”
If A = B then PC <= ALUout
ALUout <= PC +SX
Q: What can we do in state 0001?
IR <= MEM[PC] PC <= PC + 4
R-type ALUout <= A fun B
R[rd] <= ALUout
ALUout <= A or ZX
R[rt] <= ALUout
ORi ALUout <= A + SX
R[rt] <= M
M <= MEM[ALUout]
ALUout <= A + SX
MEM[ALUout] <= B
“instruction fetch”
“decode”
If A = B then PC <= ALUout
ALUout <= PC +SX