3.4.1 · D2Sequential Circuits

Visual walkthrough — SR latch operation

1,864 words8 min readBack to topic

We use the NOR version throughout (the NAND version is its mirror — see the end).


Step 1 — The one rule we need: what a NOR gate does

WHAT. A NOR gate takes two inputs (each a or a ) and produces one output. Its rule, stated in plain words:

Why phrase it that way? Because in a latch we constantly ask "is this gate being forced?" — and a single on either input is enough to force the output to . That "one dominates" behaviour is the lever the whole circuit pulls.

WHY this gate. We could use NAND instead (we will, at the end). NOR is chosen first because its active input is a — matching the everyday intuition "press to do something."

PICTURE. The four possible input pairs and the single output each produces. Notice the amber row — the only row that outputs .

Figure — SR latch operation

Symbol by symbol, the NOR expression reads:

  • — the two inputs (each or ).
  • — logical OR: this is if at least one input is .
  • the overbar NOT: it flips .
  • So = "flip the OR" = only when the OR was = only when both inputs are . ✓

Step 2 — A lone gate has no memory

WHAT. Take one NOR gate. Drive its inputs, then remove them (set them back to ). Watch the output.

WHY. We must first prove the problem exists — that a plain gate forgets — so the fix in Step 3 feels necessary, not arbitrary. A gate whose output depends only on the present inputs is called combinational.

PICTURE. Time flows left to right. When the input pulse ends, the output collapses back instantly. Nothing is remembered.

Figure — SR latch operation

The lesson: to remember, the output at "later" must somehow know what the output was "before." A lone gate has no wire carrying that history. We need to build one.


Step 3 — Cross-couple two gates: the feedback loop is born

WHAT. Take two NOR gates. Feed each gate's output into one input of the other gate. This is cross-coupling.

WHY. This closes a loop. Now a gate's output travels around and comes back as an input — so the circuit's future depends on its own present. That loop is the wire carrying history that Step 2 was missing.

PICTURE. Two NOR gates. The top gate produces ; the bottom produces . The blue feedback wires are the whole trick — trace them with your finger.

Figure — SR latch operation

Reading the wiring off the picture gives the two governing equations:

Term by term for the top equation :

  • — the Reset input feeding the top gate.
  • — the other gate's output, fed back in (the blue loop wire).
  • — the OR of those two; either being forces the gate.
  • overbar — NOT, giving the final .

The bottom equation is the exact mirror: it takes Set and the fed-back .


Step 4 — Hold (): the state that keeps itself

WHAT. Set both inputs to and check whether an assumed state survives.

WHY. This is the memory case. If, with no active input, the equations reproduce the current output, then the output "holds itself up" forever — exactly like the two kids leaning on a rope.

PICTURE. We test the guess . Follow the arrows: each output, sent around the loop, feeds back and regenerates itself.

Figure — SR latch operation
  • Top: and , so the OR is , so . The guessed came back out — consistent.
  • Bottom: and , so the OR is , so . The guessed came back out — consistent.

Both equations returned the values we fed in self-consistent stable. The identical check works for . So means hold the previous bit.


Step 5 — Set (): forcing to 1

WHAT. Raise to , keep , and follow the forcing.

WHY. This shows how a single dominates a NOR gate (Step 1's lever) and how that force propagates around the loop to a new stable state.

PICTURE. The amber slams the bottom gate's output to ; that then releases the top gate to rise to . Two dominoes, in order.

Figure — SR latch operation
  • The makes the OR regardless of — that's why we wrote "anything." So is forced to first.
  • Now the top gate sees and the freshly-made : OR , so .

Result: ==== (Set). Note the outcome does not depend on what was before — Set overwrites.


Step 6 — Reset (): the mirror image

WHAT. Raise to , keep .

WHY. By the symmetry of the cross-coupling, Reset is Set with the roles of the two gates swapped. Seeing the mirror confirms we truly understand the mechanism, not just one case.

PICTURE. Now the amber forces the top gate's to first; that releases the bottom gate so .

Figure — SR latch operation
  • forces the top OR to , so whatever it was.
  • Then the bottom gate sees and : OR , so .

Result: ==== (Reset).


Step 7 — The degenerate case: Forbidden ()

WHAT. Drive both inputs to at once, then examine what happens when they later drop.

WHY. This is the case the parent warned about. It is not a "hold" or a normal state — it breaks the very promise the outputs make (that they are opposites), and its exit is a coin-flip. Every complete truth table must cover it.

PICTURE (part A). Both s dominate both gates simultaneously, so both outputs go to and are now equal, contradicting their names.

Figure — SR latch operation

PICTURE (part B). Now release both inputs to at the same instant. Both gates were outputting , so both now try to rise to together. Whichever gate is a hair faster (gate delay) wins and pulls the loop to its side. The logic cannot predict the winner — this is metastability.

Figure — SR latch operation
  • The symbol on the figure marks the tiny delay difference between the two gates.
  • The two amber "?" arrows show both possible landing states — the circuit picks one at random.

Hence is forbidden. The practical cure is to build a circuit where and can never both be — that is exactly what a Gated SR latch and then a D latch do (they generate ).


Step 8 — Bundling the four cases into one equation

WHAT. Collapse the three legal rows (Set, Reset, Hold) into a single formula for the next value .

WHY. A formula is a compressed picture of the truth table — it lets a JK flip-flop or D latch designer reason algebraically instead of drawing gates.

The three legal rows say:

Read as English: "be if Set; otherwise keep the old value, as long as you're not being Reset." That is:

Term by term:

  • — if Set is , the whole OR is , so . Set wins outright.
  • — "not being Reset." It is when .
  • — keep the old bit only if we are not Reset; if this term is , clearing the memory.
  • — the promise never to press both buttons (excludes the forbidden row).

The one-picture summary

This single diagram compresses all seven cases: the loop structure (Step 3), and a mini state-map showing how Set / Reset / Hold move the latch between its two stable states, with the forbidden input pointing into the metastable "no-man's-land."

Figure — SR latch operation
Recall Feynman: the whole walkthrough in plain words

One gate is a goldfish — it forgets the instant you stop poking it (Steps 1–2). So we wire two gates mouth-to-tail in a little ring, each one holding the other up (Step 3). Now the ring can lean two ways and stays leaning by itself — that's a remembered bit (Step 4, Hold). Push the S button and a single "" bulldozes one gate down, which lets the other pop up — the ring leans to "" (Step 5, Set). Push R and the exact mirror happens — the ring leans the other way to "" (Step 6, Reset). Push both buttons and both gates get flattened to ; when you let go they both scramble up at once and whoever's faster wins — a coin-flip you're forbidden to gamble on (Step 7). Finally we write the ring's behaviour as one tidy sentence, : be if Set, else keep what you had unless Reset (Step 8).

See also: Flip-flop vs latch · Cross-coupled gates · Gated SR latch · Metastability