Close

Registers - so many choices

A project log for Nits Processor

8-bit TTL technology processor

cedCed 11/05/2019 at 11:050 Comments

CPUs are mainly temporary storage stuff with routing capabilites. To perform operations on data there is first the need to locally store this data (coming from memory, ROM or IOs) within the CPU.

There are even many types of registers in a CPU:

Registers can vary in width depending on the CPU (from 8 bits to 128 bits). In our example they will all be 8-bit wide as we only have 8-bit data and 8-bit address capability.

In the following we only talk about the general purpose registers (couting registers will be discussed later).

So what are the functions of a general purpose register in the context of our CPU:

Therefore we can see there is the need for 3 signals to instruct the register what to do:

However, something is key for a register : it's the timing of the loading function. Its has to be performed in a snapshot. This is why registers input the value from the bus on the rising edge of the clock. Therefore there is the need for 2 signals when inputing the values from the bus:

There are many ICs in the 74xx series that provide some of these features (so many choices).

In Ben's videos, he uses the 74LS173 (4 bit register with output enable signal, input enable signal, clock and master reset signal)

[Update : See my later post on register IC]

In practice we are not going to use the 3 state output and Output Enable capability of the 173 because we want to display the value of the register at all times on the LEDS. Therefore, the output is kept alway on. A separate chip is ised to provide the output buffering.

The 74HCT245 IC provides juste that : an octal buffer with 3 state output (it actually is bi-directional but we will use only one direction in this context). Note there is an existing single direction octal buffer, the 74HCT241 however the pinout is not as easy and in order to keep only one reference, we will use only the 245.

This chip offers 3 state output. This means that it can be seen as:

So the outcome is that we need only 3 chips and a bunch of leds and resistors to implement a general purpose register.

Note that the diagram above shows 2 more elements not mentionned above : the link between the register and the ALU (out of topic for now) and some inverters on the action lines as the chips expect active low signals (this can be optimized later on, but for learning purposes it is better to show uniform active high action signals).

Preview of the prototype (using the original 74LS173 IC):

Discussions