Multicycle MIPS Implementation
Tom Kelliher, CS 240
Apr. 5, 1999
Be ready to explain the use of the control signals and explain the
sequencing needed by each instruction class.
Finished the single cycle implementation.
- Introduction.
- Components added to the datapath.
- The complete datapath and its control signals.
Sequencing the multicycle implementation.
- Instruction cycle broken into a number of clock cycles.
- Functional units can be shared: Use ALU for incrementing PC.
Hardware savings.
- Instructions can take differing numbers of clock cycles.
High-level block diagram:

Features relative to single cycle implementation:
- Single, unified memory.
- Eliminated two adders.
- Registers added between major functional to hold values for next
clock cycle. Are they architectural registers?
Two uses for additional registers:
- Fitting the clock cycle.
- Holding values needed during a later clock cycle of this
instruction.
Example: computing and holding branch target address before the
instruction is decoded.
Determining where to place registers for timing purposes:
- All combinational paths must fit into one clock cycle.
- Assume that a clock cycle can accommodate at most one of the
following:
- Memory access.
- Register file access.
- ALU operation.
- The added registers:
- Instruction register (IR): Holds the currently executing
instruction.
- Memory data register (MDR): Holds the memory word from a
lw.
- Register file read registers (A and B): Buffers read data from
register file.
- ALU out register (ALUout): Buffers output from ALU.
Needed because we eliminated the adders. We'll need to add them back
later.
- PC to upper input.
- Constant 4 and sign-extended, shifted immediate field to lower
input.

Control signals:
- RegDst, RegWrite.
- ALUSrcA: Choose between PC and Rs.
- MemRead, MemWrite, MemtoReg.
- IorD: Choose between PC and ALUOut for memory address.
- PCWrite: Load a new value into PC.
- PcWriteCond: Load a new value into PC if zero is active.
- ALUOp.
- ALUSrcB: Choose between Rt/Rd, 4, sign-extended immediate,
sign-extended shifted immediate.
- PCSource: Choose between PC + 4, ALUOut (branch target address), jump
address
Thomas P. Kelliher
Mon Apr 5 00:05:17 EDT 1999
Tom Kelliher