GATE / CS ARCHIVE

GATE CSE 2018 / QUESTION 22

Self-loops of a two-bit shift register

Digital Logic · Flip-Flops, Registers & Sequential Circuits · Full GATE CSE 2018 paper

GATE 2018, Q22 1 mark · NAT
Report issue

Flip-Flops, Registers & Sequential Circuits

Question 22, GATE 2018: Two positive-edge D flip-flops share a clock. External in feeds D1; Q1 feeds D2; output is Q2. How many states have a transition to themselves for at least one input?
Tap to enlarge
Answer & solution

Official answer: 2

Method

Both flip-flops sample their inputs at the same edge, so Q2 receives the old Q1, not the newly sampled input. With states written q1q2, input 0/1 transitions are: 00→00/10; 01→00/10; 10→01/11; 11→01/11. Only 00 and 11 appear among their own successors. This explicit table also shows why the mixed states cannot remain unchanged for either input.

Solution

Let the state be(q1, q2). On a positive clock edge the next state is(in, q1), because both flip-flops sample old values simultaneously. A self-loop requires in=q1=q2, possible only for 00 with input 0 and 11 with input 1. Exactly2 states have self-loops.

Original paper, page 9 · Answer key