1
IC220 Set #7:
Controlling the Single Cycle Implementation (Chapter Four)
2
Control
Selecting the and controlling the based on the
- Outline:
- 1. Overview
- 2. Controlling the ALU
- 3. Controlling multiplexors and register writes
IC220 Set #7: Controlling the Single Cycle Implementation (Chapter - - PDF document
IC220 Set #7: Controlling the Single Cycle Implementation (Chapter Four) 1 Control Selecting the and controlling the based on the Outline: 1. Overview 2. Controlling the ALU 3. Controlling multiplexors and register writes 2
Selecting the and controlling the based on the
0x09 0x7C0 or 0x7C2
add x9, x21, x3
stur x9, [x10, #240]
Example #1: add x9, x21, x3 Example #2: stur x8, [x10, #240]
11 bits 5 bits 6 bits 5 bits 5 bits
11 bits 9 bits 2 bits 5 bits 5 bits
address
10 8 240
ALU operation Function 0000 AND 0001 OR 0010 Add 0110 Subtract 0111 Pass input b 1100 NOR
Instruction Instruction
Opcode Desired ALU action ALU operation LDUR Load register 11111000010 STUR Store register 11111000000 CBZ Branch if zero 10110100000 ADD Add 10001011000 SUB Subtract 11001011000 AND AND 10001010000 ORR OR 10101010000
Note: book uses 2 bit “ALU Op” to help, but we’ll instead directly compute 4-bit “ALU operation” from opcode
– To get data to flow to the right places – To store data in the appropriate places
– ALUSrc – MemtoReg – MemRead – MemWrite – Branch – RegDst – RegWrite
Get Immed
– “SignExtend” unit takes 32 bit input, produces 64 bits output – Possible – but more than just “sign extend” is going on
– “SignExtend” unit replaced with “GetImmediate” – Still 32 bits input – Output depends on datapath width (16 bits in our CV example) – Controlled by 3 bit “ImmOp” signal
ImmOp Grab what bits? Sign extend?
001 20-5 No IW-type (movz) 100 25-0 Yes B-type (b) 101 23-5 Yes CB-type (cbz) 111 20-12 Yes D-type (ldur, stur)
SUB
0110 0010 0010 0111
ALU Operation
0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 1111 1111 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 1111 0000 0000 1111 1111
MOVZ X9, 255 // X9 = 255
Get Immed
To complete the MOVZ instruction, modify the control chart below (add a new row and any new signals, if necessary).
SUB
0110 0010 0010 0111
ALU Operation “ImmOp”
XXX 111 111 101
– Put all the “inputs” on the left side (and label with 0, 1, etc.) – Put the “output” on the right side – Put control/selector bits on top or bottom (don’t confuse them with the inputs!)
6 bits 26 bits
Get Immed
To complete the branch instruction, modify the control chart below (add a new row and any new signals, if necessary).
SUB
0110 0010 0010 0111
ALU Operation
“ImmOp”
XXX 111 111 101
– ALU might not produce “right answer” right away – we use write signals along with clock to determine when to write
We are ignoring some details like setup and hold times
Get Immed
Instruction Class Functional Units used by the instruction class R-type ldur stur cbz
Memory (200ps) ALU and adders (100ps) Register file access – read or write (50ps) Final Cycle Time?
Memory (200ps), ALU and adders (100ps), Register file access – read or write (50ps)
Get Immed
Memory (200ps), ALU and adders (100ps), Register file access – read or write (50ps)
Get Immed
Memory (200ps), ALU and adders (100ps), Register file access – read or write (50ps)
Get Immed