























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
























Implementing MIPS
**- Reviewing MIPS Instruction Set
MIPS Datapath
Simplicity is an exact
medium between too little
and too much.
Sir Joshua Reynolds ope.
address
Implementing MIPS:
the Fetch/Execute Cycle
Overview: Processor
Implementation Styles
needs
State Elements on the Datapath:
Register File
Register file with two read ports and one write
port
Read register
number 1 Read
data 1
Read
data 2
Read register
number 2
Write
register
Write
data Write
Read ports are implemented
with a pair of multiplexors
5-bit multiplexors for 32 registers
Write port is implemented using
a decoder
5-to-32 decoder for 32 registers
Clock is relevant to write as
register state may change
only at clock edge
State Elements on the Datapath:
Register File
Datapath: Instruction Store/Fetch &
PC Increment
PC
Instruction
memory
Instruction
address
Instruction
a. Instruction memory b. Program counter
Add Sum
c. Adder
Three elements used to store
and fetch instructions and
increment the PC
Datapath
Animating the Datapath
Instruction <- MEM[PC]
PC <- PC + 4
Memory
PC
Instruction
ADD
Animating the Datapath
add rd, rs, rt
Register File
op rs rt rd shamt funct
ALU
Instruction
Datapath:
Load/Store Instruction
16 32 Sign
extend
b. Sign-extension unit
MemRead
MemWrite
Data
memory
Write
data
Read
data
a. Data memory unit
Address
Instruction
16 32
Registers
Write
register
Read
data 1
Read
data 2
Read
register 1
Read
register 2
Data
memory
Write
data
Read
data
Write
data
Sign
extend
ALU
result
Zero
ALU
Address
MemRead
MemWrite
RegWrite
ALU operation 3
Two additional elements used
To implement load/stores
Datapath
Animating the Datapath
op rs rt offset/immediate
Register File
ALU
Memory
sw rt, offset(rs)
Datapath: Branch Instruction
Datapath
op rs rt offset
MIPS Datapath I: Single-Cycle
Combining the datapaths for R-type instructions
and load/stores using two multiplexors
Animating the Datapath:
R-type Instruction
add rd,rs,rt
Register File
ALU
Data
Memory
Instruction