GATE 2025 CS (CS1) – Question 60
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)

Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 8
Explanation
The four D flip-flops are connected as a shift register: $Q_0\to D_1$, $Q_1\to D_2$, $Q_2\to D_3$, and the **complement** of the last output, $\overline{Q_3}$, is fed back to $D_0$. This is a 4-bit **Johnson (twisted-ring) counter**.
Starting from 0000 the sequence is
$$0000\to1000\to1100\to1110\to1111\to0111\to0011\to0001\to0000,$$
which visits $2n=8$ distinct states for $n=4$ flip-flops before repeating.
Number of distinct states in the cycle $=\mathbf{8}$.