Register8 (8-bit Register)

Inputs

PinTypeDescription
Databus8Input value to store (8 bits)
ClockbitClock signal
WEbitWrite Enable: 1 = write Data on Clock edge

Outputs

PinTypeDescription
Qbus8Stored value (current contents)

How It Works

On the rising edge of Clock (0→1), if Write Enable (WE) is 1, the Data input is copied into the register and appears on Q. Between clock edges, Q holds the stored value unchanged.

Important: if the WE pin is left unconnected, the isInputConnected check returns false, and WE defaults to 1 — meaning the register writes on every clock edge. To prevent unintended writes, always connect WE to a control signal (typically from the Decoder).

The Register8 is a sequential node (tcSequential). Its output commits atomically in phase 2 of the three-phase solver, preventing partial updates during simulation.

Usage

Featured in level 12. Serves as the processor accumulator — stores the result of each ALU operation. Also used for intermediate results and temporary storage in CPU designs.