CSCI341 Lecture 31, Control
RECALL... • The “datapath” is a representation of the flow of information (data, instructions) through the CPU • Implemented as combination of circuitry and combinatorial & sequential chips • In order for machine code to cause the machine to “act” a certain way, there must be control circuitry (not magic).
CONTROL
OUR IMPLEMENTATION • Simplified instruction set: • lw, sw, beq, add/sub/AND/OR, j
ALU CONTROL ALU control Function 0000 and 0001 or 0010 add 0110 sub 0111 set on lt 1100 nor
ALU CONTROL ALU control Function “Hey ALU, 0010!” 0000 and 0001 or 0010 add “Ok. My output is equal to the sum of my inputs. 0110 sub Happy now?” 0111 set on lt 1100 nor
ALU CONTROL • lw and sw • ALU computes memory address via addition • beq • ALU computes address via subtraction • R-types • ALU performs one of five actions (eg, add ) per funct
ALU CONTROL (We’re not going to care about the logic specifically used to generate ALU control input from ALUOp and Funct)
ALU CONTROL Multiple levels of control decoding are used. Why?
ALU CONTROL
INSTRUCTION FORMAT TO CONTROL SIGNALS
IMPORTANT POINTS OF CONTROL
IMPORTANT POINTS OF CONTROL
CONTROL UNIT
INSTRUCTIONS TO CONTROL UNIT TO CONTROL SIGNALS
add $t1, $t2, $t3
lw $t1, offset($t2)
beq $t1, $t2, label
j somewhere
CONTROL OVERVIEW
SINGLE-CYCLE INSTRUCTION SET • Look at the PC, fetch the instruction from that address • “Read” one or two registers per the instruction • Carry out the instruction • Prepare PC for the next instruction
SINGLE-CYCLE INSTRUCTION SET What’s wrong with this?
HOMEWORK • Reading 27 • Project 7, “Mmm!” yes, this is what the reading is really trying to tell you
Recommend
More recommend