Tom Kelliher, CS 240
Background reading: pp. 353--370.
Completed datapath, considered control signals.
- The control environment.
- Setting the control signals.
- The control unit.
- Adding an instruction.
- Disadvantages of the single cycle implementation.
A multi-cycle implementation.
- Instructions: 5 R-format(AND, OR, add, sub, slt), lw, sw, beq.
- Instruction formats:

- Summary of control signals:
- RegDst --- selects rt or rd field as write address.
- RegWrite --- write enable.
- ALUsrc --- selects rd2 or immediate data.
- PCSrc --- selects PC + 4 or branch target.
- MemRead --- read enable.
- MemWrite --- write enable.
- MemToReg --- selects ALU output or memory data to register file
write data port.
- Datapath block diagram:

``Playing the puppet.''
How should the control signals be set (0, 1, x) for each of the following?
- R-format instructions.
- lw.
- sw.
- beq.
- Is it combinational or sequential?
- Why are its only inputs the opcode bits?
The control unit in place:

How do we go about adding support for the jump instruction?
Assume the following:
- Memory read/write: 2 ns.
- ALU and adders: 2 ns.
- Register file read/write: 1 ns.
- All other delays are zero (not practical).
How much time is required for each instruction? (Emphasize notion of
longest path.)
Further assume two implementations:
- Fixed clock rate.
- Variable clock rate, on a per-instruction basis.
Given an instruction mix: 24% loads, 12% stores, 44% R-format, 18%
branches, 2% jumps, calculate the speedup of the variable clock rate
machine.
Suppose we need to add a 15 ns. instruction that is used 5% (changing
R-format percentage to 39%)?
A single cycle machine cannot take advantage of differences in instruction
execution times.
Thomas P. Kelliher
Wed Mar 31 08:29:28 EST 1999
Tom Kelliher