chapter
    Flip-Flops, Counters and Finite State Machines PYQs for GATE CS

    Solve 8+ Flip-Flops, Counters and Finite State Machines previous year questions for GATE CS with answers and detailed solutions. Free sample questions below.

    Try a question

    Answer it here to see how it works. Nothing is recorded until you sign in.

    Question 1
    2026 Slot Set1 PYQ
    Level 3: Exam Standard
    Consider a 2-bit saturating up/down counter that performs the saturating up count when the input is 0, and the saturating down count when is 1. The Next State table of the counter is as shown. The counter is built as a synchronous sequential circuit using D flip-flops.

    InputCurrent
    State
    Next
    State
    00001
    00110
    01011
    01111
    10000
    10100
    11001
    11110


    Which one of the following options corresponds to the expressions for the inputs of the D flip-flops, and ?
    Question 2
    2025 Slot Set2 PYQ
    Level 3: Exam Standard

    In a 4-bit ripple counter, if the period of the waveform at the last flip-flop is 64 microseconds, then the frequency of the ripple counter in kHz is ________. (Answer in integer)

    Question 3
    2025 Slot Set1 PYQ
    Level 3: Exam Standard
    Consider a finite state machine (FSM) with one input and one output , represented by the given state transition table. The minimum number of states required to realize this FSM is ________. (Answer in integer)

    Present stateNext stateOutput fX = 0X = 1X = 0X = 1AFB00BDC00CFE00DGA10EDC00FFB11GGH01HGA10
    Question 4
    2025 Slot Set1 PYQ
    Level 3: Exam Standard
    Consider the given sequential circuit designed using D-Flip-flops. The circuit is initialized with some value (initial state). The number of distinct states the circuit will go through before returning back to the initial state is _________ . (Answer in integer)

    D0D1D2D3Q₀Q₁Q₂Q₃Q̅₀Q̅₁Q̅₂Q̅₃CLK
    Question 5
    2023 PYQ
    Level 3: Exam Standard
    Consider a sequential digital circuit consisting of T flip-flops and D flip-flops as shown in the figure. CLKIN is the clock input to the circuit. At the beginning, Q1, Q2 and Q3 have values 0, 1 and 1, respectively.

    TQCLKDQCLKTQCLKQ1Q2Q3CLKIN

    Which one of the given values of (Q1, Q2, Q3) can NEVER be obtained with this digital circuit?
    Question 6
    2023 PYQ
    Level 3: Exam Standard
    The output of a 2-input multiplexer is connected back to one of its inputs as shown in the figure.

    Multiplexer01QS

    Match the functional equivalence of this circuit to one of the following options.
    Question 7
    2021 Slot Set2 PYQ
    Level 3: Exam Standard
    Suppose we want to design a synchronous circuit that processes a string of 0’s and 1’s. Given a string, it produces another string by replacing the first 1 in any subsequence of consecutive 1’s by a 0. Consider the following example.

    Input sequence:      00100011000011100
    Output sequence:   00000001000001100

    A Mealy Machine is a state machine where both the next state and the output are functions of the present state and the current input.
    The above mentioned circuit can be designed as a two-state Mealy machine. The states in the Mealy machine can be represented using Boolean values 0 and 1. We denote the current state, the next state, the next incoming bit, and the output bit of the Mealy machine by the variables , , and respectively.
    Assume the initial state of the Mealy machine is 0.

    What are the Boolean expressions corresponding to and in terms of and ?
    Question 8
    2021 Slot Set1 PYQ
    Level 3: Exam Standard
    Consider a 3-bit counter, designed using T flip-flops, as shown below:

    TP TQ TR P P′ Q Q′ R R′ Clock Pulse P Q R
    Assuming the initial state of the counter given by PQR as 000, what are the next three states?
    Free preview ends here

    Login to view the complete previous-year questions and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Flip-Flops, Counters and Finite State Machines PYQs for GATE CS

    Solve 8+ Flip-Flops, Counters and Finite State Machines previous year questions for GATE CS with answers and detailed solutions. Free sample questions below.

    Chapter Roadmap: Digital Logic - Flip-Flops, Counters & FSMs

    Chapter Journey

    1. Flip-Flop Behaviour & Sequential Circuit Analysis Exam instances: 3 | Importance: Medium | Foundation topic 2. Ripple and Synchronous Counters Exam instances: 2 | Importance: Medium-High 3. Counter State Transitions & Excitation Equations Exam instances: 1 | Importance: Medium 4. Mealy Machines and Sequence Processing Exam instances: 1 | Importance: Medium 5. FSM State Minimization Exam instances: 1 | Importance: Medium-Low Total Exam Instances: 8

    What you will master:

    • Trace sequential circuits through clock cycles
    • Design modulo-N counters using flip-flops
    • Derive excitation equations for D, T, JK flip-flops
    • Model sequence detectors as Mealy or Moore machines
    • Minimize states in finite state machines

    Hero Card: What Makes a Circuit Sequential?

    Combinational vs Sequential

    Feature Combinational Sequential
    Output depends onCurrent inputs onlyCurrent inputs + Past state
    MemoryNoYes (flip-flops)
    Clock requiredNoYes (usually)
    ExampleAdder, MultiplexerCounter, Register, FSM

    The Core Idea

    A sequential circuit has two parts:

    1. Combinational logic (gates) that computes next state and outputs
    2. Memory elements (flip-flops) that store the current state

    The clock synchronizes when the state updates. On each active clock edge (rising or falling), flip-flops capture their input and update their output. Between clock edges, the state remains constant.

    Why This Matters

    Every sequential circuit problem asks you to do one thing: trace the state. Given initial values of flip-flops, determine what happens after 1 clock, 2 clocks, or N clocks. You will:

    • Read the circuit diagram
    • Write excitation equations (what goes into each flip-flop)
    • Build a state table
    • Follow the transitions

    Flip-Flops, Counters and Finite State Machines: Solved Questions with Step-by-Step Explanations (8 Problems)

    Question 1 · Digital Logic · 2026_Set1 MCQ
    Consider a 2-bit saturating up/down counter that performs the saturating up count when the input is 0, and the saturating down count when is 1. The Next State table of the counter is as shown. The counter is built as a synchronous sequential circuit using D flip-flops.

    InputCurrent
    State
    Next
    State
    00001
    00110
    01011
    01111
    10000
    10100
    11001
    11110


    Which one of the following options corresponds to the expressions for the inputs of the D flip-flops, and ?
    1. A.

    2. B.

    3. C.

    4. D.

    Correct Answer:

    B

    Step-by-Step Solution

    Insight: For D flip-flops, the excitation input is exactly the next state (). We just need to map the given Next State table to K-maps for and and minimize them.

    Exam route: Build K-maps for and with variables . Fill in the 1s from the and columns. Group the 1s to get the SOP expressions. Match with the options.

    Learning route:

    Step 1: Understand the D flip-flop excitation. and .

    Step 2: Construct the K-map for .

    The minterms where are:

    (m1)

    (m2)

    (m3)

    (m7)

    Grouping these on a 3-variable K-map:

    • m3 and m7 form a pair
    • m1 and m3 form a pair
    • m2 and m3 form a pair

    Thus, .

    Step 3: Construct the K-map for .

    The minterms where are:

    (m0)

    (m2)

    (m3)

    (m6)

    Grouping these:

    • m2 and m6 form a pair
    • m0 and m2 form a pair
    • m2 and m3 form a pair

    Thus, .

    Step 4: Match with options. Option B matches both derived expressions perfectly.

    Verification: Plug in into Option B. . . This matches the table's Next State of 11.

    Question 2 · Digital Logic · 2025_Set2 NAT

    In a 4-bit ripple counter, if the period of the waveform at the last flip-flop is 64 microseconds, then the frequency of the ripple counter in kHz is ________. (Answer in integer)

    Correct Answer:

    250.00

    Step-by-Step Solution

    Insight: A 4-bit ripple counter divides the input clock frequency by . The period at the last flip-flop is 16 times the input clock period.

    Exam route: Find the frequency of the last flip-flop from its period. Multiply by 16 to get the input clock frequency. Convert to kHz.

    Learning route:

    Step 1: The period of the waveform at the last flip-flop (4th stage) is given as .

    Step 2: The frequency at the last flip-flop is .

    Step 3: In an -bit ripple counter, each stage acts as a divide-by-2 circuit. Therefore, the input clock frequency is times the frequency at the -th stage.

    Step 4: For a 4-bit counter, .

    Verification: If , the period is . After 4 stages, the period is , which matches the given data.

    Question 3 · Digital Logic · 2025_Set1 NAT
    Consider a finite state machine (FSM) with one input and one output , represented by the given state transition table. The minimum number of states required to realize this FSM is ________. (Answer in integer)

    Present stateNext stateOutput fX = 0X = 1X = 0X = 1AFB00BDC00CFE00DGA10EDC00FFB11GGH01HGA10
    Correct Answer:

    5.00

    Step-by-Step Solution

    Insight: To find the minimum number of states, we look for equivalent states using row matching and partition refinement. States with identical next-states and outputs can be merged.

    Exam route: Scan the table for identical rows. Merge them. Repeat until no more identical rows exist. Count the remaining unique states.

    Learning route:

    Step 1: Compare rows for exact matches in Next State and Output columns.

    • Row B: Next states (D, C), Outputs (0, 0).
    • Row E: Next states (D, C), Outputs (0, 0).

    Rows B and E are identical. Merge E into B.

    • Row D: Next states (G, A), Outputs (1, 0).
    • Row H: Next states (G, A), Outputs (1, 0).

    Rows D and H are identical. Merge H into D.

    Step 2: Update the table with the merged states (replace E with B, and H with D).

    • Row A: F, B | 0, 0
    • Row B: D, C | 0, 0
    • Row C: F, E F, B | 0, 0
    • Row D: G, A | 1, 0
    • Row F: F, B | 1, 1
    • Row G: G, H G, D | 0, 1

    Step 3: Scan the updated table for new identical rows.

    • Row A: F, B | 0, 0
    • Row C: F, B | 0, 0

    Rows A and C are now identical. Merge C into A.

    Step 4: Update the table again (replace C with A).

    The remaining unique states are A, B, D, F, G.

    Let's verify no more merges are possible:

    • A: F, B | 0, 0
    • B: D, A | 0, 0 (since C became A)
    • D: G, A | 1, 0
    • F: F, B | 1, 1
    • G: G, D | 0, 1

    All 5 remaining states have distinct output signatures or distinct next-state transitions.

    Step 5: The minimum number of states required is 5.

    Question 4 · Digital Logic · 2025_Set1 NAT
    Consider the given sequential circuit designed using D-Flip-flops. The circuit is initialized with some value (initial state). The number of distinct states the circuit will go through before returning back to the initial state is _________ . (Answer in integer)

    D0D1D2D3Q₀Q₁Q₂Q₃Q̅₀Q̅₁Q̅₂Q̅₃CLK
    Correct Answer:

    7.00

    Step-by-Step Solution

    Insight: The circuit is a 4-bit Johnson counter (twisted ring counter), identifiable by the shift-register structure with inverted feedback from the last stage to the first. Exam route: A Johnson counter with flip-flops has a modulus of . Here , so the cycle length is 8. Starting from , the sequence of 8 distinct states is . The number of distinct states visited *before* returning to the initial state is 7 (or 8 if including the initial state, both were accepted in GATE 2025). Learning route: Step 1: Identify the circuit topology. The diagram shows four D flip-flops connected in a chain, where the output of each feeds the input of the next (, , ). Step 2: Observe the feedback path. The inverted output of the last flip-flop () is connected to the input of the first flip-flop (). Step 3: Recognize this specific configuration as a Johnson Counter (or Twisted Ring Counter). Step 4: Recall the property of a Johnson counter: an -bit Johnson counter cycles through exactly distinct states. Step 5: Calculate the cycle length for : distinct states. Step 6: Trace the states manually to verify (assuming initial state ): - Clock 1: - Clock 2: - Clock 3: - Clock 4: - Clock 5: - Clock 6: - Clock 7: - Clock 8: (Returns to initial state) Step 7: Interpret the question phrasing. "Before returning back to the initial state" typically means counting the intermediate states, which is 7. (Note: GATE 2025 official key accepted both 7 and 8). Verification: The trace confirms exactly 8 unique states in the cycle. Excluding the final return to the initial state, 7 distinct states are visited.
    Question 5 · Digital Logic · 2023 MCQ
    Consider a sequential digital circuit consisting of T flip-flops and D flip-flops as shown in the figure. CLKIN is the clock input to the circuit. At the beginning, Q1, Q2 and Q3 have values 0, 1 and 1, respectively.

    TQCLKDQCLKTQCLKQ1Q2Q3CLKIN

    Which one of the given values of (Q1, Q2, Q3) can NEVER be obtained with this digital circuit?
    1. A.

      (0, 0, 1)

    2. B.

      (1, 0, 0)

    3. C.

      (1, 0, 1)

    4. D.

      (1, 1, 1)

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: This is a sequential circuit analysis problem requiring us to derive next-state equations for mixed flip-flop types and trace the state transition graph to find unreachable states.

    Exam route: From the diagram, , , . Using for T-FF and for D-FF, we get , , . Starting from , the sequence is . The state is never visited.

    Learning route:

    Step 1: Identify the flip-flop types and their characteristic equations.

    • is a T-FF:
    • is a D-FF:
    • is a T-FF:

    Step 2: Extract excitation equations from the circuit diagram.

    Step 3: Formulate the next-state equations.

    Step 4: Trace the state sequence starting from the initial state .

    • Current: . , , . Next: .
    • Current: . , , . Next: .
    • Current: . , , . Next: .
    • Current: . , , . Next: .
    • Current: . , , . Next: .
    • Current: . , , . Next: .
    • Current: . , , . Next: (Initial state reached).

    Step 5: List all visited states: .

    Step 6: Compare with the options. The state is not in the list, meaning it can never be obtained.

    Verification: The cycle length is 7, and it perfectly loops back to . State is outside this cycle.

    Question 6 · Digital Logic · 2023 MCQ
    The output of a 2-input multiplexer is connected back to one of its inputs as shown in the figure.

    Multiplexer01QS

    Match the functional equivalence of this circuit to one of the following options.
    1. A.

      D Flip-flop

    2. B.

      D Latch

    3. C.

      Half-adder

    4. D.

      Demultiplexer

    Correct Answer:

    B

    Step-by-Step Solution

    Insight: A 2x1 multiplexer with its output fed back to the '0' input and a select line 'S' acts as a level-sensitive memory element, specifically a D Latch.

    Exam route: The MUX equation is . Substitute (feedback) and (new data). This yields , which is the exact characteristic equation of a D Latch where S acts as the Enable signal.

    Learning route:

    Step 1: Write the standard Boolean equation for a 2x1 multiplexer: .

    Step 2: Identify the connections from the diagram. The output is connected to input . Let the other input (at '1') be the data input .

    Step 3: Substitute into the MUX equation: .

    Step 4: Analyze the behavior based on the select line :

    • If : . The circuit holds its previous state (Memory/Transparent-low state).
    • If : . The output follows the input data (Transparent-high state).

    Step 5: Match this behavior to standard sequential elements. This "hold when 0, follow when 1" behavior is the defining characteristic of a positive-level-sensitive D Latch.

    Verification: A D Flip-flop requires edge-triggering (typically built with two latches and an inverter), which is not present here. A half-adder and demultiplexer are combinational or different sequential structures entirely.

    Question 7 · Digital Logic · 2021_Set2 MCQ
    Suppose we want to design a synchronous circuit that processes a string of 0’s and 1’s. Given a string, it produces another string by replacing the first 1 in any subsequence of consecutive 1’s by a 0. Consider the following example.

    Input sequence:      00100011000011100
    Output sequence:   00000001000001100

    A Mealy Machine is a state machine where both the next state and the output are functions of the present state and the current input.
    The above mentioned circuit can be designed as a two-state Mealy machine. The states in the Mealy machine can be represented using Boolean values 0 and 1. We denote the current state, the next state, the next incoming bit, and the output bit of the Mealy machine by the variables , , and respectively.
    Assume the initial state of the Mealy machine is 0.

    What are the Boolean expressions corresponding to and in terms of and ?
    1. A.
    2. B.
    3. C.
    4. D.
    Correct Answer:

    B

    Step-by-Step Solution

    Insight: The problem describes a sequence processor that replaces the first '1' in a block of consecutive '1's with '0', while leaving subsequent '1's unchanged. This requires tracking whether we are currently inside a block of '1's.

    Exam route: Define state s=0 as "not in a block of 1s" and s=1 as "inside a block of 1s". Trace transitions: from s=0, input b=1 gives output y=0 (replaced) and next state t=1. From s=1, input b=1 gives output y=1 (unchanged) and next state t=1. This matches t=b and y=s AND b.

    Learning route:

    Step 1: Understand the Mealy machine requirement. Output y depends on current state s and input b.

    Step 2: Analyze state s=0. If b=0, we stay in s=0, output y=0. If b=1, this is the first '1', so output y=0, and we move to s=1. Thus, when s=0, t=b and y=0.

    Step 3: Analyze state s=1. If b=0, the block of '1's ends, so we move to s=0, output y=0. If b=1, it's a subsequent '1', so output y=1, and we stay in s=1. Thus, when s=1, t=b and y=b.

    Step 4: Combine the conditions. For t, in both s=0 and s=1, t=b. For y, y is 1 only when s=1 and b=1, which is the logical AND: y = s AND b.

    Step 5: Verify with the example. Input 0010001100... -> Output 0000000100... matches perfectly.

    Verification: Plugging s=0, b=1 into t=b, y=sb gives t=1, y=0. Plugging s=1, b=1 gives t=1, y=1. This perfectly matches the required behavior.

    Question 8 · Digital Logic · 2021_Set1 MCQ
    Consider a 3-bit counter, designed using T flip-flops, as shown below:

    TP TQ TR P P′ Q Q′ R R′ Clock Pulse P Q R
    Assuming the initial state of the counter given by PQR as 000, what are the next three states?
    1. A.

      011, 101, 000

    2. B.

      001, 010, 111

    3. C.

      011, 101, 111

    4. D.

      001, 010, 000

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: This is a synchronous counter where the T inputs are driven by combinational logic of the current state, requiring step-by-step state tracing using the T flip-flop characteristic equation.

    Exam route: Extract excitation equations: , , . Use . Starting from , compute next states: .

    Learning route:

    Step 1: Identify the flip-flop type and its characteristic equation. For T flip-flops, .

    Step 2: Read the circuit diagram to find the excitation equations for each flip-flop input.

    • is connected to , so .
    • is connected to , so .
    • is connected to , so .

    Step 3: Substitute the current state into the excitation equations.

    • , , .

    Step 4: Calculate the next state using .

    Next state is .

    Step 5: Repeat for the next state .

    • , , .
    • , , .

    Next state is .

    Step 6: Repeat for .

    • , , .
    • , , .

    Next state is .

    Verification: The sequence perfectly matches the first option.

    More previous year questions (pyqs) in this unit