Skip to content

Electronics · Ch 10 — Digital Electronics

Sequential Logic Circuits

10.5

Sequential Logic Circuits

Logic circuits fall into two broad families. Combinational logic circuits produce an output that depends only on the input levels present at that same instant, so they keep no record of what came before — they have no memory. Sequential logic circuits produce outputs that depend on the present inputs and on the sequence of past inputs, so they must store information — they have memory. A sequential circuit is therefore built from a combinational block together with one or more memory elements, whose stored state is fed back into the combinational logic (Figure 10.5.1). The flip-flops, registers and counters covered here make sequential logic one of the highest-yield topics in the Karnataka 2nd PUC Electronics course, and questions on them appear routinely in the II PUC board exam.

The clock and why it matters

The memory elements in a sequential circuit are meant to change only at fixed, discrete instants rather than continuously. A clock — a device that produces a periodic train of pulses — provides this timekeeping so that every element updates in step. An ideal system clock is a perfectly periodic square wave (Figure 10.5.2(a)). A single clock pulse has three features (Figure 10.5.2(b)): a rising (leading) edge where it goes LOW→HIGH, a flat level (active) state, and a falling (trailing) edge where it goes HIGH→LOW. Three requirements define an ideal clock pulse: (1) the HIGH and LOW levels must be perfectly stable; (2) the transition time between levels should be zero; (3) the clock frequency should stay steady over the period of interest.

Level and edge triggering

A flip-flop that changes state at the moment the clock transits (LOW→HIGH or HIGH→LOW) is edge-triggered. Edge-triggered flip-flops are further split into positive-edge-triggered (respond to the rising edge) and negative-edge-triggered (respond to the falling edge). The clock input of an edge-triggered device is drawn with a small '>' wedge. A flip-flop that instead responds while the clock is simply held HIGH is level-triggered.

Flip-flops

The key memory element in sequential logic is the flip-flop (FF) — a bistable multivibrator with two stable states. Left alone it stays in whichever state it is in; only an external input flips it to the other. Each flip-flop thus stores exactly one bit (a 0 or a 1). It provides two complementary outputs, QQ and Q‾\overline{Q}; by convention the "state" of the flip-flop is read off QQ. Flip-flops are the building blocks of registers and counters, and are classified as SR, D, JK, JK Master-Slave and T types by how they behave. Because a latching action occurs even in an unclocked flip-flop, a flip-flop is sometimes called a clocked latch.

Basic NAND latch (active-LOW SR latch)

The simplest flip-flop is the SR latch: two inputs S and R, two complementary outputs QQ and Q‾\overline{Q}, with the state read from QQ. An active-LOW SR latch is built from two cross-coupled NAND gates whose active-low inputs are S‾\overline{S} and R‾\overline{R} (Figure 10.5.3). Its four cases are:

  1. S‾=0, R‾=0\overline{S}=0,\ \overline{R}=0 drives both QQ and Q‾\overline{Q} to 1, which contradicts the requirement that the outputs be complementary — the INVALID state;
  2. S‾=0, R‾=1\overline{S}=0,\ \overline{R}=1 forces Q=1, Q‾=0Q=1,\ \overline{Q}=0 — SET;
  3. S‾=1, R‾=0\overline{S}=1,\ \overline{R}=0 forces Q=0, Q‾=1Q=0,\ \overline{Q}=1 — RESET;
  4. S‾=1, R‾=1\overline{S}=1,\ \overline{R}=1 leaves the output unchanged — HOLD.
    Note

    In the printed truth table the input columns are headed simply S and R, even though the actual circuit inputs are the active-low S‾\overline{S} and R‾\overline{R}. The truth-table card below reproduces the book's column headings exactly as printed.

Unclocked SR flip-flop (active-HIGH NAND latch)

Inserting inverters at the inputs of the cross-coupled NAND latch produces an unclocked SR flip-flop, also called an active-HIGH NAND latch (Figure 10.5.4). It now responds to active-HIGH S and R:

  1. S=0, R=0 — the latch does not respond, outputs HOLD;
  2. S=1, R=0 — SET (Q=1, Q‾=0Q=1,\ \overline{Q}=0);
  3. S=0, R=1 — RESET (Q=0, Q‾=1Q=0,\ \overline{Q}=1), and note that QQ follows S;
  4. S=1, R=1 — both internal lines go to 0 and force QQ and Q‾\overline{Q} both HIGH — INVALID/FORBIDDEN.

Clocked SR flip-flop

An SR latch is asynchronous: its output can change at any time the inputs change. Adding an enable/clock (CLK) input makes it synchronous — it now acts on its S,R inputs only while CLK is HIGH (Figure 10.5.5). When CLK=1 the four S,R combinations give HOLD, SET, RESET and INVALID exactly as in the unclocked SR flip-flop. When CLK=0 the output holds its previous state for any S,R, so the clock effectively works as an ENABLE. (The timing diagram for the clocked SR flip-flop is printed on the following page without its own figure number.)

