A Simple Implementation

Tom Kelliher, CS 240

Mar. 29, 1999

Administrivia

Announcements

Assignment

From Last Time

Focus upon individual parts of the datapath.

Outline

  1. Simple execution example.

  2. Drawing the pieces together.

  3. Understanding the control hooks.

Coming Up

The control unit.

Execution Example

Consider a simple datapath:

  1. Straight-line execution only.

  2. Four word program memory.

  3. Four word register file.

  4. Simple ALU.

Show the execution of the following C statement:

d = a + b - c;
Fake the control signals. Assume the following instruction format:

Important points:

  1. State changes on falling clock edge.

  2. Propagation delays:
    1. Memory read: 50 ns.

    2. Register file read: 10 ns.

    3. ALU operation: 10 ns.

    4. Register file write set-up: 3 ns.

  3. Assume a 100 ns clock period.

Is the clock period optimal? (What part of the propagation did we forget?)

A Simple Implementation Scheme

Reconcile the various facets of the datapath design. The final result:

Instructions implemented:

  1. lw, sw.

  2. beq.

  3. add, sub, and, or, slt.

ALU Control

Recall ALU control inputs:

  1. 000 --- AND.

  2. 001 --- OR.

  3. 010 --- add.

  4. 110 --- subtract.

  5. 111 --- slt.

ALU op signals:

  1. 00 --- lw, sw.

  2. 01 --- beq.

  3. 10 --- R-format.

Funct field for R-format instructions:

  1. 100000 --- add.

  2. 100010 --- subtract.

  3. 100100 --- and.

  4. 100101 --- or.

  5. 101010 --- slt.

Truth table for ALU control outputs?

Control signals

  1. RegDst --- selects rt or rd field as write address.

  2. RegWrite --- write enable.

  3. ALUsrc --- selects rd2 or immediate data.

  4. PCSrc --- selects PC + 4 or branch target.

  5. MemRead --- read enable.

  6. MemWrite --- write enable.

  7. MemToReg --- selects ALU output or memory data to register file write data port.



Thomas P. Kelliher
Sun Mar 28 22:16:42 EST 1999
Tom Kelliher