Visual walkthrough — Edge-triggered D flip-flop
Before we begin, two words we will lean on constantly:

Look at the figure: the orange line is a clock. The flat magenta stretches are levels; the two violet arrows mark the rising edges — the only moments we want our device to "listen".
Step 1 — A wire that remembers: the feedback loop
WHAT we do: take two NOR gates and feed each one's output back into the other's input. This is called cross-coupling.
WHY: a single gate has no memory — its output is a fresh function of its inputs. But if the output loops back to become an input, the circuit can settle into a state and stay there with no outside push. That self-sustaining loop is memory.
PICTURE: In the figure, follow the red wire from the top gate's output down into the bottom gate's input, and the blue wire back up. The loop is the whole point.

Step 2 — Giving the loop controls: the SR latch
WHAT we do: add two external inputs, (Set) and (Reset), one into each NOR gate. Now we can push the loop into a chosen state.
Term by term for the first equation:
- is the other output feeding back in.
- asks "is Reset high OR is the fed-back line high?"
- the outer bar flips it, producing .
WHY: we need a way to write the memory, not just watch it hold. forces a , forces a .
PICTURE: the figure lists all four input combinations with the resulting drawn beside each.

| meaning | |||
|---|---|---|---|
| Set | |||
| Reset | |||
| Hold | stays put | ||
| forbidden | both outputs — breaks the " opposite" promise |
See SR latch for the full case-by-case treatment.
Step 3 — Killing the forbidden state: the gated D latch
WHAT we do: stop letting and be set independently. Instead, derive both from a single data input and an enable :
Term by term:
- is our one data bit.
- is its opposite — so and can never both be (a bit and its complement can't both be true). The forbidden corner is now unreachable.
- (enable) gates them: when , both → hold.
WHY: one input () instead of two removes the illegal state entirely, and gives us an on/off switch for writing.
PICTURE: the figure shows splitting — straight into the -branch, inverted into the -branch — both throttled by .

Step 4 — The transparency problem, drawn
WHAT we do: pause and see why "transparent while high" is a problem, so the next step feels necessary.
WHY: if we don't feel the pain, the master–slave trick looks arbitrary. Picture two latches in a row (a baby shift register), both enabled by the same high clock.
PICTURE: while the clock is high, a new value on the first latch's input flows through latch 1 → through latch 2 in the same clock phase. It "runs away" through every stage at once, instead of moving one stage per tick.

Step 5 — Master–slave: manufacturing the edge
WHAT we do: chain two gated D latches and drive their enables with opposite clock phases:
- Master latch enabled by (open when clock is low)
- Slave latch enabled by (open when clock is high)
WHY opposite enables: they can never be transparent together. When one door is open, the other is shut. Data can only move across the boundary at the moment the two swap — and that moment is the clock edge.
PICTURE: the figure freezes three phases; trace the shaded ("open") latch in each.

Term by term through a rising edge :
- — master open (tracks ), slave shut (holds old ). The master's internal value follows .
- the edge — master slams shut, freezing whatever was just before the edge; slave opens and copies that frozen to the output .
- — master shut (ignores any new ), slave open but fed by the frozen → output sits perfectly still.
Here is the output after this edge; is the value present at the edge. Notice (the old output) does not appear on the right — a D flip-flop simply loads . That single instant of transfer is edge-triggering. See Master-slave configuration.
Step 6 — Reading it on a waveform (the whole point, verified visually)
WHAT we do: apply a wiggling and a clock, and mark exactly where changes.
WHY: to prove the device ignores everything except the edge — including changes during the high level (the classic misconception from the parent note).
PICTURE: edges at . Sampled values . Between edges wiggles — and does not care.

- ↑: sample .
- : wiggles, frozen at .
- ↑: sample .
- ↑: sample .
trace across the tick points: .
Step 7 — The degenerate & edge cases (so nothing surprises you)
WHAT we do: walk the corners the happy path skipped.
PICTURE: four mini-panels — no-edge, wrong-edge, toggle feedback, and a setup violation.

- No edge at all (clock stuck high or low). No transfer moment exists → holds forever. Memory with the clock parked.
- Falling edge on a positive-edge device. The master–slave swap runs the wrong direction (slave shuts, master opens) → no update to . Only the rising edge is "active".
- Toggle case (). Since is sampled each edge, : the output flips every rising edge. From : edge → → edge → … Output frequency is half the clock. This is the ÷2 cell of Synchronous counters and T flip-flop.
- Setup violation. If changes inside the tiny keep-out window around the edge, the master latches a half-formed value and can hover between and — metastability (see Metastability). This is why the timing rules in the parent note exist.
Recall Check yourself
On a positive-edge FF, does a falling clock edge ever change ? ::: No — only the rising () edge is active; the master–slave swap runs the wrong way on a falling edge. In the toggle wiring, what is in terms of ? ::: — it flips every rising edge, giving output frequency = clock/2. What happens if changes during the setup window? ::: The device may go metastable — hovers between 0 and 1 for an unpredictable time.
The one-picture summary
Everything above compressed into a single flow: loop → controls → single input → double latch → edge → held output.

Recall Feynman retelling of the whole walkthrough
We started with a single wire looped back on itself — like an echo that never fades, that echo is one bit of memory (Step 1–2). But our first memory had a broken button combination (), so we rewired the buttons to come from one switch and its opposite, making the bad combo impossible (Step 3). That gadget worked but was a wide-open window: while the enable was high, data poured straight through — and in a chain it stampeded through every stage at once (Step 4). So we put two windows back-to-back with a rule: they're never open together. Now data can only sneak across the gap at the exact moment they swap — and that moment is the clock's jump, the edge (Step 5). We watched a waveform to confirm the output ignores everything except that jump (Step 6), then toured the weird corners — clock parked, wrong-direction edge, self-flipping toggle wiring, and the danger zone where changing too close to the edge makes the output dither (Step 7). The finished machine says one calm sentence: "at the edge, become ; then hold."
Connections
- SR latch — the bistable loop of Steps 1–2
- Gated D latch — Step 3's single-input fix
- Master-slave configuration — Step 5, where the edge is born
- Setup and hold time & Metastability — Step 7's danger zone
- T flip-flop / JK flip-flop — richer next-state equations
- Registers and shift registers — the chained latches of Step 4, done right
- Synchronous counters — built from the toggle case
- Clock distribution and skew — how every edge arrives together
- Yeh note Hinglish mein padho →