3.4.1 · D3Sequential Circuits

Worked examples — SR latch operation

2,276 words10 min readBack to topic

This page is a drill. The parent note built the theory; here we run the latch through every kind of situation it can meet — every input combination, every startup condition, both the NOR and NAND versions, a real-world word problem, and an exam-style trap.

Before we start, one reminder of the two gate rules we lean on the whole way (nothing new — just so you never have to scroll):

Recall The only two rules you need

NOR output is only if BOTH inputs are . Any on a NOR input forces its output to . NAND output is only if BOTH inputs are . Any on a NAND input forces its output to .

And the two wiring equations for the NOR latch, copied from the parent so we can plug into them:

Here is the stored bit, is its complement (the "other" output), is the Set input, is the Reset input. The bar means "flip " (NOT). The inside a bar means OR-then-invert = NOR.


The scenario matrix

Every question this topic can ask falls into one of these cells. The worked examples below are each tagged with the cell they cover, and together they hit all of them.

Cell What it tests Covered by
A — Hold from memory keeps a stored 1 Ex 1
B — Hold from memory keeps a stored 0 Ex 1
C — Set action Ex 2
D — Reset action Ex 2
E — Forbidden + release then both drop Ex 3
F — Full timing trace many steps, watch memory stick Ex 4
G — Unknown power-up state degenerate: no defined start Ex 5
H — NAND (active-LOW) version dual logic, roles of 0/1 swapped Ex 6
I — Real-world word problem button/alarm latch Ex 7
J — Exam twist / characteristic eq. plug into Ex 8

Example 1 — Hold from both starting values (Cells A & B)

Part (a): start at .

  1. Compute . Why this step? A NOR is forced to by any input. Here is that , so stays .
  2. Compute . Why this step? Now both of this gate's inputs are , and NOR outputs only when both inputs are — so stays .

The state we assumed came right back out → it is self-consistent (stable). stays .

Part (b): start at .

  1. . (the from forces it)
  2. . (both inputs → output )

Again the state re-asserts itself. stays .

Verify: In both parts the inputs to each gate reproduced the very outputs we started with. That is the definition of Hold — the same input can hold either bit, which is exactly why is memory, not "clear to 0."


Example 2 — Set then Reset (Cells C & D)

Step 1 — Set ():

  1. . Why this step? We attack the gate that has on it. A input forces its NOR output to , regardless of the current . So immediately.
  2. . Why this step? With now and , the other gate sees both inputs → outputs . So . Set done.

Step 2 — Reset () from :

  1. . Why this step? Symmetric: the gate now has a input, forcing .
  2. . Reset done, .

Verify: Set drove from ; Reset drove it . Complementarity held throughout: then . Both are legal, complementary states. ✓


Example 3 — Forbidden state and the race on release (Cell E)

Figure — SR latch operation
  1. While : and . Why this step? Each gate has a forcing , so both outputs are . Now and are equal, not complementary — the names lie. (This alone breaks any circuit reading .)
  2. Drop both inputs to simultaneously. Each gate now sees inputs from outside, so each wants to output . Why this step? But they read each other's output too. If both went to , each would then see a from the other and be forced back to — a contradiction. The loop cannot rest with both high.
  3. Whichever gate's output rises a fraction of a nanosecond earlier feeds a into the other, pinning the slower one at . The faster gate wins. Why this step? "Faster" depends on manufacturing/temperature noise, not on logic — see the red timing arrows in the figure. So the outcome is unpredictable, and briefly metastable (hovering between).

Verify: There is no logically determined answer — that is the whole point. The lesson: never issue . In practice a Gated SR latch or D latch enforces so this can't happen.


Example 4 — Full timing trace (Cell F)

Apply the truth table row by row (Set→1, Reset→0, Hold→keep):

step rule
start power-up 1
1 0 0 Hold 1
2 0 1 Reset 0
3 0 0 Hold 0
4 1 0 Set 1
5 0 0 Hold 1
6 0 0 Hold 1
7 0 1 Reset 0

Why each Hold matters: Steps 1, 3, 5, 6 have no active input, yet never drifts — it just repeats the last commanded value. Step 5 and step 6 both hold 1 across two idle cycles: the latch is genuinely storing the Set from step 4.

Verify: Final (last action was Reset). The sequence of outputs is . Every Hold copied its predecessor — memory confirmed. ✓ See figure for the waveform.

Figure — SR latch operation

Example 5 — Unknown power-up state (degenerate Cell G)

  1. is the Hold command: "keep the previous value." Why this step? But at power-up there is no previous value — both and are self-consistent (Example 1 proved both are stable under ).
  2. So which one wins? Whichever gate's output rises first as power ramps — again a tiny-difference race. Why this step? Same mechanism as the forbidden release: two stable states, no logical tiebreaker, so noise decides.

Verify: is indeterminate at power-up. This is why real systems always issue an explicit Set or Reset (a "power-on-reset" pulse) before trusting the stored bit. There is no numeric answer — the honest answer is "unknown until you command it." ✓


Example 6 — The NAND (active-LOW) version (Cell H)

Recall NAND wiring: and , and the rule "any input forces output to ."

Part (a): — this is Set.

  1. . Why this step? A NAND with a input is forced to . The active-LOW forces . So the "active" value is , not .
  2. . Consistent: . Set done.

Part (b): — this is Hold, NOT forbidden.

  1. Both inputs are the inactive . Neither gate is forced by an external ; each just reads the other. Why this step? Beginners expect " = forbidden" (copied from NOR). But for NAND the forbidden case is (both outputs forced to ). Here leaves the loop alone.
  2. So keeps its value from part (a): .

Verify: Set gave ; the following held it at . The NAND latch is the logical dual of the NOR latch — same behaviour, 01 swapped on the inputs. See Flip-flop vs latch and Cross-coupled gates. ✓


Example 7 — Real-world word problem (Cell I)

  1. At : Set (alarm ON). Why this step? The momentary door pulse Sets the latch.
  2. Between and : (door closed, no clear) Hold stays . Why this step? This is the purpose of the latch: a one-instant trigger produces a persistent alarm. Closing the door does not un-trigger it — memory holds the 1.
  3. At : guard presses clear, Reset (alarm OFF).

Verify: Sequence of : . The alarm stays on from to despite no continuous input — exactly what a latch is for. ✓


Example 8 — Exam twist: use the characteristic equation (Cell J)

The equation reads: " is if we Set, OR if we're not Resetting and the old value was ." Here = NOT , and juxtaposition = AND.

Part (a): .

  1. . Why this step? means we ARE resetting, so the "keep old value" term must be killed — and zeroes it.
  2. . Why this step? Both terms are . Matches Reset. ✓

Part (b): .

  1. . Why this step? Not resetting → the memory term is allowed to pass the old value through.
  2. . Why this step? The memory term carries straight to the output. Matches Hold. ✓

Verify: Both answers agree with the truth table (Reset→0, Hold→keep 1). Note the constraint held in both cases (, ), so the equation is valid. ✓ Related: JK flip-flop removes the restriction entirely.


Active recall