Professional Documents
Culture Documents
MIPS Datapath IF Decoder
MIPS Datapath IF Decoder
Computer Organization & Design, Hennesy & Patterson Chapter 5 (3rd) or 4 (4th)
Augusto Salazar
Departamento de Ingeniería de Sistemas
Universidad del Norte
augustosalazar@uninorte.edu.co
1
Datapath and Control
Datapath
– Set of functional units that are in charge of
making the operations
Control
– Units on charge of controlling the flow of
signals and the functional units of the
datapath
2
MIPS Implementation
A subset of MIPS is going to be implemented
The memory reference instructions load word (lw) and store word (sw)
3
MIPS´s High Level View
4
MIPS Implementation
The first two steps for any instruction are the same
1-- Send the PC (program counter) to the instruction memory and fetch that
instruction
2-- Read one or more registers depending of the instruction type and using
the fields from the instruction
3– Execution
Load and Store use the ALU to calculate the memory address (register +
offset)
Register type instructions use the ALU to make the operation
Branch uses the ALU to test the equality of the the values contained on the
registers
5
MIPS implementation
6
MIPS´s High Level View
7
MIPS´s High Level View
Including multiplexers and control lines
Adder
Sum
32
B Carry – Elements that
32
operate using the
input values
Selec
t – The output
A
32
MUX
depends
MUX Y
32 exclusively of the
B
32 inputs
O
– Same inputs will
P
always translate
A
32 into the same
ALU
State Elements
• An element has state if it has internal
storage
• Requires at least two inputs and one
output
We work with two at least two state
elements
• Registers
• Register File
10
Storage Element: Register (Basic
Building Block)
Register
– Similar to the D Flip Flop except
Write Enable
• N-bit input and output
• Write Enable input Data In Data Out
– Write Enable: N N
• negated (0): Data Out will not
change Clk
• asserted (1): Data Out will
become Data In
11
Building a datapath
12
Logisim implementation
We will start our Logisim implementation, it will cover:
Instruction fetch
• PC
• Instruction memory
• Adder
Addi
Load, Store
Branch , Jump
14