👁 Preview — Study, Practice and Revise are open; mock tests and the rest of the syllabus unlock on subscription. Unlock all · ₹4,999
← Back to Analog and Digital Circuits
Study mode

Sequential circuits flip-flops counters

Introduction to Sequential Circuits

In digital electronics, circuits are broadly classified into combinational and sequential types. Understanding the difference between them is essential before diving into flip-flops and counters.

Combinational circuits are those whose outputs depend only on the current inputs. Examples include adders and multiplexers. However, these circuits have no memory, meaning they do not store or remember previous input states.

Sequential circuits, on the other hand, produce outputs that depend not only on current inputs but also on past inputs-this implies they have memory elements. The ability to store information from previous states makes sequential circuits fundamental in building memory units, registers, and counters.

Why is memory important? Imagine a digital clock that needs to keep track of time. Without a way to remember the current count (hours, minutes, seconds), it couldn't progress logically. Sequential circuits achieve this by using basic building blocks called flip-flops, which store single bits of information.

In sequential circuits, a timing mechanism called the clock controls when data is sampled and updated, enabling synchronized and predictable operation.

Key Concept

Sequential Circuits

Circuits with outputs depending on both current inputs and past states, implemented using memory elements.

Flip-Flops Overview

Flip-flops are fundamental storage elements in digital electronics. Each flip-flop can store one binary bit (0 or 1). The key feature that distinguishes various flip-flops is how their inputs control the stored output state.

Four common types of flip-flops used in sequential circuits are:

  • SR Flip-Flop (Set-Reset)
  • JK Flip-Flop
  • D Flip-Flop (Data or Delay)
  • T Flip-Flop (Toggle)

Each flip-flop responds to inputs (and usually a clock signal) to change their output state Q. Let's examine each type with their characteristic truth tables, circuit symbols, and behavior.

SR Flip-Flop

SR S R Q Q′
SR Flip-Flop Truth Table
SRQ(next)Remark
00Q(previous)Hold state
010Reset
101Set
11InvalidNot allowed

JK Flip-Flop

JK J K Q Q′
JK Flip-Flop Truth Table
JKQ(next)Remark
00Q(previous)Hold state
010Reset
101Set
11Q′(Toggles)Toggle

D Flip-Flop

D D Q Q′
D Flip-Flop Truth Table
DQ(next)Remark
00Output follows input
11Output follows input

T Flip-Flop

T T Q Q′
T Flip-Flop Truth Table
TQ(next)Remark
0Q(previous)Hold state
1Q′(Toggle)Toggle output

Notice the simplicity and increasing versatility from SR to JK flip-flops, and then to D and T types which are widely used in counter designs and data storage.

Key Concept

Flip-Flops

Basic memory elements that store one bit of data, changing state based on inputs and clock pulses.

Counters: Building Sequences from Flip-Flops

Counters are sequential circuits designed to count pulses and produce a binary (or other based) count sequence as output. They are implemented by connecting flip-flops in specific configurations. Generally, there are two types of counters:

  • Asynchronous Counters (Ripple Counters): Flip-flops are connected in series; the clock input of the first flip-flop receives the external clock, and subsequent flip-flops are triggered by the previous flip-flop's output.
  • Synchronous Counters: All flip-flops receive the clock simultaneously, with input combinational logic determining state transitions.

The key difference is timing: asynchronous counters experience propagation delays causing ripple effects, while synchronous counters avoid such delays using common clocking.

Two special variants often appear in exam questions:

  • Mod-N Counters: Counters that count from 0 up to N-1 and then reset.
  • Decade Counters: Mod-10 counters commonly used in digital clocks.

Let's visualize a 4-bit asynchronous (ripple) counter using JK flip-flops.

graph TD    FF0[JK Flip-Flop Q0] --> FF1[JK Flip-Flop Q1]    FF1 --> FF2[JK Flip-Flop Q2]    FF2 --> FF3[JK Flip-Flop Q3]    Clock --> FF0    FF0 --> FF1.clock    FF1 --> FF2.clock    FF2 --> FF3.clock

Here, each flip-flop toggles its state when the previous flip-flop changes from 1 to 0 on its output, creating a binary counting sequence.

sequenceDiagram    participant Clock    participant Q0    participant Q1    participant Q2    participant Q3    Clock->>Q0: Toggle on rising edge    note right of Q0: Q0 toggles every clock cycle    Q0->>Q1: Toggle on Q0 falling edge    note right of Q1: Q1 toggles every 2 clock cycles    Q1->>Q2: Toggle on Q1 falling edge    note right of Q2: Q2 toggles every 4 clock cycles    Q2->>Q3: Toggle on Q2 falling edge    note right of Q3: Q3 toggles every 8 clock cycles

