4-bit register

Four bits of storage that all latch in on the same button press. A ready-made registers circuit you can open in the TorchAnvil simulator.

Store four bits at once

One D flip-flop remembers a single bit. Bundle four of them side by side, wire their clocks together, and you've got a 4-bit register — a circuit that remembers a whole nibble. That's the leap from "I can store a bit" to "I can store a number."

Set the four levers to whatever pattern you want. Press Load. All four lamps snap to the lever pattern, and they stay there when you wiggle the levers afterward.

How it works

Each flip-flop is an independent D latch, identical to the one in the D flip-flop sample. What makes them a register rather than four separate latches is the shared clock line: one button, fanned out to all four CLK inputs, so every FF sees the same rising edge at the same instant.

levers when you press Load lamps after
0000 0000
1010 1010
1111 1111
0101 0101

Flipping a lever without pressing Load has no effect — the register is holding its last captured value.

Why it matters

This is the shape of every general-purpose register in a real CPU. An x86 chip has sixteen 64-bit registers — same pattern, just 64 D flip-flops each, with sixteen separate clock lines so the control logic can choose which register to load. Shared-clock parallel capture is also how a DRAM row latches, how a PCI bus samples data, and how the pixels in your DSLR's sensor snap a frame.

Try this