Registers are sequential circuits that can store -bits of information. They’re implemented with flip-flops, since they can each store one bit of information. They share a common clock signal, reset signal, and enable signal to determine whether they should be reading in their input values. All loading is done in parallel at the clock edge. We can specify registers in Verilog with the reg type.1

Circuit variants

Shift registers

A register that can shift its contents is called a shift register, i.e., where the bits can be shifted to the right or to the left as needed (binary multiplication/division by 2).2

Register file

A register file is used to access each -bit register in a processor in a way that’s needed to fetch data for instruction execution. For an -bit processor with number of registers, the RF will take in two bit inputs and output two bit outputs. The register file is made up of the registers themselves, as well as a decoder and multiplexers. The choice of which registers to pull data from is determined by the multiplexers, the output of which is controlled by the two register inputs.

A write signal determines if we write a value into a particular register. If write = 1, the data stored in W is written into the connected registers. Registers are written to based on whether the enable signal in each individual register is on. reg_w is passed into a decoder, which allows us to select a specific register to write to.

Footnotes

  1. Technically speaking, reg doesn’t specify registers. In practice, it’s used for this purpose.

  2. From Prof Korst’s lecture notes.