IAE Academy

GATE 2018 CS Q.22: solution and answer

GATE 2018 · CSQ.22 · 1 mark · NAT

Consider the sequential circuit shown in the figure, where both flip-flops used are positive edge-triggered D flip-flops. The number of states in the state transition diagram of this circuit that have a transition back to the same state on some value of "in" is ______.

GATE 2018 CS question 22: Two positive edge-triggered D flip-flops in series.Tap to open full size
Figure from the GATE 2018 CS paper. It is part of the question.
Figure description

Two positive edge-triggered D flip-flops in series. The input "in" drives D of flip-flop 1. Q of flip-flop 1 drives D of flip-flop 2. Q of flip-flop 2 is the output "out". A common clock line drives the clock inputs (edge-triggered triangles) of both flip-flops.

Answer and solution

ANSWER

The number of states with a self-loop on some input is 2 (states 00 and 11).

Official answer: 2Source: Official answer key, GATE 2018 CS (IIT Guwahati)

  1. Let the state be . Two flip-flops give states: .

  2. Both flip-flops are positive edge-triggered D flip-flops on a common clock, so on each clock edge and . The circuit is a 2-bit shift register.

  3. The next state is .

  4. A self-loop at state needs , that is and . So the state must have , and then "in" is chosen equal to that common value.

  5. State : with the next state is , a self-loop.

  6. State : with the next state is , a self-loop.

  7. State : the next state is , whose second bit is , so no value of "in" gives a self-loop. State : the next state is , whose second bit is , so no self-loop.

  8. Only and return to themselves on some value of "in", so the count is .

KEY IDEA

The circuit is a 2-bit shift register with next state (in, Q1). A self-loop needs Q1 = Q2 and in equal to that value, which holds only for 00 and 11.

WATCH OUT FOR

Counting all four states, or forgetting that Q2 takes the old value of Q1 (not the new input), so states 01 and 10 can never map to themselves.

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

More Sequential questions