PHY 452 · Electronics
Our notes
2 min readMemory in logic
A bistable circuit has two stable states and stays in one until told to change: it stores one bit.
SR latch
Two cross-coupled NOR gates (or NAND gates).
| S | R | Q (NOR latch) |
|---|---|---|
| 0 | 0 | no change |
| 1 | 0 | set: Q = 1 |
| 0 | 1 | reset: Q = 0 |
| 1 | 1 | forbidden (both outputs 0) |
The NAND version has active-low inputs. A latch removes switch bounce from mechanical switches.
Gated (clocked) latches
An enable (clock) input lets the latch respond only when it is HIGH. The D latch (data latch) has one input: Q follows D while enabled and holds when disabled; it avoids the forbidden state. Latches are level-triggered.
Flip-flops
Flip-flops change only at a clock edge (rising or falling), which keeps a whole system in step.
- D flip-flop: Q takes the value of D at the clock edge: Q(next) = D. Used in registers.
- JK flip-flop: like SR but J = K = 1 makes it toggle.
| J | K | Q(next) |
|---|---|---|
| 0 | 0 | Q (hold) |
| 0 | 1 | 0 |
| 1 | 0 | 1 |
| 1 | 1 | Q' (toggle) |
- T flip-flop: T = 1 toggles at each clock edge; T = 0 holds. A JK with J = K = 1 is a T flip-flop. Toggling divides the clock frequency by 2.
- Master-slave flip-flops (two latches) were used to avoid the "race-around" problem of early JK designs.
Asynchronous inputs
Preset and clear set or reset the flip-flop at once, regardless of the clock; used to start counters at a known state.
Timing
- Setup time: data must be stable before the clock edge.
- Hold time: data must stay stable after the edge.
- Propagation delay: clock edge to output change.
Violating these can cause metastability (an unclear output for a while).
Characteristic and excitation tables
- Characteristic equations: D: Q+ = D; JK: Q+ = JQ' + K'Q; T: Q+ = T ⊕ Q.
- Excitation tables give the inputs needed for each change (used in counter design).
ICs
7474 dual D, 7476 and 74107 dual JK flip-flops, 74LS279 SR latches.
Exams usually ask
- Draw an SR latch with NOR gates and explain its truth table.
- Compare the D, JK and T flip-flops.
Common mistake
Confusing latches and flip-flops. Latches respond to the level of the enable; flip-flops respond only at the clock edge.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
No reading links here yet
Our team adds free books, videos and practice for each topic, and opens every link before it goes up.