|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Combining datapaths:
R-type and memory |
|
|
|
|
|
|
|
Version 1: execute
instruction in 1 clock cycle |
|
|
|
|
No datapath resource can
be used more than once in a single instruction |
|
|
|
If needed more than once,
must be duplicated |
|
|
|
|
Separate instruction,
data memory |
|
|
|
Some resources can be
shared between different instruction types |
|
|
|
Need to have multiple
inputs |
|
|
|
|
|
Control signal to select
which to use: multiplexor |
|
|
|
|
Arithmetic-logical
(R-type) and memory access (load/store) are similar in some ways |
|
|
Differences |
|
|
|
|
|
|
Second operand input to
ALU: |
|
|
|
|
|
|
Register contents for
R-type |
|
|
|
|
|
Sign-extended immediate
value (offset) for load/store |
|
|
|
|
|
Value stored in
destination register: |
|
|
|
|
|
|
|
ALU output for R-type |
|
|
|
|
|
|
|
Data memory value for
load |
|
|
|
|
|
|
To combine datapaths: |
|
|
|
|
|
|
|
|
Select source of second
ALU operand |
|
|
|
|
|
|
|
Select source of data to
write to register |
|
|
|
|
|
|
Use 2 MUXes with control
inputs |
|
|
|
|
|
|
|
ALUsrc for ALU |
|
|
|
|
|
|
|
MemtoReg for register
write |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fig. 5.11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|