Session 18 ! Processors: Datapath & Control CS212 Computer Organization 32
Session 18
Processors: Datapath & Control
Single-cycle Datapath Implementation
" Single datapath from pieces:
# R-type + load-store datapath: " p. 352.
# Add instruction fetch datapath: " p. 353.
# Add conditional branch datapath: " p. 354.
Control Unit for Single-cycle Datapath
1. Datapath control:
# Black box view of datapath.
# Input control signals:
# ALU control: ALU 3-bit control lines (" p. 240, repeated p. 353).
# Path control (three 1-bit): MUX controls.
# Device control (three 1-bit): example: memory read/write controls.
2. Control unit: multi-level design.
# ALU control: generate ALU 3-bit control lines
# Main control unit: generate remaining control lines.
3. ALU control:
# Outputs: ALU 3-bit control lines.
# Inputs: 2-bit ALUOp, 6-bit funct field (" p. 118).
# Truth table (" p. 356): 8-bit input & 3-bit output, simplified 256-line table.
# [CS111] Construction: truth table (reduction: K-map or table) -> minimized Boolean
functions -> logic circuit (example: 2-level AND-OR logic implementation).
4. Instruction decode:
# Analyze datapath instructions (review MIPS instruction formats " p. 118).
# " Wiring instruction decoder.
Example 31. Show how add instruction is decoded.
Assembly instruction add $s0, $s1, $s2
machine code 0, 17, 18, 16, 0, 32 (0x02328020)
109876 54321 09876 54321 09876 543210
000000 10001 10010 10000 00000 100000
Opcode op = instr[31–26] = 000000
Source operand(s) rs = instr[21–25] = 10001, rt = instr[16–20] = 10010
Destination operand rd = [11–15] = 10000
Function funct = instr[0–5] = 100000
Decoder op wired to main control unit input.
rs wired to read register 1 control of register file.
rt wired to read register 2 control of register file.
rd wired to write register control of register file.
funct is wired to ALU Control input.
5. Remaining control signals:
# External (datapath control):
# Description: " p. 359.
# Dependency: all depend on operation (from 6-bit op field in instruction word).
# PC source MUX control (PCSrc) also depends on ALU zero detector output.
# Define new control signal, Branch, where PCSrc = Branch and Zero (implement beq).
" Ch 5.3
Session 18 ! Processors: Datapath & Control CS212 Computer Organization 33
$Exercise 31. Support bne instead of beq.
$Exercise 32. Support bne and beq at the same time.
# Internal (ALU control): ALUOp.
6. Main control unit (" p. 360):
# Inputs: 6-bit op field.
# Outputs: 7-bit datapath control signals, 2-bit ALUOp.
# Truth table: " p. 370.
# [CS111] Construction: truth table -> minimized Boolean function -> logic circuit.
$Exercise 33. Support bne and beq at the same time without adding new
control lines.
Keywords
Control unit (CU), “don’t care”, reduction, wiring decode.
______________________________
Homework 7 as submitted is not acceptable! The new assignment is: (a) in exercises 32,33 (session 18) explain why your logic does not work, (b) redo 32 and 33. Everybody must submit. Those who don't will lose 2 marks from test 3 (or test 4 if you miss 3!). I expect you to apply CS111 knowledge. Your solution must show: logic definition, problem encoding, truth table construction, output function(s) simplification and realization (for example, SOP or POS).
Session 18
Processors: Datapath & Control
Single-cycle Datapath Implementation
" Single datapath from pieces:
# R-type + load-store datapath: " p. 352.
# Add instruction fetch datapath: " p. 353.
# Add conditional branch datapath: " p. 354.
Control Unit for Single-cycle Datapath
1. Datapath control:
# Black box view of datapath.
# Input control signals:
# ALU control: ALU 3-bit control lines (" p. 240, repeated p. 353).
# Path control (three 1-bit): MUX controls.
# Device control (three 1-bit): example: memory read/write controls.
2. Control unit: multi-level design.
# ALU control: generate ALU 3-bit control lines
# Main control unit: generate remaining control lines.
3. ALU control:
# Outputs: ALU 3-bit control lines.
# Inputs: 2-bit ALUOp, 6-bit funct field (" p. 118).
# Truth table (" p. 356): 8-bit input & 3-bit output, simplified 256-line table.
# [CS111] Construction: truth table (reduction: K-map or table) -> minimized Boolean
functions -> logic circuit (example: 2-level AND-OR logic implementation).
4. Instruction decode:
# Analyze datapath instructions (review MIPS instruction formats " p. 118).
# " Wiring instruction decoder.
Example 31. Show how add instruction is decoded.
Assembly instruction add $s0, $s1, $s2
machine code 0, 17, 18, 16, 0, 32 (0x02328020)
109876 54321 09876 54321 09876 543210
000000 10001 10010 10000 00000 100000
Opcode op = instr[31–26] = 000000
Source operand(s) rs = instr[21–25] = 10001, rt = instr[16–20] = 10010
Destination operand rd = [11–15] = 10000
Function funct = instr[0–5] = 100000
Decoder op wired to main control unit input.
rs wired to read register 1 control of register file.
rt wired to read register 2 control of register file.
rd wired to write register control of register file.
funct is wired to ALU Control input.
5. Remaining control signals:
# External (datapath control):
# Description: " p. 359.
# Dependency: all depend on operation (from 6-bit op field in instruction word).
# PC source MUX control (PCSrc) also depends on ALU zero detector output.
# Define new control signal, Branch, where PCSrc = Branch and Zero (implement beq).
" Ch 5.3
Session 18 ! Processors: Datapath & Control CS212 Computer Organization 33
$Exercise 31. Support bne instead of beq.
$Exercise 32. Support bne and beq at the same time.
# Internal (ALU control): ALUOp.
6. Main control unit (" p. 360):
# Inputs: 6-bit op field.
# Outputs: 7-bit datapath control signals, 2-bit ALUOp.
# Truth table: " p. 370.
# [CS111] Construction: truth table -> minimized Boolean function -> logic circuit.
$Exercise 33. Support bne and beq at the same time without adding new
control lines.
Keywords
Control unit (CU), “don’t care”, reduction, wiring decode.
______________________________
Homework 7 as submitted is not acceptable! The new assignment is: (a) in exercises 32,33 (session 18) explain why your logic does not work, (b) redo 32 and 33. Everybody must submit. Those who don't will lose 2 marks from test 3 (or test 4 if you miss 3!). I expect you to apply CS111 knowledge. Your solution must show: logic definition, problem encoding, truth table construction, output function(s) simplification and realization (for example, SOP or POS).
