Exercises — SR latch operation
Notation you must have before the exercises
This whole page is written in Boolean algebra: a tiny language for wires that carry only two values, (LOW, "off", no voltage) and (HIGH, "on", voltage present). Three operations combine those wires. Read them off the picture below.

How to read this figure: each little block is a truth table. The left block (green, NOT) has one input column and one output column: flip and . The middle block (AND) lists all four rows and shades the output orange only in the bottom row — the sole case where AND is . The right block (OR) shades the output orange in every row except the top — OR is whenever at least one input is on. The bottom caption reminds you that in OR, not .
Now the two gate rules, which are just NOR and NAND read out loud:
Finally, the actual circuit these exercises test. It is two gates whose outputs loop back into each other — that loop is the whole trick.

How to read this figure: the two blue boxes are the NOR gates, G1 (top, output in blue) and G2 (bottom, output in orange). The external input (red) enters G1; the external input (green) enters G2. The two dashed lines are the feedback: the blue dashed line carries back down into G2's second input, and the orange dashed line carries back up into G1's second input. That criss-cross is why the circuit is called cross-coupled and why it can hold a value.
Deriving the characteristic equation (the "why", not just the formula)
We want a single formula for from , , and , covering only the three legal rows. Build it from what each legal row demands, and watch the waveform picture as we go:

How to read this figure: time runs left to right, split into five labelled segments (Set, Hold, Reset, Hold, Set). Three stacked traces show, from top to bottom, (green), (red), and (blue); a trace sitting high means , low means . Watch the blue trace: it rises to during Set and — crucially — stays at through the following Hold segment even though both and are there (the blue arrow marks this "held with no input"). It only falls at Reset, then again stays low through the next Hold. That flatness during Hold is the stored bit.
- Set row () needs . The cheapest way to force a into an OR-expression is to add the term : whenever , . So the formula begins with
- Hold row () needs — keep the old value. So the "" must reproduce when we are not resetting.
- Reset row () needs — the old value must be erased exactly when . The switch "let through, but kill it when " is precisely : it equals when (since ), and equals when (since ).
Gluing the pieces: The side-condition is the promise never to press Set and Reset together — outside it the single-wire model breaks (you will prove this in Problem 5.2).
Level 1 — Recognition
Problem 1.1
For a NOR-based SR latch (active-HIGH), state for all four input combinations .
Recall Solution 1.1
Apply the NOR rule directly.
- → Hold: (both gates reproduce the old state).
- → Reset: ( forces ).
- → Set: ( forces , releasing ).
- → Forbidden: , not complementary.
Problem 1.2
For a NAND-based SR latch (active-LOW inputs ), which single input combination is the Hold state, and which is forbidden?
Recall Solution 1.2
Reason from the NAND rule (a is the active value):
- Hold is (no input active → do nothing).
- Forbidden is (both active → both outputs forced to , so , not complementary).
This is the logical dual of NOR: swap the role of and on the inputs. See NAND gate.
Level 2 — Application
Problem 2.1
A NOR latch starts at . Apply this input sequence (each step: then ). Fill in after every step.
| step | S | R |
|---|---|---|
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 2 | 0 | 1 |
| 3 | 0 | 0 |
| 4 | 1 | 0 |
Recall Solution 2.1
Track the state; Hold keeps whatever was last.
- Step 0: Set → .
- Step 1: Hold → (stays 1 — the memory).
- Step 2: Reset → .
- Step 3: Hold → .
- Step 4: Set → .
Answer sequence: . Notice steps 1 and 3: no input active, yet is definite. That "sticking" is the stored bit.
Problem 2.2
Using the characteristic equation , compute for , and separately for .
Recall Solution 2.2
Plug in ( means "NOT ").
- : . (Hold ✓)
- : . (Reset ✓)
The equation matches the truth table — as it must, since we built it from those rows.
Level 3 — Analysis
Problem 3.1
A NOR latch receives , then both inputs drop to at the same instant. Gate G1 (producing ) has a propagation delay of ; gate G2 (producing ) has . Which output goes HIGH first, and what final stable state results?
Recall Solution 3.1
Under both outputs are . When both inputs fall to , each gate now sees both its inputs at and wants to output . The waveform below traces the race:

How to read the figure: time in nanoseconds runs left to right; the dashed vertical line at marks both inputs dropping to . The blue trace is (gate G1): because G1 is faster (), rises to at (blue arrow, " reaches 1 first"). The orange trace is (gate G2, ): its dotted portion is the rise it attempted, but the red arrow marks the instant feeds back into G2 and pins to before it ever finishes rising.
Result: the faster gate wins → (the Set state).
Key insight: the logic table gave no answer here — only the physical delays decided. In a real chip the delays are not cleanly vs ; they can be nearly equal, and then the loop can hover between states → Metastability (Problem 5.3). That unpredictability is why is forbidden.
Problem 3.2
Show why during cannot be a "stable stored value" the way Hold is.
Recall Solution 3.2
A stable state must re-assert itself with the current inputs. Check self-consistency while :
- ✓
- ✓
So is self-consistent as long as the inputs stay . The problem is it is not a storable state: the moment you release to Hold () both gates simultaneously try to rise and the outcome depends on delays (Problem 3.1). A genuine memory state ( or ) survives the release deterministically; does not.
Problem 3.3
Now the inputs do not drop simultaneously: from , suppose falls to first, and stays at a little longer before also falling. What state does the latch land in, and is it predictable this time?
Recall Solution 3.3
While has already fallen to but is still , the inputs are momentarily — that is the ordinary Set command. So the latch is deterministically driven to before falls. When then drops to , the inputs become = Hold, which simply keeps .
Answer: (Set), and it is predictable — because the inputs passed through a legal command on the way down.
General rule: the danger is only the perfectly simultaneous release. Whichever input lingers HIGH last acts as the deciding command: last → Reset (); last → Set (). Metastability is the knife-edge case where neither lingers measurably longer.
Level 4 — Synthesis
Problem 4.1
Design a small circuit that makes the forbidden state impossible by guaranteeing . First prove that a NOR gate with both inputs tied together acts as an inverter; then give the resulting truth table in terms of the single input , and name the well-known latch you have built. Also state what happens to the Hold and forbidden rows.
Recall Solution 4.1
Step A — NOR as an inverter. Tie both inputs of a NOR gate to the same wire . The NOR output is . But (OR-ing a value with itself changes nothing — "at least one is on" is the same as " is on"). So the output is . A NOR with tied inputs computes NOT. (Check: ; — genuine inversion.)
Step B — use it. Feed the latch through that inverter. Now and can never both be : if then ; if then .
| action | |||
|---|---|---|---|
| 0 | 1 | Reset | 0 |
| 1 | 0 | Set | 1 |
So directly — the output simply follows the data input. This is the D latch (with the enable held active). The forbidden and Hold rows have both been eliminated by construction.
What happened to the missing rows — the important design consequence. The full SR latch has four input rows; wiring makes only two of them reachable ( and ). The two that vanish are:
- Forbidden () — deliberately removed. This is the whole point of the design: the dangerous state is now physically impossible, so no metastability from that source. Pure win.
- Hold () — removed as a side-effect, and this is a trade-off, not a free lunch: with the raw inverter you have lost the ability to store. The output slavishly copies at every instant, so if glitches, glitches. To get memory back you must add an enable line (Problem 4.2): when the circuit ignores and holds. The full D latch is exactly "inverter-fed SR plus an enable" — the enable restores the Hold row that this bare version threw away.
Problem 4.2
Add an enable line to a NOR SR latch so that only affect the latch when , and the latch holds when . Give the gated input equations.
Recall Solution 4.2
Put an AND gate on each control input, gated by : feed into the SR latch.
- When : → the latch sees Hold → stores its bit.
- When : → normal SR behavior.
This is the Gated SR latch. It is the standard first step toward clocked storage and the JK flip-flop.
Level 5 — Mastery
Problem 5.1
A NAND latch has active-LOW inputs . Both are driven to (the forbidden state), then released to (Hold). Explain, using the NAND rule, why the outcome is unpredictable, and relate it to the difference between a latch and a flip-flop.
Recall Solution 5.1
Forbidden state (). Each NAND has a input, so by the NAND rule (any input forces output ) both outputs are forced to → . They are no longer complementary — this is the exact dual of the NOR forbidden state where both were .
The release to (Hold). Now each NAND sees inputs . Since the other output is currently , each gate sees → both inputs → each wants to fall to . Both gates race downward. By the first-mover rule (Problem 3.1), whichever gate is physically faster falls to first, feeds that back into the other gate, and pins the other output at . The result is a valid complementary state ( or ) — but which one depends entirely on the gate delays, not on the logic. With near-equal delays it can even hover halfway → Metastability. That is the unpredictability.
Relation to flip-flop vs latch. A plain latch is level-sensitive: it reacts to its inputs (and enable) at every instant they are active, so a stray forbidden pulse can corrupt it at any moment, and its release can trigger the race above. A flip-flop is edge-triggered: it samples inputs only at a clock edge, shrinking the vulnerable window to that edge. Better still, the JK flip-flop redefines the troublesome "both active" combination as a deterministic toggle () instead of leaving it forbidden — so the metastable-on-release hazard is designed out entirely rather than merely avoided by promise.
Problem 5.2
Prove that the NOR characteristic equation is only valid under , by showing what it predicts for and why that prediction is a lie.
Recall Solution 5.2
Substitute into the equation: , so The algebra cleanly claims . But the real circuit gives during (verify with the gate equations: and ), and an indeterminate state upon release.
So the single-variable formula succeeds numerically while the hardware does something completely different — the model has no way to represent a state where and are both , because it only tracks one variable . That mismatch is precisely why we bolt on the side-condition : it fences off exactly the region where the equation stops describing reality. An equation is only trustworthy inside its stated domain.
Problem 5.3
Sketch what "metastability" actually looks like on the wire when the release is on the knife-edge, and explain why is neither a clean nor a clean for a while.
Recall Solution 5.3
When both gates start rising (or falling) at almost exactly the same time, neither can immediately pin the other. The loop balances near a halfway analog voltage — not a valid , not a valid — and lingers there until random circuit noise finally tips it. The figure shows this:

How to read the figure: time runs left to right; the dashed line marks the knife-edge release. The shaded gray band in the middle is the forbidden voltage region — voltages that are neither a logic nor a logic . The orange trace shows entering that band and hovering there (the flat middle portion) before finally resolving upward to a clean much later than a normal gate delay.
Why it happens: the two feedback pushes momentarily cancel, exactly like a pencil balanced on its tip — perfectly balanced in theory, but any infinitesimal imbalance eventually wins. Which way and how long it takes are set by microscopic noise, not by the logic, so the settling time is unbounded in the worst case. This is why real designs wait a guaranteed settling time before sampling the output — see Metastability.