Digital Logic Systems

Digital Logic Systems Unit 5: Sequential Circuits

Digital Logic Systems Unit 5: Sequential Circuits

High-Yield Revision Hub

Master Digital Logic Systems Unit 5: Sequential Circuits

Examine level vs. edge triggering, SR/JK/D/T flip-flops, Master-Slave JK race-around resolution, registers (SISO, SIPO, PISO, PIPO), Ring/Johnson counters, synchronous counter design flow, and Mealy/Moore FSMs.

Concept Breakdown

Detailed technical explanation

Unit 5: Sequential Circuits

Unlike combinational circuits, sequential circuits contain memory elements that store the system's "current state." Their outputs at any time depend on both current inputs and the history of past inputs (state).


1. Latches vs. Flip-Flops

  • Latch: A level-sensitive storage element. It changes state as long as the enable signal is at a specific active level (transparent mode).
  • Flip-Flop (FF): An edge-triggered storage element. It changes state only at the rising (positive) or falling (negative) edge of a clock signal.

2. Core Flip-Flops & Excitation Tables

2.1 SR (Set-Reset) Flip-Flop

  • Inputs: SS (Set), RR (Reset).
  • Invalid State: S=R=1S=R=1 leads to an unstable/undefined output when clock goes low.
  • Characteristic Equation: Qnext=S+RQ(with constraint SR=0)Q_{next} = S + R'Q \quad (\text{with constraint } SR = 0)

2.2 JK Flip-Flop

  • Resolves the invalid state of the SR flip-flop by toggling the output when J=K=1J=K=1.
  • Characteristic Equation: Qnext=JQ+KQQ_{next} = JQ' + K'Q
  • The Race-Around Condition:
    • Definition: In a level-triggered JK flip-flop, if J=K=1J = K = 1 and the clock pulse width twt_w is larger than the gate propagation delay tpdt_{pd}, the output will toggle continuously and unpredictably during the clock high period.
    • Remedies:
      1. Use edge-triggered flip-flops.
      2. Ensure clock pulse width tw<tpdt_w < t_{pd}.
      3. Use a Master-Slave JK Flip-Flop.

2.3 Master-Slave JK Flip-Flop

  • Consists of two cascaded JK flip-flops:
    • Master: Enabled when Clock is High. It samples inputs and updates its state.
    • Slave: Enabled when Clock is Low (fed with inverted clock). It copies the master's state to the main outputs.
  • Since the slave only updates when Clock goes Low, the output changes exactly once per clock cycle, eliminating the race-around condition.

2.4 D (Delay / Data) Flip-Flop

  • Directly copies the input DD at the clock edge.
  • Characteristic Equation: Qnext=DQ_{next} = D

2.5 T (Toggle) Flip-Flop

  • Toggles the state if T=1T=1, holds state if T=0T=0.
  • Characteristic Equation: Qnext=TQ=TQ+TQQ_{next} = T \oplus Q = TQ' + T'Q

3. Summary Tables of Flip-Flops

3.1 Characteristic Tables

Shows the next state QnextQ_{next} based on inputs and current state QQ.

Input (SR)QnextQ_{next}Input (JK)QnextQ_{next}Input (D)QnextQ_{next}Input (T)QnextQ_{next}
S=0,R=0S=0, R=0QQ (Hold)J=0,K=0J=0, K=0QQ (Hold)D=0D=000 (Reset)T=0T=0QQ (Hold)
S=0,R=1S=0, R=100 (Reset)J=0,K=1J=0, K=100 (Reset)D=1D=111 (Set)T=1T=1QQ' (Toggle)
S=1,R=0S=1, R=011 (Set)J=1,K=0J=1, K=011 (Set)
S=1,R=1S=1, R=1InvalidJ=1,K=1J=1, K=1QQ' (Toggle)

3.2 Excitation Tables

Indicates the required inputs to transition from a current state QQ to a desired next state QnextQ_{next}. Crucial for counter and sequential circuit design.

Current (QQ)Desired (QnextQ_{next})SSRRJJKKDDTT
000000XX00XX0000
0011110011XX1111
11000011XX110011
1111XX00XX001100

4. Registers and Shift Registers

A register is a group of flip-flops used to store multiple bits of binary data. A shift register is capable of shifting binary data left or right.

4.1 Four Basic Configurations

  1. SISO (Serial-In Serial-Out): Data entered one bit per clock cycle, read out one bit per clock cycle. Needs NN clock cycles for loading, N1N-1 for retrieval.
  2. SIPO (Serial-In Parallel-Out): Serial input, all outputs available immediately. Needs NN clock cycles to load.
  3. PISO (Parallel-In Serial-Out): Parallel load (in 1 clock cycle), serial shift out (needs N1N-1 clock cycles).
  4. PIPO (Parallel-In Parallel-Out): Data loaded and read simultaneously (1 clock cycle).

