4 Solutions
Solution 4.1
4.1.1 The values of the signals are as follows:
RegWrite MemRead ALUMux MemWrite ALUOp RegMux Branch
a.
1 0 0 (Reg) 0
Add 1 (ALU)
0
b.
1 1 1 (Imm) 0
Add 1 (Mem)
0
ALUMux is the control signal that controls the Mux at the ALU input, 0 (Reg)
selects the output of the register fi le and 1 (Imm) selects the immediate from the
instruction word as the second input to the ALU.
RegMux is the control signal that controls the Mux at the Data input to the regis-
ter fi le, 0 (ALU) selects the output of the ALU and 1 (Mem) selects the output of
memory.
A value of X is a “don’t care” (does not matter if signal is 0 or 1)
4.1.2 Resources performing a useful function for this instruction are:
a.
All except Data Memory and branch Add unit
b.
All except branch Add unit and second read port of the Registers
4.1.3
Outputs that are not used
No outputs
a.
Branch Add
Data Memory
b.
Branch Add, second read port of Registers
None (all units produce outputs)
4.1.4 One long path for and instruction is to read the instruction, read the reg-
isters, go through the ALUMux, perform the ALU operation, and go through the
Mux that controls the write data for Registers (I-Mem, Regs, Mux, ALU, and Mux).
The other long path is similar, but goes through Control while registers are read
(I- Mem, Control, Mux, ALU, Mux). There are other paths but they are shorter,
such as the PC increment path (only Add and then Mux), the path to prevent
branching (I-Mem, Control, Mux uses Branch signal to select the PC + 4 input as
the new value for PC), the path that prevents a memory write (only I-Mem and
then Control, etc).
- 1
- 2
前往页