Note

From here on, unless stated otherwise, only the clocked versions of the D, JK and JK Master-Slave flip-flops are discussed.

D flip-flop

The SR flip-flop's INVALID state (S=R=1) is unwanted. Placing a NOT gate between the S and R inputs guarantees they are always complementary and converts the SR flip-flop into a Data or D flip-flop: data is applied at the single D input and the output QQ simply follows D (Figure 10.5.6). With CLK=0 the output holds; with CLK=1 the output takes the value of D (D=0 → Reset, D=1 → Set).

JK flip-flop

Converting SR to D removes the INVALID state but also loses the useful HOLD condition. The JK flip-flop restores all four behaviours and is the most versatile and widely used flip-flop; commercially it is available as the dual JK flip-flop IC 7476 (Figure 10.5.7). A JK flip-flop is essentially an SR flip-flop in which J is ANDed with Q‾\overline{Q} to feed S and K is ANDed with QQ to feed R, i.e. S=J⋅Q‾nS = J\cdot\overline{Q}_n and R=K⋅QnR = K\cdot Q_n (Figure 10.5.8). With CLK=1:

  1. J=0, K=0 — HOLD;
  2. J=0, K=1 — RESET;
  3. J=1, K=0 — SET;
  4. J=1, K=1 — TOGGLE (the output goes to its complementary state, e.g. Q=1Q=1 becomes Q=0Q=0). The full derivation, including the intermediate S and R columns, is tabulated below and the behaviour is drawn in Figure 10.5.9.

Race-around condition

While CLK is HIGH, a JK flip-flop with J=K=1 is in toggle mode. Because the outputs feed back to the inputs, the state can change more than once during a single HIGH interval: after a delay Δt\Delta t equal to the propagation delay through the gate chain the output complements, and if the clock is still HIGH it complements again after another Δt\Delta t. Thus for the ON-time tpt_p of the clock pulse the output keeps flipping between 0 and 1, and its final value at the end of the pulse is uncertain — this is the race-around condition. It disappears if the propagation delay is made longer than the pulse ON-time; since real ICs have very small propagation delays, a Master-Slave arrangement is used instead.

The Master-Slave JK flip-flop …

Figure 1Block diagram of a sequential logic circuit, with a combinational-logic block and a memory element connected in its feedback path.
Fig. 1 — Block diagram of a sequential logic circuit, with a combinational-logic block and a memory element connected in its feedback path.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.1 draws a sequential circuit as a combinational-logic block whose outputs are fed back through a memory element into its own inputs. The memory element storing the past state is what gives the circuit its memory and distinguis …

Figure 2An ideal system-clock waveform — a perfectly periodic square wave alternating between HIGH and LOW levels.
Fig. 2 — An ideal system-clock waveform — a perfectly periodic square wave alternating between HIGH and LOW levels.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.2(a) shows the shape of an ideal clock: a periodic square wave that provides the timing reference synchronizing every memory element in a sequential circuit. What to notice: its equal HIGH and LOW levels and fixed period make this square wave the timing reference that keeps ever …

Figure 3The parts of a single clock pulse — its rising edge, level (active-HIGH) state and falling edge.
Fig. 3 — The parts of a single clock pulse — its rising edge, level (active-HIGH) state and falling edge.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.2(b) labels one clock pulse: the rising (leading) edge where it goes LOW→HIGH, the flat level state while it is HIGH, and the falling (trailing) edge where it returns HIGH→LOW. Edge-trig …

Definition 4Flip-flop

A flip-flop is a bistable multivibrator with two stable states that stores one bit of data (a 0 or a 1). It holds its state indefinitely until an external input changes it, and provides two complementary outputs QQ and Q‾\overline{Q}. Flip-flops are the basic memor …

Figure 5Logic symbol, cross-coupled-NAND logic circuit and truth table of an active-LOW SR latch.
Fig. 5 — Logic symbol, cross-coupled-NAND logic circuit and truth table of an active-LOW SR latch.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.3 gives the active-LOW SR latch: a logic symbol (inputs S‾\overline{S}, R‾\overline{R}; outputs QQ, Q‾\overline{Q}) and a logic circuit of two cross-coupled NAND gates. It shows how the SET, RESET, HOLD and INVALID condi …

Table 6Truth table of the active-LOW SR latch (SET, RESET, HOLD and INVALID states).

The book heads the input columns S and R, although the actual circuit inputs are the active-low S‾\overline{S} and R‾\overline{R}; the headings are reproduced as printed.