This illustrates the characteristic "ripple" effect of asynchronous counters, where outputs change one after another, with a delay at each flip-flop.

Worked Examples

Example 1: Design of a 3-bit Asynchronous Counter Medium
Design a 3-bit asynchronous counter using JK flip-flops that counts from 0 to 7 in binary. Show the connection and the counting sequence.

Step 1: Use three JK flip-flops: FF0, FF1, and FF2, where each flip-flop output is named Q0, Q1, and Q2 respectively.

Step 2: Connect the clock input of FF0 to the external clock pulse. Both J and K inputs of all flip-flops are connected to logic high (1) to ensure toggling on every triggering clock edge.

Step 3: Connect the clock input of FF1 to the output Q0 of FF0, and the clock input of FF2 to output Q1 of FF1.

Step 4: The outputs Q2 Q1 Q0 represent the binary count, with Q0 as the least significant bit.

Counting sequence:

CountQ2Q1Q0
0000
1001
2010
3011
4100
5101
6110
7111

Answer: By connecting JK flip-flops as described, the circuit will count from 0 to 7 (binary) on successive clock pulses, toggling correctly with propagation delay inducing ripple.

Example 2: Truth Table and Characteristic Equation of JK Flip-Flop Easy
Given the JK flip-flop truth table, derive the characteristic equation that gives the next state \( Q_{next} \) in terms of inputs J, K, and current state Q.

Step 1: Write the truth table:

JKQ\( Q_{next} \)
0000
0011
0100
0110
1001
1011
1101
1110

Step 2: From the table, \( Q_{next} \) can be expressed as:

\[ Q_{next} = J \overline{Q} + \overline{K} Q \]

Explanation:

  • If \( J=1 \) and \( K=0 \), next state is set to 1 regardless of current Q.
  • If \( J=0 \) and \( K=1 \), next state is reset to 0.
  • If \( J=K=0 \), next state remains the same (hold).
  • If \( J=K=1 \), output toggles.

This characteristic equation is widely used for JK flip-flop analysis.

Answer: The characteristic equation is \( Q_{next} = J \overline{Q} + \overline{K} Q \).

Example 3: Designing a Mod-6 Synchronous Counter Hard
Design a synchronous counter that counts from 0 to 5 (mod-6) using JK flip-flops. Show the state table, excitation table, and the logic expressions for J and K inputs.

Step 1: Since mod-6 requires counting 6 states, minimum flip-flops needed are \( n \) such that \( 2^n \geq 6 \); here \( n=3 \) flip-flops (Q2 Q1 Q0).

Step 2: List desired counting sequence in binary:

CountQ2Q1Q0
0000
1001
2010
3011
4100
5101

After state 5 (binary 101), the counter resets to 0 (000).

Step 3: State transitions:

