Professional Documents
Culture Documents
Control Unit (Single Cycle Implementation) Building The Control Unit
Control Unit (Single Cycle Implementation) Building The Control Unit
• Limit ourselves to: • ALU control: combination of opcode and function bits
– R-R instructions: add, sub, and, or, slt – • Decoding of opcodes yields 3 possibilities hence 2
• OPcode = 0 but different function bits
bits
– Load-store: lw, sw
– Branch: beq – AluOp1 and ALUOp2
• ALU control • ALU control:
– Need to add for: add, lw, sw – Input 2 ALUop bits and 6 function bits
– Need to sub for: sub, beq – Output one of 5 possible ALU functions
– Need to and for :and – Of course, lots of don’t care for this *very* limited
– Need to or for :or implementation
– Need to set less than for : slt
1
MIPS FloorPlan & Control lines
Basic 3 Operation 1-bit ALU
2
ALU floorplan & Symbol Control lines
Op5
Signal R-type lw sw beq Op4
Op5 0 1 1 0 Op3
Op4 0 0 0 0 Op2 Suppose the following times apply ...
Op1
Op3
Op2
0
0
0
0
1
0
0
1 Op0 Memory units: 10ns Instruction Mix GCC
Op1 0 1 1 0
ALU and adders: 10ns
Op0 0 1 1 0 Register file ref: 5ns 22% Load
AND AND AND AND
RegDest 1 0 X X All other operations are 0ns. 11% Store
ALUSrc 0 1 1 0 Charges for instructions are ...
MemtoReg 0 1 X X
RegWrite 1 1 0 0 RegDst R-format: 30ns 49% R-type
MemRead 0 1 0 0 ALUSrc OR Load inst: 40ns
MemWrite 0 0 1 0 Store inst: 35ns 16% Branch
MemtoReg
Branch 0 0 0 1
RegWrite OR
Branch: 25ns 2% Jump
ALUOp1 1 0 0 0
ALUOp0 0 0 0 1
Jump: 10ns
MemRead
MemWrite
Branch
ALUOp1
ALUOp0