V22.0436 - Prof. Grishman

Lecture 15: MIPS Processor Design: Single Cycle Control (cont'd)

Building the Control Unit

We have specified the control unit in terms of two truth tables, one for all the signals except the ALUop (Figure 5.18), one for the ALUop (Figure 5.13).  We then have to convert these two truth tables to combinational logic.  P&H do this in Appendix C, section 2.  For the main control unit, we use standard sum-of-products logic.  The full truth table, with opcode inputs and control signal outputs, is shown in Figure 5.22.  The resulting circuit is shown in Figure C.2.5.  For the ALU control unit, we take advantage of the don't cares in the truth table to produce a simple circuit, shown in Figure C.2.3.

Combining these circuits with the data path produces a complete computer (Figure 5.17).

A simulator for the single-cycle MIPS machine, PathSim, is available from St. Bonaventure University.

How the single cycle CPU works (pages 306-312)

Sequence reflects data flow ... everything happens in a single clock cycle.

for all instructions: fetch instruction from instruction memory

for R-type instructions:

for load: for store: for beq:

How fast?

For a synchronous machine, clock period must be greater than maximum propagation delay of combinational circuit (which computes next state).

So period for MIPS must be greater than time required for longest instruction.

How long is that?  Assume memories have 200 ps delay; ALU and adders 100 ps delay;  and the register file (for read or write) 50 ps delay.  (Text, pp. 315-316)

Can we do better?  To answer that, we must consider

Measuring Performance

Text: Chapter 4

What is performance? Computer performance is a measure of how long it takes to perform a task, or how many tasks can be performed in a given time period. The performance that matters to us is how long it takes to perform our tasks. However, unless we can afford to benchmark our task on each machine we are considering, we have to rely on more generic measures of computer performance.

For the moment, we shall just discuss CPU performance and ignore IO. The basic equation is:

time to run program = (number of instructions executed) * (average CPI) * (clock cycle time)

where CPI = number of clock cycles per instruction. For a given program, the number of instructions executed depends on the compiler used and on the architecture (instruction set). The average CPI depends on the implementation of the architecture.