IAE Academy

GATE 2025 CS1 Q.60: solution and answer

GATE 2025 · CS1Q.60 · 2 marks · 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)

GATE 2025 CS1 question 60: Four positive-edge-triggered D flip-flops D0, D1, D2, D3 in a row, all clocked by one common CLK line.Tap to open full size
Figure from the GATE 2025 CS1 paper. It is part of the question.
Figure description

Four positive-edge-triggered D flip-flops D0, D1, D2, D3 in a row, all clocked by one common CLK line. Each flip-flop has outputs Q and Q-bar. Q0 is connected to the D input of the next flip-flop (D1), Q1 to the input of D2, and Q2 to the input of D3. Q3 goes out to the right as an open output. The Q-bar output of D3 is fed back along a wire that goes up the right side, across the top to the left, and down into the D input of D0. The Q-bar outputs of D0, D1 and D2 are unconnected.

Answer and solution

ANSWER

The circuit goes through 8 distinct states before returning to the initial state.

Official answer: 7 to 8Source: Official answer key, GATE 2025 CS1 (IIT Roorkee)

  1. Read the connections from the figure: , , . The feedback wire leaves the output of the last flip-flop and enters , so . The output is open. This is a shift register fed with the complement of its last output, which is a twisted-ring (Johnson) counter.

  2. On each clock edge the state shifts right by one place, and the new is .

  3. Start from and trace clock by clock: .

  4. The sequence returns to after 8 clock pulses, and the 8 states in it are all different.

  5. An -flip-flop Johnson counter has states in its cycle, so .

  6. The other states form a second cycle: . This also has 8 states, so whichever initial state is chosen, the circuit passes through 8 distinct states before returning to it.

KEY IDEA

Feeding the complement of the last flip-flop's output back to the first input of a shift register makes a Johnson counter. With flip-flops its cycle has states, and the other states form further cycles.

WATCH OUT FOR

Treating the circuit as a ring counter (, 4 states) or as a full binary counter ( states). The complemented feedback makes the cycle states long.

From the GATE 2025 CS1 paper. Every question of this paper · Download the full paper · All 37 Sequential questions, with notes

More Sequential questions