Flip-flops are the fundamental building blocks of sequential logic circuits. Unlike combinational logic (e.g., gates), flip-flops have memory—they can store a single bit of data (0 or 1) and maintain that state until changed by an input signal. They form the basis for registers, counters, memory elements, and state machines in digital systems.
The simplest flip-flop. It has two inputs: S (Set) and R (Reset).
| S | R | Q(next) | Comment |
|---|---|---|---|
| 0 | 0 | Q(previous) | Hold |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | ? | Forbidden |
The most common flip-flop. It has one data input D and captures the value of D on the clock edge.
| Clock | D | Q(next) |
|---|---|---|
| ? (rising edge) | 0 | 0 |
| ? (rising edge) | 1 | 1 |
| No edge | X | Q(previous) |
D flip-flops eliminate the forbidden state of the SR type and are widely used for storage registers.
An enhanced SR flip-flop that resolves the forbidden state. When J = K = 1, it toggles the output.
| J | K | Q(next) | Comment |
|---|---|---|---|
| 0 | 0 | Q(previous) | Hold |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | NOT Q(previous) | Toggle |
A simplified JK flip-flop with J and K tied together as a single T input.
| T | Q(next) |
|---|---|
| 0 | Q(previous) |
| 1 | NOT Q(previous) |
Ideal for building binary counters and frequency dividers.
Most practical flip-flops are clocked—changes occur only on a rising (?) or falling (?) edge of a clock signal. This synchronizes operations across large digital systems and prevents race conditions.
Flip-flops are combined to create:
Every CPU register, program counter, and memory bit relies on flip-flops at the hardware level.