CHAPTER 056 SECTIONS · 4 CHECKS

Latches, flip-flops, and FSMs

Bit storage, SR/D latches, master–slave flip-flops, timing, and finite-state machines.

Contents
  1. 1. S/R latch
  2. 2. D latch
  3. 3. Flip-flop
  4. 4. Edge and level triggering
  5. 5. Setup, hold, metastability
  6. 6. Finite-state machine

01

S/R latch

For an active-high NOR latch: 00 hold, 01 reset, 10 set, 11 invalid. Feedback creates two stable states and stores one bit.

RSQQ̅SRQ00hold01010111invalid
The NOR S/R latch and its table.

02

D latch

A D latch removes the forbidden S/R combination: while enabled it is transparent and Q follows D; otherwise it holds state.

DEQQ̅RS
A gated D latch (the Lab 7 enable latch).

03

Flip-flop

A flip-flop updates on a clock edge. A master–slave design uses two latches on opposite phases so the input cannot flow directly to the output.

Master latchSlave latchDEDEQQDQmQCLKNOT before the master: Q updates on the rising edge
Rising edge: the NOT feeds the master.
Master latchSlave latchDEDEQQDQmQCLKNOT before the slave: Q updates on the falling edge
Falling edge: the NOT moves to the slave.

04

Edge and level triggering

A level-sensitive latch is active throughout an enable level. An edge-triggered flip-flop captures only at a rising or falling transition.

level-triggerededge-triggereda latch is transparent while the level is active;a flip-flop captures D only at the edge
A latch is level-triggered, a flip-flop edge-triggered.

05

Setup, hold, metastability

D must be stable before the edge for setup time and after it for hold time. Violating this window can cause metastability.

CLKDQ
Q changes only on rising edges; D changes while CLK=1 are ignored.

06

Finite-state machine

An FSM has a state register and combinational next-state/output logic. At a clock edge the register accepts next state; between edges the logic computes the next transition.

LockedUnlockedcoinpushpushcoinreset
The turnstile FSM: Locked/Unlocked.

SELF-CHECK

Check your understanding

SR: 00?

Hold.

SR: 11?

Invalid for a NOR latch.

Rising edge?

A 0→1 transition.

Two main FSM parts?

State register and combinational logic.