Visual walkthrough — D latch and gated latches
Step 0 — The alphabet (what the symbols even mean)
Before any circuit, let us agree on the tiny language we will use. In digital hardware every wire carries exactly one of two values.
Now three named wires we will keep for the whole page:
- — the data wire. The single bit you want to store.
- — the enable wire. A gate: it decides whether the latch is listening.
- — the output wire. The bit the latch is currently showing / remembering.
And three tiny operations, each of which is a physical gate (a little box you can build):
The dot is AND, the plus is OR, the bar is NOT. That is the entire alphabet. Everything below is spelled with these letters.

Step 1 — The starting point: a latch that remembers
WHAT. We begin with the thing from SR Latch: two cross-coupled gates that can stay in a state after you let go. Think of it as a lamp that, once lit, keeps itself lit — it has memory. Its stored bit is what we call .
WHY. A plain logic gate forgets instantly: change the input, the output changes, no history. To store a bit we need feedback — the output loops back and reinforces itself. That loop is the source of memory. Without it, there is no "remember", and the entire idea of a latch collapses.
PICTURE. Below, the output curves back into the box that produced it (the pink feedback arrow). That returning arrow is literally "yesterday's answer coming back to influence today". Hold that image — the loop is why can appear on the right-hand side of our final equation.

The raw SR latch has two inputs, (set → force ) and (reset → force ), and one villain: if it breaks (the forbidden state). We will now cage it.
Step 2 — The gate: making the latch listen only when told
WHAT. We insert one AND gate on each input. Instead of raw and reaching the memory loop, we feed it and .
WHY. AND is the perfect "permission" gate. Recall from Step 0: is 1 only if both are 1. So can only be 1 when . The moment , both and are forced to 0 no matter what the outside world screams. Zero on both set and reset means "hold" — the latch ignores everyone and keeps . This is the whole trick of the gate idea: use AND as a valve.
PICTURE. In the drawing, is the blue "eyes" wire. When it is dark () the two AND valves are shut and the outside inputs cannot get through — the loop is sealed. When is lit () the valves open and flow to the loop.
Each here means "the request only counts if permission is also 1."

We now control when. But and are still independent, so the forbidden can still happen. Step 3 kills it.
Step 3 — The one-wire trick: deleting the forbidden state
WHAT. We stop letting the user drive and separately. Instead we grow both of them from a single data wire :
WHY. Look at what (NOT-, from Step 0) guarantees. If then ; if then . They are always opposite. So and can never both be 1 — the forbidden combination is now physically unreachable. We did not "avoid" the bad state by being careful; we built it out of existence.
PICTURE. A single wire enters, splits, and one branch passes through a NOT box before becoming . The two resulting arrows always point opposite ways (one lit, one dark). Notice you cannot make them both lit — the NOT box forbids it.

Combine Step 2 and Step 3: our latch now receives and . One data pin, one enable pin, no villain. This is the D latch.
Step 4 — Case : the latch is transparent
WHAT. Set the enable high, , and read off what becomes for each value of .
WHY. With , the AND valves are fully open, so and (anything AND 1 is itself). We just apply the plain SR rules from Step 1:
- : then → set → .
- : then → reset → .
In both rows, ends up equal to . The output is a live copy of the input — we call this transparent, like looking through clear glass straight at .
PICTURE. Two side-by-side snapshots. Left: lamp lit → lamp lit. Right: lamp dark → lamp dark. mirrors exactly while the blue enable stays lit.

Step 5 — Case : the latch is opaque (it remembers)
WHAT. Now drop the enable, , and see what happens to regardless of .
WHY. With , both valves shut: and (anything AND 0 is 0). Set=0 and Reset=0 is exactly the hold command from Step 1. The feedback loop from Step 1 keeps re-lighting itself, so stays frozen at whatever it was:
Change all you like — it is walled off by the shut valves. This is the opaque state: the glass is now painted over; you see the last thing that was written, not the live .
PICTURE. The blue enable is dark. Both AND valves are shut (drawn as broken paths). The pink feedback loop is highlighted — it is the only thing now driving , holding it steady. Wiggling (shown greyed-out) has no effect.

Step 6 — Gluing both cases into one equation
WHAT. We have two separate facts:
We want a single boolean expression that produces in the first case and in the second, automatically.
WHY this tool — the "OR of two guarded terms". This is a standard trick: build one term that is "alive" only when , another that is "alive" only when , and OR them. Exactly one term is ever awake, so the OR just passes it through.
- Term for the enabled case: . When this equals ; when it collapses to 0 (asleep).
- Term for the hold case: . When , so this equals ; when , so it collapses to 0 (asleep).
Because and are opposites (Step 0), never both terms are awake at once — so the OR never has to decide between two competing 1's. It simply forwards whichever term is alive.
Reading each symbol where it sits: = "if enabled, take the data"; the = "or else"; = "keep the old output". That is the parent's boxed result, now derived, not asserted:
PICTURE. The two terms drawn as two lanes merging into an OR. A little switch labelled picks the live lane — literally the MUX view of the storage cell.

Step 7 — Sanity check: every case, no gaps
Let us make sure the one equation reproduces all four input rows. Plug into :
| old | meaning | |||||
|---|---|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 0 | 1 | transparent → copies |
| 1 | 0 | 1 | 0 | 0 | 0 | transparent → copies |
| 0 | 1 | 0 | 0 | 0 | 0 | hold old (ignores ) |
| 0 | 0 | 1 | 0 | 1 | 1 | hold old (ignores ) |
Every combination lands on the intended behaviour, and there is no forbidden row — Step 3 deleted it. Notice the degenerate check: when the value of never touches the answer (both and hold the same ), confirming the "opaque" claim from Step 5.
The one-picture summary
Below, the whole journey on one board: splits (Step 3) → AND valves gated by (Step 2) → cross-coupled memory loop (Step 1) → and the equivalent MUX-with-feedback view (Step 6), with the two behaviour lamps (Steps 4–5) shown as the outcome.

Recall Feynman retelling — the walkthrough in plain words
We started with a lamp that can keep itself lit — that is memory, the loop that sends yesterday's answer back into today (). Raw, it had two buttons, set and reset, and a nasty fault if you press both. First we put a valve (an AND gate) on each button controlled by a single eyes-open wire : eyes shut, no button reaches the lamp, so it just remembers. Then we did the clever bit: instead of two independent buttons we grew both from one data wire — one button gets , the other gets the opposite of — so they can never both be pressed, and the fault is gone forever. Now: eyes open () and the lamp becomes a live mirror of (transparent); eyes shut () and the lamp freezes on its last value (opaque). Finally we packed both stories into one sentence of algebra: is "when watching, show the data", is "otherwise keep the old picture", and the glues them — with and its opposite guaranteeing exactly one story is ever awake. That single line, , is the whole D latch.
Connections
- SR Latch — the memory loop we started from in Step 1.
- NOR and NAND Gates — the physical gates behind the loop and the valves.
- Multiplexers — the Step 6 select-and-forward view.
- D Flip-Flop — chain two of these to get an edge-triggered cell.
- Clocking and Timing — why "transparent while " (Step 4) causes glitch worries.
- Registers — many such cells side by side.