Show understanding of a flip-flop (SR, JK)

15.2 Boolean Algebra and Logic Circuits – Flip‑Flops

Learning Objective

Students will be able to:

  • Explain the operation of SR and JK flip‑flops, including their timing behaviour.
  • Derive and use the characteristic equations and excitation (transition) tables.
  • Analyse Karnaugh‑map simplifications for the next‑state logic.
  • Identify the practical uses of SR, JK, D and T flip‑flops in synchronous sequential circuits.

1. Introduction to Flip‑Flops

  • A flip‑flop is a bistable multivibrator that stores one binary digit (bit).
  • It has two stable output states, usually denoted Q = 0 and Q = 1.
  • State changes occur only on a triggering event:

    • Level‑sensitive latch: output follows inputs while an enable (or clock) level is active.
    • Edge‑triggered flip‑flop: output changes only on a specified clock edge (rising or falling).

  • Flip‑flops are the fundamental building blocks of registers, counters, memory cells and finite‑state machines (FSMs).

2. SR (Set‑Reset) Flip‑Flop

2.1 Truth Table (NAND‑based, active‑low inputs)

SRQnextComments
00Q (no change)Memory condition
011Set
100Reset
11InvalidBoth outputs would be 0 – forbidden

2.2 Characteristic Equation

For a NAND‑based SR latch (active‑low inputs) the next state is

\$Q_{\text{next}} = \overline{S}\;+\;R\,Q\$

where S and R are the active‑low set and reset signals, and Q is the present state.

2.3 Karnaugh‑Map Derivation

K‑Map for \(Q_{\text{next}}\)

R \ S0 (S=0)1 (S=1)
0 (R=0)Q1Q
110

Grouping the 1’s yields the simplified sum‑of‑products expression \(\overline{S}+R\,Q\), which matches the characteristic equation.

2.4 Gate‑Level Circuit

Cross‑coupled NAND gates forming an SR latch with active‑low inputs

SR latch built from two cross‑coupled NAND gates (active‑low inputs). Adding an enable (clock) line converts it into a gated SR latch.

2.5 Key Points

  • The SR latch is level‑sensitive; its output follows the inputs while the enable (or clock) is active.
  • The combination S = R = 1 is illegal and must be avoided in any practical design.
  • Using NOR gates gives the same functionality with active‑high inputs (S and R true = 1).

3. JK Flip‑Flop

3.1 Truth Table (positive‑edge triggered)

JKQnextOperation
00Q (no change)Memory
010Reset
101Set
11\overline{Q}Toggle

3.2 Characteristic Equation

\$Q_{\text{next}} = J\,\overline{Q}\;+\;\overline{K}\,Q\$

3.3 Karnaugh‑Map Derivation

K‑Map for \(Q_{\text{next}}\)

K \ J0 (J=0)1 (J=1)
0 (K=0)QQ1
10\overline{Q}

Grouping the 1’s gives the SOP expression \(J\overline{Q}+\overline{K}Q\), confirming the characteristic equation.

3.4 Gate‑Level Diagram (master‑slave, positive‑edge)

Master‑slave JK flip‑flop built from NAND gates with a clock input

Master‑slave JK flip‑flop. The master stage is transparent while the clock is low; the slave stage captures the master’s state on the rising edge, producing edge‑triggered behaviour.

3.5 Timing Diagram (positive‑edge trigger)

Timing diagram showing JK inputs, clock, and Q output with setup and hold windows

Typical timing diagram. The data inputs (J, K) must be stable for the setup time before the rising clock edge and for the hold time after the edge. Q changes only on the clock’s rising edge.

3.6 Excitation (Transition) Table

Current QNext Q+JKExplanation
000XHold (K may be 0 or 1)
011XSet
10X1Reset
11X0Hold

“X” denotes a “don’t‑care” condition – either value of that input will produce the required transition.

3.7 Level‑Sensitive vs Edge‑Triggered Summary

  • SR latch: level‑sensitive; output follows inputs while the enable is asserted.
  • JK flip‑flop (master‑slave): edge‑triggered; output changes only on the active clock transition, eliminating race conditions in synchronous designs.

4. Other Common Flip‑Flops

4.1 D (Data) Flip‑Flop

DQnextOperation
00Reset
11Set

Characteristic equation:

\$Q_{\text{next}} = D\$

Uses: simple data storage, shift registers, and as the basic building block for edge‑triggered memory cells.

4.2 T (Toggle) Flip‑Flop

TQnextOperation
0QHold
1\overline{Q}Toggle

Characteristic equation:

\$Q_{\text{next}} = T\;\overline{Q} + \overline{T}\;Q\$

Commonly used in binary counters and frequency‑division circuits (divide‑by‑2, divide‑by‑4, …).

5. Comparison of SR and JK Flip‑Flops

AspectSR Flip‑FlopJK Flip‑Flop
Invalid Input CombinationS = R = 1 (undefined)J = K = 1 → defined toggle
TriggeringLevel‑sensitive (requires gating for synchronisation)Edge‑triggered (master‑slave) – ideal for synchronous circuits
Typical Use in CountersNeeds extra gating to obtain toggle behaviourToggle mode makes it the natural choice for binary counters
ComplexityTwo NAND/NOR gatesFour NAND gates + clock gating (more gates, but more functionality)
Common ApplicationsDebounce circuits, simple set‑reset storageRegisters, synchronous state machines, frequency division

6. Practical Applications

  • Registers & RAM cells – SR for simple set‑reset storage; JK or D for edge‑triggered register stages.
  • Frequency division – A JK flip‑flop wired in toggle mode (or a T flip‑flop) acts as a divide‑by‑2 circuit.
  • Finite‑State Machines – Flip‑flops hold the present state; JK or D are typically used for synchronous state updates.
  • Debounce circuits – An SR latch can hold a stable output while a mechanical switch settles.
  • Ripple and synchronous counters – Cascading T or JK flip‑flops produces binary count sequences.

7. Summary

The SR flip‑flop introduces the basic set‑reset concept but suffers from an illegal input condition. The JK flip‑flop removes this limitation by defining a toggle operation, and when realised as a master‑slave arrangement it provides edge‑triggered behaviour essential for reliable synchronous design. Mastery of truth tables, characteristic equations, Karnaugh‑map simplifications, excitation tables and timing considerations equips students to design robust sequential circuits and to select the most appropriate flip‑flop (SR, JK, D, T) for a given application.