Present State
(Q2 Q1 Q0)
Next State
(Q2' Q1' Q0')
000001
001010
010011
011100
100101
101000

Step 4: Use JK flip-flop excitation table to find J and K inputs for each flip-flop:

Flip-Flop Present Q Next Q J K
Q0011X (don't care)
10X1
0000
1100

Similarly for Q1 and Q2 (due to space limits, refer to flip-flop excitation tables or use Karnaugh maps for simplification).

Step 5: Derive logic expressions for J and K inputs for each flip-flop using Karnaugh maps based on state transitions.

Result: A synchronous mod-6 counter with proper inputs to JK flip-flops which counts 0 to 5 and resets.

Note: This example requires stepwise Karnaugh minimization and is a common topic in entrance exams.

Example 4: Convert SR Flip-Flop to JK Flip-Flop Configuration Medium
Explain how an SR flip-flop can be modified to eliminate the invalid (S=1, R=1) condition by converting it into a JK flip-flop.

Step 1: In SR flip-flop, the input condition S=1 and R=1 is invalid and causes unpredictable outputs.

Step 2: To avoid this, feed the output Q back into the inputs such that:

  • Set input S = J AND \(\overline{Q}\)
  • Reset input R = K AND Q

This feedback removes the invalid state since when J=K=1, the flip-flop toggles the output rather than entering invalid condition.

Step 3: The new inputs J and K control the SR inputs with logic circuits to create a toggle action when both are 1.

Answer: By connecting inputs as \( S = J \overline{Q} \), \( R = K Q \), the SR flip-flop behaves as a JK flip-flop without invalid input combination.

Example 5: Timing Analysis of a Flip-Flop Circuit Medium
Analyze the setup time, hold time, and propagation delay of a D flip-flop using the waveform diagram provided.

Step 1: Setup time is the minimum time before the clock edge that the data input (D) must be stable.

Step 2: Hold time is the minimum time after the clock edge that the data input remains stable.

Step 3: Propagation delay (\( t_p \)) is the time taken by the flip-flop output to respond after the triggering clock edge. It can be separated into \( t_{PHL} \) (output transitions from high to low) and \( t_{PLH} \) (low to high).

Clock D input Q output Setup Time Hold Time Propagation Delay

Answer: The data input must be stable at least for the setup time before the clock rising edge and remain stable for the hold time after it. The output Q changes state after the propagation delay on the clock's triggering edge.

JK Flip-Flop Characteristic Equation

\[Q_{next} = J\overline{Q} + \overline{K}Q\]

Next state depends on inputs J and K and current state Q

J = Set input
K = Reset input
Q = Current state
\(Q_{next}\) = Next state

D Flip-Flop Characteristic Equation

\[Q_{next} = D\]

Next state directly follows the D input at clock edge

D = Data input
\(Q_{next}\) = Next state

T Flip-Flop Characteristic Equation

\[Q_{next} = T \oplus Q\]

Next state toggles if T=1, else holds

T = Toggle input
Q = Current state
\(Q_{next}\) = Next state

Propagation Delay

\[t_p = t_{PHL} + t_{PLH}\]

Sum of high-to-low and low-to-high propagation delay times

\(t_p\) = Total propagation delay
\(t_{PHL}\) = High-to-low delay
\(t_{PLH}\) = Low-to-high delay

Modulus of Counter

\[Mod = 2^n / k\]

Where n is number of flip-flops and k is division factor (if any)

n = Number of flip-flops
k = Mod factor (for mod-N counters)

Tips & Tricks

Tip: Use excitation tables to quickly determine JK or T flip-flop inputs based on required state transitions.

When to use: While designing counters or sequential logic for efficient input calculation.

Tip: Remember "JK=11 toggles output" mnemonic to recall JK flip-flop toggle behavior easily.

When to use: To speed up analysis without re-checking truth tables.

Tip: In asynchronous counters, visualize output toggling as a ripple effect from LSB to MSB to understand delay.

When to use: To quickly predict glitches or timing issues in ripple counters.

Tip: Use Karnaugh maps to simplify the logic expressions for synchronous counter flip-flop inputs.

When to use: For minimizing combinational logic complexity in counters.

Tip: Always verify clock edge triggering and polarity to avoid misinterpretation of flip-flop action in timing diagrams.

When to use: While solving timing and waveform-based exam problems.

Common Mistakes to Avoid

❌ Confusing level-triggered flip-flops with edge-triggered ones and expecting changes throughout the clock pulse.
✓ Remember edge-triggered flip-flops only change state precisely at the clock edge, not during the entire clock period.
Why: Assuming level triggering leads to incorrect timing analysis, causing mispredicted outputs.
❌ Ignoring propagation delay in asynchronous counter design, leading to glitches or incorrect counts.
✓ Consider cumulative delays as output ripples through each flip-flop; design with this in mind.
Why: Ignoring delays results in temporary false states and unstable outputs.
❌ Mixing up J and K inputs or confusing D and T flip-flops during input determination.
✓ Use excitation tables and characteristic equations carefully to confirm inputs for expected next states.
Why: Different flip-flops behave uniquely; confusion leads to wrong circuit analysis.
❌ Forgetting setup and hold time constraints when analyzing timing diagrams of flip-flops.
✓ Always check that input data signals are stable before and after the clock edge as per setup and hold times.
Why: Violating these constraints can cause flip-flop metastability and unpredictable outputs.
❌ Designing counters as simple binary counters without implementing reset logic for mod-N operation.
✓ Add appropriate logic to reset flip-flops once the desired modulus is reached.
Why: Without reset, counters continue counting beyond required range, giving wrong sequences.
Curated videos per subtopic
Top YouTube explainers, AI-ranked for your exam and language. Unlocks with subscription.
Unlock

Try Practice next.

Progress tracking is paywalled — subscribe to mark subtopics as understood and save your streak.

Go to practice →
Ask a doubt
Sequential circuits flip-flops counters · 10 free messages
Ask me anything about this subtopic. You have 10 free messages this session — chat history isn't saved in preview.