Learned basics of logic design. • Gates (And, Or, Nor, …) • Put gates together to
make. • Muxes. • Adders. • Latches. • Flip-flops. • … CS104 (Hilton): Datapaths ...
CS104 Computer Organization and Design Datapaths
CS104 (Hilton): Datapaths [Slides adapted from A. Roth’s]
1
Admin • Homework • Homework 4 out tonight • Due Monday March 26th • Download/check your submissions
• Reading: • Chapter 4 • (Maybe review 1.4)
• Midterm 2 • March 28
CS104 (Hilton): Datapaths [Slides adapted from A. Roth’s]
2
What did we do last week? • Who can remind us what we did last week?
CS104 (Hilton): Datapaths [Slides adapted from A. Roth’s]
3
What did we do last week? • Who can remind us what we did last week? • • • • •
Ski Go to the beach Sleep in Read a book …
• Ok, but seriously?
CS104 (Hilton): Datapaths [Slides adapted from A. Roth’s]
4
When last I saw you all.. • Last time I was here (Feb 27/29) • Learned basics of logic design • Gates (And, Or, Nor, …) • Put gates together to make • Muxes • Adders • Latches • Flip-flops • …
CS104 (Hilton): Datapaths [Slides adapted from A. Roth’s]
5
While I was at HPCA.. • Prof. Lebeck started teaching you all about datapaths • Putting logic together to execute instructions • Started on single-cycle datapath
• We’ll review/continue with single cycle • Then jump into more things!
CS104 (Hilton): Datapaths [Slides adapted from A. Roth’s]
6
Datapath for MIPS ISA • Consider only the following instructions add $1,$2,$3 addi $1,2,$3 lw $1,4($3) sw $1,4($3) beq $1,$2,PC_relative_target j absolute_target
• Why only these? • Most other instructions are the same from datapath viewpoint • The one’s that aren’t are left for you to figure out
CS104 (Hilton): Datapaths [Slides adapted from A. Roth’s]
7
Start With Fetch
+ 4
P C
Insn Mem
• PC and instruction memory • A +4 incrementer computes default next instruction PC CS104 (Hilton): Datapaths [Slides adapted from A. Roth’s]
8
First Instruction: add
+ 4
P C
Insn Mem
Register File s1 s2 d
• Add register file and ALU CS104 (Hilton): Datapaths [Slides adapted from A. Roth’s]
9
Second Instruction: addi
+ 4
P C
Insn Mem
Register File s1 s2 d S X
• Destination register can now be either Rd or Rt • Add sign extension unit and mux into second ALU input CS104 (Hilton): Datapaths [Slides adapted from A. Roth’s]
10
Third Instruction: lw
+ 4
P C
Insn Mem
a
Register File
Data d Mem
s1 s2 d S X
• Add data memory, address is ALU output • Add register write data mux to select memory output or ALU output CS104 (Hilton): Datapaths [Slides adapted from A. Roth’s]
11
Fourth Instruction: sw
+ 4
P C
Insn Mem
a
Register File
Data d Mem
s1 s2 d S X
• Add path from second input register to data memory data input CS104 (Hilton): Datapaths [Slides adapted from A. Roth’s]