Page 4
D-type Flip-Flop
A flip-flop is a sequential circuit: unlike a gate or an adder, its output depends on past inputs, so it can store data. The D-type flip-flop holds a single bit and is the basic building block of registers and memory.
Symbol
- D — the data input (the bit to be stored).
- CLK — the clock. The small triangle (›) marks it as edge-triggered.
- Q — the stored output bit.
- Q — the complement of Q (always the opposite of Q).
"D-type" because the output simply follows the Data input — but only at the moment the clock ticks.
Behaviour
On each rising edge of the clock, Q takes whatever value D currently has. Between clock edges the input D is ignored and Q holds its last value — that is what makes it a memory.
| Clock | D | Q after the edge |
|---|---|---|
| ↑ rising edge | 0 | 0 |
| ↑ rising edge | 1 | 1 |
| no edge (steady) | X | Q (unchanged) |
X means "don't care" — D has no effect unless the clock is changing. Q is simply the inverse of Q in every row.
Why edge-triggering matters
- It makes the exact moment of capture predictable, so a whole system can update in step with one shared clock — this is synchronous operation.
- It prevents the output from "chasing" a changing input; the value is sampled once per tick.
Use in registers
Place n D-type flip-flops side by side, sharing one clock line, and you can store an n-bit value in a single tick — this is a register. CPU registers, buffers and static RAM cells are all built this way, so the D-type flip-flop is the link between simple logic gates and the storage that makes a computer work.