4.2 Shift Register Counters

  • Ring Counter: A circular shift register where the output of the last stage (QNQ_N) is connected to the input of the first stage (D0D_0). A single preset '1' circulates.
    • Number of states for NN flip-flops = NN.
    • Uses simple decoding logic but has a low state density.
  • Johnson Counter (Twisted Ring Counter): The inverted output of the last stage (QNQ_N') is connected to the input of the first stage (D0D_0).
    • Number of states for NN flip-flops = 2N2N.
    • Example: A 4-bit Johnson counter counts through 88 states (00001000110011101111011100110001repeat0000 \rightarrow 1000 \rightarrow 1100 \rightarrow 1110 \rightarrow 1111 \rightarrow 0111 \rightarrow 0011 \rightarrow 0001 \rightarrow \text{repeat}).

5. Counters

Counters are sequential circuits that cycle through a predefined sequence of states.

Asynchronous (Ripple) vs. Synchronous Counters

  • Asynchronous Counters:
    • The clock input is connected only to the first flip-flop. Subsequent flip-flops are clocked by the outputs of preceding flip-flops.
    • Propagation Delay accumulates: Ttotal=NtpdT_{total} = N \cdot t_{pd}. This limits the maximum operating frequency.
  • Synchronous Counters:
    • All flip-flops are connected to a common clock signal and trigger simultaneously.
    • Slower propagation delays are avoided, allowing much higher operating frequencies.

5.1 Synchronous Counter Design Methodology

  1. Define State Sequence: Draw the State Transition Diagram.
  2. Construct State Table: Show present state (QA,QB,...Q_A, Q_B, ...) and next state (QA+,QB+,...Q_A^+, Q_B^+, ...).
  3. Incorporate Excitation Table: Determine required input excitations for each flip-flop (JA,KA,...J_A, K_A, ...) using the Excitation Table.
  4. Solve Excitation Equations: Use K-maps to minimize input expressions in terms of present states.
  5. Draw the Circuit: Realize using flip-flops and logic gates.

5.2 Synchronous Up/Down Counter

Uses a mode control input MM to steer the clock or inputs:

  • If M=0M=0, it counts UP (e.g., QnextQ_{next} determined by QQ terms).
  • If M=1M=1, it counts DOWN (e.g., QnextQ_{next} determined by QQ' terms).

5.3 Programmable Counters (Mod-N Counters)

Counters that reset to zero (or load a preset value) after reaching a count NN.

  • Asynchronous Mod-N: Uses NAND gate feedback connected to the asynchronous CLEAR inputs of the flip-flops. When the binary value corresponding to NN appears, the NAND gate output goes Low, resetting the counter to 00.
  • Synchronous Mod-N: Incorporates feedback gates directly into the DD or J-KJ\text{-}K inputs so the reset occurs synchronously on the next clock pulse.

6. Finite State Machines (FSM): Mealy vs. Moore

Sequential circuits can be represented mathematically as FSMs.

6.1 Mealy Machine

  • Outputs depend on both the present state and the current inputs.
  • If inputs change, outputs can change immediately (asynchronously), even without a clock edge.
  • Generally requires fewer states than a Moore machine to implement the same logic.
Inputs ----+------------------+ | v | +-------------+ | +------------+ | | Combinational| | | Output | | | Next-State | +->| Logic |----> Outputs | | Logic | +------------+ | +-------------+ ^ v | | +------------------+ | | v | | +------------------------------+ | | | State Register (Memory) |--+ | +------------------------------+ +------------------+

6.2 Moore Machine

  • Outputs depend only on the present state.
  • Outputs are synchronous with the clock.
  • Easier to design and analyze since outputs are stable during input transitions.
Inputs ------>+-------------+ | Combinational| | Next-State | | Logic | +-------------+ | v +---------------+ | State Register|-----+-----> [Output Logic] ----> Outputs +---------------+ | ^ | +-------------+

7. Exam Tips & Common Pitfalls

[!WARNING]

  • Self-Starting Counters: When designing counters, check what happens if the circuit powers up in an unused state (e.g., states 5,6,75, 6, 7 in a Mod-5 counter). A robust design must ensure that the counter eventually enters the valid count cycle (self-starting), rather than getting locked in unused states.
  • Mealy Output Glitches: Since Mealy outputs respond directly to inputs, any glitch/noise on the inputs can immediately produce a glitch on the output. Moore outputs are filtered by the state register flip-flops and are glitch-free.

Key Revision Rules

Essential formulas and core points to memorize

  • 1Latches (level-sensitive, transparent) vs. Flip-Flops (edge-triggered).
  • 2Flip-flop characteristics: SR (unstable at 11), JK (toggles at 11, subject to race-around), D (copies input), T (toggles).
  • 3Master-Slave JK: resolves race-around by decoupling input sampling (master, clock high) and output updates (slave, clock low).
  • 4Shift register counters: Ring Counter (N states) vs. Johnson Counter (2N states).
  • 5Synchronous counter design: Present/Next State Table -> Excitation mapping -> K-map minimization -> Logic implementation.
  • 6Finite State Machines (FSM): Mealy outputs depend on state + inputs; Moore outputs depend on state only.

Common Exam Mistakes

Where students frequently lose marks

Unused states lockout: not checking if unused power-up states lead back to the main cycle (self-starting check).
Mealy output glitches: Mealy machine outputs are sensitive to input noise spikes, unlike Moore machines.

Topic Quiz Practice

1 of 10
Question 1

The main difference between a latch and a flip-flop is:

Digital Logic Systems Unit 5: Sequential Circuits - Revision Notes, Formulas & MCQs | UpScorer | UpScorer