CODE
The Hidden Language of Computer Hardware and Software
2nd Edition

Chapter 22. Registers and Busses

This chapter begins exploring how the various components of the CPU are connected with an 8-bit data bus and a 16-bit address bus, The chapter focuses mostly on the Register Array, which stores bytes in seven registers called A (the Accumulator), B, C, D, E, H (for “high”), and L (for “low”).

The Simple Register Array (page 344)

Here's the simple version of the Register Array. Seven latches are labeled with letters corresponding to the seven registers. However, for space considerations, the input and output signals of the latches are not labeled. The 8-bit input of each latch is on the top; the output is on the bottom; the Clock signal is on the left. These latches are controlled by the Clock and Input Select signals at the top left.

The outputs of the latches are combined with seven tri-state buffers. As with the laches, the inputs are on the top; the outputs on the bottom; the Enable signals are on the right. These are controlled with the Enable and Output Select signals at the top right.

Your browser does not support the canvas element.

The Accumulator is always available because that becomes the A input to the Arithmetic Logic Unit.

The Incrementer / Decrementer (pages 350 – 351)

In a couple cases it's necessary to increment and decrement 16 bit values. For this reason, it's convenient for the CPU to have a circuit dedicated for this job.

Your browser does not support the canvas element.

You can dial up a 16-bit hexadecimal number using the spin control at the center top. Each up-arrow and down-arrow controls a single digit. Then, press the Clock button at the upper left to store that value in the 16-bit register. Pressing either the Decrement or Increment button at the upper right will enable the tri-state buffer to display the result at the bottom.

Watch out! If you experiement with various values, it's easy to forget to press the Clock to store the new value in the latch.

The More Versatile Register Array (pages 347 and 352 – 353)

The (relatively) simple Register Array shown above needs to be enhanced in two ways to make it more versatile. First, the Accumulator register needs to be independently controlled, so that values can be saved in the Accumulator and later retrieved. This is the additional circuitry at the left of the diagram.

Secondly, the H and L registers need to be connected to the address bus. The HL register pair is used for addressing memory, and the register pair can be incremented and decremented. This requires more extensive modifications shown at the right

In the next chapter, this Register Array will be connected to an 8-bit data bus and a 16-bit address bus. The data bus is symbolized here by the 8-bit spin control at the top and the 8-Bit Output at the bottom. The address bus is symbolized by the 16-bit spin control and the 16-bit Output.

Your browser does not support the canvas element.

This Register Array is compatible with the early Register Array but it also has five new control signals:

To save the value on the data bus (the value selected by the 8-bit spin control) in the Accumulator, press the Accumulator Clock button. To expose the value of the Accumulator on the data bus, press the Accumulator Enable button.

The value on the address bus can be specified with the 16-bit spin control. To save that in the HL register pair, first press HL Select so that button lights up. That selects the 32 bit value from the spin control. Then press HL Clock to save the 16-bit value in the H and L registers. To expose the value of the HL register pair on the address bus (symbolized here by the 16-Bit Output display), press the HL Enable button.