Title: Computer Organization Lecture 8
1Computer OrganizationLecture 8
- Detailed MIPS datapath
- Timing overview
2Project 2 overview
- Sixteen-bit ALU
- Use four LS181 plus some other logic
- Arithmetic , -
- Logical
- and, or
- shift left, shift right
3Project 2 hints
- Use four LS181s ALU
- Design shifter circuits
- Use muxes to select between ALU and shifters
- Design combinational logic to control muxes
consider a ROM
4Project 2 questions?
5MIPS datapath overview
- Instruction read from memory
- Registers selected for operation
- ALU performs function
- Result written to register
6Shift register review
7Shift register operation
- Clock Reset connected/bused to each flip-flop
- With Sin 1, data moves left-to-right on each
clock edge (1000, 1100, 1110, 1111) - We could modify the design
- 32-bit shift register
- Add combinational logic between flip-flops
8MIPS datapath
- Information moves left-to-right
9Key elements of datapath
- Shared memory instructions and data
- Single ALU
- PC increment by 4
- Functions , -, and, or, etc.
- Determines effective branch/jump addresses
- Temporary registers hold data between clock
edges (like shift register does)
10New temporary registers
- Instruction (IR) holds current instruction
- Memory data (MDR) holds data read from memory
- A, B holds data from register file
- ALUout holds ALU output (Project 2)
Note All of these are D-type flip-flops
11MIPS datapath
Clock 5
Clock Driver
- Data travels left-to-right on each clock edge
12Example timing
1
2
3
4
5
Instructions vary from 3 5 clocks
13Complete the table?
Instruction Total Clocks Clock Clock Clock Clock Clock
Instruction Total Clocks 1 2 3 4 5
add 1, 2, 3 4 x x x x
beq 1, 2, label 4 x x x
lw 1, offset (2) 5 x x x x x
sub 1, 2, 3 4 x x x x
sw 1, offset (2) 4 x x x x
j label 3 x x x
1 Instruction Fetch 2 Decode Register
Read 3 Execution
4 Memory Access 5 Register Write
14Datapath organization detail
4
2
1
3
5
Five muxes select between various sources
15Muxes added
- Address for memory PC or ALU
- Write register rs or rt
- Write data memory, ALU
- ALU first operand PC, Register 1
- ALU second operand Register 2, 0x4, sign
extended, sign extended shifted 2
16Timing parameters
tsu
tprop
- D flip-flop has setup and propagation delays
17Synchronous logic
Register
Register
Edge-triggered logic
- Clock period gt Tprop Tcomb Tset
18Find the Fmax?
Assume mem, reg, ALU dominant terms
Mem 20 ns Reg 15 ns ALU 55 ns
19Now add controller signals
20What do these signals do?
Signal Function?
IorD Controls address of memory PC, ALU
MemRead Puts memory in read mode
MemWrite Puts memory in write mode
IRWrite Write data to instruction register
RegDst Rs or rt for register write data
RegWrite Puts registers in write mode
21What do these signals do?
Signal Function?
ALUSrcA Data for A input of ALU
ALUOp Function code for ALU
ALUSrcB Data for B input of ALU
MemtoReg Data for the register write memory, ALU
22Branch and jump additions
- Next PC value, three possible sources
- PC4 ALU output
- Branch target ALUout register
- Jump address concatenation of PC31-28, IR25-0
shifted left 2, two lsb of zero - PC write control
- PCWrite unconditional (increments, jump)
- PCWriteCond conditional write for branch
23Complete datapath
new
24Datapath and controller
Controller Input
25(No Transcript)
26Complete the table?
Instruction Total Clocks Clock Clock Clock Clock Clock
Instruction Total Clocks 1 2 3 4 5
add 1, 2, 3 4 x x x x
beq 1, 2, label 3 x x x
lw 1, offset (2) 5 x x x x x
sub 1, 2, 3 3 x x x x
sw 1, offset (2) 4 x x x x
j label 3 x x x
1 Instruction Fetch 2 Decode Register
Read 3 Execution
4 Memory Access 5 Register Write
27Find the Fmax?
Assume mem, reg, ALU dominant terms
15 ns
55 ns
20 ns
Mem 20 ns Reg 15 ns ALU 55 ns Fmax
1/55ns 18.1 MHz
28What do these signals do?
Signal Function?
IorD Controls address of memory PC, ALU
MemRead Puts memory in read mode
MemWrite Data written to memory
IRWrite Data written to IR
RegDst Selects rs or rt for register write
RegWrite Data written to register file
29What do these signals do?
Signal Function?
ALUSrcA Determines ALU first operand
ALUOp Defines ALU function (, -, etc.)
ALUSrcB Determines ALU second operand
MemtoReg Memory or ALU is data for register write