digiwleeaLearn
Open the lab →

The transparency problem

Why a latch is not enough

4 min read

The transparency problem is that a level-enabled latch follows its input for the entire time it is open, so capturing a value at one precise instant requires chaining two latches into an edge-triggered flip-flop.

Builds onGated D latch
You built the D latch: when its enable is high it stores the value on D. That sounds like exactly what memory should do, so why does the very next lesson introduce a more elaborate device, the flip-flop? This bridge names the single flaw in the latch, transparency, that makes the flip-flop necessary. Understand the flaw and the flip-flop's two-latch design stops looking arbitrary.
Recall how a D latch behaves. While its enable is 1 the latch is transparent: whatever D does, the output copies it, live, the entire time. Only when enable falls to 0 does the latch freeze and hold the last value. So the latch does not capture a value at an *instant*, it tracks its input for as long as it is open, then holds whatever happened to be there at the moment it closed.
Why is that a problem? In a real system the enable is a clock that is high for a whole half-cycle. During that window D may change several times, and every change flows straight through a transparent latch to its output, and onward into whatever the output feeds. Worse, if that downstream logic loops back, the latch can see its own effect and race around during the open window. You wanted "remember the value at the tick"; you got "remember whatever was last seen during a long open window".
A concrete analogy: a door held open all afternoon versus a camera shutter. A latch is the open door, anything can walk through while it is open, and you only find out who is inside when it finally shuts. A flip-flop is the shutter: it grabs one snapshot at a single instant. For predictable timing you want the snapshot, not the open door.

The fix: two latches back to back

The insight that turns a transparent latch into an instant-capturing flip-flop is simple: chain two latches with opposite enables (a primary and a secondary, often called master and slave). The first is open while the clock is low and closed while it is high; the second is the reverse. At no moment are both open, so there is never a straight transparent path from input to output. The value can only advance on the clock edge, the instant the first latch closes and hands its captured value to the second. Two transparent stages, arranged so their open windows never overlap, produce one edge-triggered capture.
"Level-triggered" (a latch, active the whole time enable is high) and "edge-triggered" (a flip-flop, active only at the clock transition) are not interchangeable. Using a transparent latch where a design assumes edge capture causes values to slip through mid-cycle and race, one of the hardest timing bugs to spot. When a lesson or datasheet says "on the rising edge", it means a flip-flop, not a latch.
Check yourself
During the time a D latch's enable is held high, D changes from 0 to 1 and back to 0. What does the latch output do, and how would an edge-triggered flip-flop behave differently?

Frequently asked

What is the difference between a latch and a flip-flop?

A latch is level-triggered: it is transparent (its output follows its input) the entire time its enable is active. A flip-flop is edge-triggered: it captures its input at a single clock transition and holds it for the rest of the cycle. Flip-flops give predictable, instant capture; latches do not.

What is the transparency problem?

It is the fact that a level-enabled latch passes input changes straight to its output the whole time it is open, so it captures whatever was present when it closed rather than a value at one precise instant. Chaining two latches into a flip-flop fixes it.

Why does a flip-flop use two latches?

So that at no moment is there a transparent path from input to output. The two latches have opposite enables, so a value can only move through on the clock edge, when the first closes and the second opens. That is what makes the capture edge-triggered.
Now the D flip-flop design will read naturally: it is exactly the two-latch, edge-triggered cell this problem forces. From there, eight of them side by side make a register.

Every lesson here builds toward one thing: a working CPU, from the transistor up.

Open the free lab →
Found this useful? Share itShare on X