Skip to content

Sequential Logic

A sequential circuit contains memory. Its next state depends on present inputs and the stored present state. A latch is level-sensitive; a flip-flop updates on a clock edge.

Let QnQ_n denote the state before the active event and Qn+1Q_{n+1} or Q+Q^+ the state after it.

Two cross-coupled NOR gates form an active-HIGH set–reset latch. Feedback makes the circuit bistable: after an input pulse ends, the new state remains.

Active-HIGH SR latch made from cross-coupled NOR gates. The feedback paths retain the state after S or R returns LOW.

Active-HIGH SR latch made from cross-coupled NOR gates. The feedback paths retain the state after SS or RR returns LOW.

SSRRQ+Q^+Operation
0QQhold
010reset
101set
11undefinedforbidden

Active-HIGH NOR SR-latch operation.

For the valid input combinations,

Q+=S+R‾Q,SR=0.\boxed{Q^+=S+\overline RQ},\qquad SR=0.

When S=R=1S=R=1, both NOR outputs are forced LOW. Releasing both inputs together can leave the final state dependent on unequal gate delays, so this command is forbidden. A cross-coupled NAND latch instead uses active-LOW inputs and has its forbidden condition at S‾=R‾=0\overline S=\overline R=0.

A gated SR latch accepts SS and RR only while enable EE is active. A D latch removes the forbidden data combination by applying S=DS=D and R=D‾R=\overline D through the enable gates. While enabled it is transparent; when disabled it holds the last value.

A flip-flop samples its inputs only around the active clock edge. A triangle at the clock pin denotes edge triggering; a clock bubble plus triangle denotes a falling-edge device.

Positive- and negative-edge D and JK flip-flop symbols.

Positive- and negative-edge D and JK flip-flop symbols.

TypeInput 1Input 2Next state Q+Q^+Operation
SRQQhold
SRreset
SRset
SRundefinedforbidden
JKQQhold
JKreset
JKset
JKQ‾\overline Qtoggle
D–store 0
D–store 1
T–QQhold
T–Q‾\overline Qtoggle

Characteristic behavior of standard flip-flops.

The characteristic equations are

SR:Q+=S+R‾Q,SR=0,JK:Q+=JQ‾+K‾Q,D:Q+=D,T:Q+=T⊕Q.\begin{aligned} \text{SR:}\quad &Q^+=S+\overline RQ, &&SR=0, \\ \text{JK:}\quad &Q^+=J\overline Q+\overline KQ, \\ \text{D:}\quad &Q^+=D, \\ \text{T:}\quad &Q^+=T\oplus Q. \end{aligned}

JK removes the SR forbidden command by making J=K=1J=K=1 toggle. D is the natural storage element for registers and pipelines. T is convenient for counters and divides clock frequency by two when held at 1.

An excitation table works backward from a required state transition to the input that causes it. ×\times denotes a don’t-care.

QQQ+Q^+SSRRJJKKDDTT
×\times×\times
×\times
×\times
×\times×\times

Combined flip-flop excitation table.

Use this table for counter and state-machine design: write present and next states, obtain each flip-flop input, simplify those input functions, then verify legal and unused states.

MethodWhen state may respondMain point
Level-sensitive latchThroughout the active enable levelCan be transparent
Positive-edge flip-flopNear the LOW-to-HIGH clock transitionOne sample per rising edge
Negative-edge flip-flopNear the HIGH-to-LOW clock transitionOne sample per falling edge
Master–slaveMaster and slave use opposite levelsExternal output changes once per cycle

Level and edge control compared.

A level-sensitive JK latch with J=K=1J=K=1 feeds each output change back while the clock remains active. If the active pulse exceeds the feedback round-trip delay, QQ can toggle repeatedly; this is race-around.

Master–slave JK structure and suppression of external race-around.

Master–slave JK structure and suppression of external race-around.

The master is transparent during one clock level and the slave during the opposite level. The slave therefore receives one fixed master state and the external output changes once per cycle. A true edge-triggered flip-flop is the usual modern solution.

  • Setup time tsut_{su}: data must be stable for this interval before the active edge.

  • Hold time tht_h: data must remain stable for this interval after the active edge.

  • Clock-to-QQ delay tCQt_{CQ}: time from the active edge until the output is valid.

Violating setup or hold can place the storage element in metastability: the output may take an unpredictable time to settle. An asynchronous input should normally pass through a synchronizer before entering synchronous logic.

For a register-to-register path, a basic single-clock timing condition is

Tclk≥tCQ(max⁡)+tlogic(max⁡)+tsu+tskew,\boxed{T_{clk}\ge t_{CQ(\max)}+t_{logic(\max)}+t_{su}+t_{skew}},

with a separate minimum-delay check for hold time.

ElementTypical use
SR latchset/reset control, switch debouncing, simple asynchronous memory
D latchgated data storage and latch-based timing
D flip-flopregisters, pipelines, synchronizers and state machines
JK flip-flopcounters and flexible state control
T flip-flopdivide-by-two stages and binary counters

Natural applications of each storage type.