Computer Architecture

Start Lecture #8


A register is basically just an array of D flip-flops. For example a 32-bit register is an array of 32 D flops.

This, however, is not so good! We must have the write line correct quite a while before the active edge. That is you must know whether you are writing quite a while in advance.

An alternative is to use an active low write line, i.e. have a W' input.

To implement a multibit register, just use multiple D flops.

Register File

A register file is just a set of registers, each one numbered.

Reading From a Register File

To support reading a register we just need a (big) mux from the register file to select the correct register.

Writing a Register in a Register File

To support writing a register we use a decoder on the register number to determine which register to write. Note that errors in the book's figure were fixed.

  1. The decoder is log n to n (5 to 32 for MIPS).
  2. The decoder outputs are numbered 0 to n-1 (NOT n).

Note also that I show the clock explicitly.

Recall that the inputs to a register are W, the write line, D the data to write (if the write line is asserted), and the clock. We should perform a write to register r this cycle if the write line is asserted and the register number specified is r. The idea is to gate the write line with the output of the decoder.