Inputs — SInputs — ROutput QnQ_nOutput Q‾n\overline{Q}_nComment
00??INVALID
0110SET
Figure 7Logic diagram, truth table and timing diagram of the unclocked (active-HIGH) SR flip-flop.
Fig. 7 — Logic diagram, truth table and timing diagram of the unclocked (active-HIGH) SR flip-flop.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.4 shows the unclocked SR flip-flop — a cross-coupled NAND latch with inverters added at the S and R inputs — together with its timing diagram, which marks the Hold, Set, Reset and the uncertain ( …

Table 8Truth table of the unclocked SR flip-flop.
SRQnQ_nQ‾n\overline{Q}_nComment
00Qn−1Q_{n-1}Q‾n−1\overline{Q}_{n-1}HOLD
1010SET
Figure 9Logic circuit and logic symbol of the clocked SR flip-flop, with the clock added as an enable input.
Fig. 9 — Logic circuit and logic symbol of the clocked SR flip-flop, with the clock added as an enable input.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.5 shows the clocked SR flip-flop: the S and R signals are gated with the clock before reaching the cross-coupled output NAND gates, so the flip-flop responds only while CLK is HIGH. Th …

Figure 10Timing diagram of the clocked SR flip-flop, showing that the output changes only while the clock is HIGH.
Fig. 10 — Timing diagram of the clocked SR flip-flop, showing that the output changes only while the clock is HIGH.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

This timing diagram (printed with Figure 10.5.5 but without its own number) plots CLK, S, R and QQ, showing that QQ updates only during the HIGH intervals of the clock and marking the uncertain ou …

Table 11Truth table of the clocked SR flip-flop, including the CLK-enable behaviour.

Here X = any input state.

CLKSRQnQ_nQ‾n\overline{Q}_nComment
100Qn−1Q_{n-1}Q‾n−1\overline{Q}_{n-1}HOLD
11010SET
10101RESET
111??INVALID
Figure 12Logic circuit and logic symbol of the D (Data) flip-flop, in which the output follows the single D input.
Fig. 12 — Logic circuit and logic symbol of the D (Data) flip-flop, in which the output follows the single D input.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.6 shows the D flip-flop, formed by placing a NOT gate between the S and R inputs of an SR flip-flop so the two are always complementary. Data at the D input is transferred to QQ on the clock; the symbol shows a single D input, a '> …

Figure 13Timing diagram of the D flip-flop, showing the output following the D input at each clock.
Fig. 13 — Timing diagram of the D flip-flop, showing the output following the D input at each clock.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

This unnumbered timing diagram (printed with the D flip-flop on the next page) plots CLK, D and QQ, illustrating that QQ simply follows the level of D at the clock edge. Reading the pattern: at each clock the output QQ takes whatever level D holds, so the D flip-flop transfers and …

Table 14Truth table of the D flip-flop.

Here X = any input state.

CLKDQnQ_nQ‾n\overline{Q}_nComment
0XQn−1Q_{n-1}Q‾n−1\overline{Q}_{n-1}Hold
Figure 15Pin-out of the 16-pin dual JK master-slave flip-flop IC 7476, with its Preset and Clear terminals.
Fig. 15 — Pin-out of the 16-pin dual JK master-slave flip-flop IC 7476, with its Preset and Clear terminals.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.7 gives the functional pin-out of the IC 7476, a 16-pin dual JK master-slave flip-flop with Preset (PR) and Clear (CLR) inputs. Only the pin and function layout is reproduced here, drawn afresh from the pin facts; the …

Figure 16Logic circuit and logic symbol of the clocked JK flip-flop, built from an SR flip-flop with feedback AND gates.
Fig. 16 — Logic circuit and logic symbol of the clocked JK flip-flop, built from an SR flip-flop with feedback AND gates.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.8 shows the clocked JK flip-flop: J is ANDed with Q‾\overline{Q} and K with QQ (together with the clock) to feed the internal S and R inputs, giving S=J⋅Q‾nS=J\cdot\overline{Q}_n and R=K⋅QnR=K\cdot Q_n. The symbol has J, K, a '>' …

Formula 17JK flip-flop derived from an SR flip-flop

The JK flip-flop is an SR flip-flop whose S and R inputs are gated by the outputs: S=J⋅Q‾nS = J\cdot\overline{Q}_n and R=K⋅QnR = K\cdot Q_n. This feedback removes the SR flip-flop's invalid state and adds …

Table 18Full derivation truth table of the clocked JK flip-flop, with the intermediate S and R columns.

Here X = any input state.

CLKJKQnQ_nQ‾n\overline{Q}_nS=J⋅Q‾nS=J\cdot\overline{Q}_nR=K⋅QnR=K\cdot Q_nQn+1Q_{n+1}Q‾n+1\overline{Q}_{n+1}Comment
0XXXXXXQnQ_nQ‾n\overline{Q}_nHOLD
1000100QnQ_nQ‾n\overline{Q}_nHOLD
1001000QnQ_nQ‾n\overline{Q}_nHOLD
101010001RESET
101100101RESET
110011010SET
110100010SET
Figure 19Timing diagram of a clocked JK flip-flop, marking the hold, reset, set and toggle output regions.
Fig. 19 — Timing diagram of a clocked JK flip-flop, marking the hold, reset, set and toggle output regions.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.9 plots CLK, J, K and QQ for a clocked JK flip-flop and labels the four output behaviours — hold, reset, set and toggle — under successive clock intervals. Reading the pattern: with J=K=0 the output holds, J=0/K=1 resets, J=1/K=0 sets, and J=K=1 toggles QQ to its complement e …

Definition 20Race-around condition

In a clocked JK flip-flop with J=K=1, the output can toggle more than once while the clock stays HIGH, because the outputs feed back to the inputs. After each propagation delay Δt\Delta t the output complements, so over the pulse ON-time tpt_p it oscillates between 0 and 1 and its final value is uncertain. This is the race-around cond …

Figure 21Clock-pulse timing detail defining the propagation interval, the ON-time and the period used to explain the race-around condition.
Fig. 21 — Clock-pulse timing detail defining the propagation interval, the ON-time and the period used to explain the race-around condition.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

This unnumbered timing detail (printed with the race-around discussion) marks the small delay Δt\Delta t, the pulse ON-time tpt_p and the full period TT, illustrating how the JK output can flip re …

Figure 22A single clock pulse marking its positive (rising) edge and negative (falling) edge.
Fig. 22 — A single clock pulse marking its positive (rising) edge and negative (falling) edge.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

This unnumbered figure marks the positive edge (LOW→HIGH) and negative edge (HIGH→LOW) of a clock pulse, and explains that in the Master-Slave arrangement the positive edge drives the Master while …

Figure 23Block-level logic circuit of the Master-Slave JK flip-flop — two cascaded JK stages with an inverted slave clock.
Fig. 23 — Block-level logic circuit of the Master-Slave JK flip-flop — two cascaded JK stages with an inverted slave clock.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.10(a) shows the Master-Slave JK flip-flop as a Master JK stage feeding a Slave JK stage; the Slave's clock is inverted so it triggers on the opposite edge, and the Slave outpu …

Figure 24Logic symbol of the Master-Slave JK flip-flop, with J, K, clock and complementary outputs.
Fig. 24 — Logic symbol of the Master-Slave JK flip-flop, with J, K, clock and complementary outputs.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.10(b) is the single-block logic symbol of the JK Master-Slave flip-flop, with inputs J, CLK, K and outputs QQ, Q‾\overline{Q}. What to notice: the single '>' clock and the complementary outputs QQ, Q‾\overline{Q} hide the internal master and slave stages; this …

Figure 25NAND-gate realization of the JK Master-Slave flip-flop, showing the master latch and slave latch stages.
Fig. 25 — NAND-gate realization of the JK Master-Slave flip-flop, showing the master latch and slave latch stages.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.10(c) draws the full NAND-gate realization, with the master latch and slave latch highlighted and the clock inverted (Clk‾\overline{\mathrm{Clk}}) to the slave stage, so data passes from maste …

Figure 26Timing diagram of the JK Master-Slave flip-flop, showing master action on the rising edge and slave output on the falling edge.
Fig. 26 — Timing diagram of the JK Master-Slave flip-flop, showing master action on the rising edge and slave output on the falling edge.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.11 plots the numbered clock pulses with the J and K inputs and the QQ output, showing the master responding at the rising edge and the slave delivering the final output at t …

Figure 27Logic circuit and logic symbol of the T (toggle) flip-flop — a JK flip-flop with J and K tied together to the single T input.
Fig. 27 — Logic circuit and logic symbol of the T (toggle) flip-flop — a JK flip-flop with J and K tied together to the single T input.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

Figure 10.5.12 shows the T flip-flop: the single input T is connected to both the J and K inputs of a JK flip-flop, so with T held HIGH the output toggles once per clock pulse. The symbol has T, CLK …

Figure 28Timing diagram of the T flip-flop, showing the output toggling on each clock pulse while T is HIGH.
Fig. 28 — Timing diagram of the T flip-flop, showing the output toggling on each clock pulse while T is HIGH.

Drawn by us to help you understand the concept clearly, and verified to make sure it's accurate. For exams, practice from your textbook's own diagram.

This timing diagram (printed with Figure 10.5.12) plots CLK, T and QQ and shows QQ complementing on successive clock pulses while T = 1. Reading the pattern: with T held HIGH the output QQ flips to its complement on every clock pulse, so the T flip-flop divides the cloc …

Table 29Truth table of the T (toggle) flip-flop.

Here X = any input state.

CLKTQn+1Q_{n+1}State
0XQnQ_nNo change
10QnQ_nNo change