GATE / CS ARCHIVE

GATE CSE 1996 / QUESTION 24(a)

State diagram of an XOR-feedback register

Digital Logic · Finite-State Machine Design · Full GATE CSE 1996 paper

GATE 1996, Q24(a) Descriptive
Report issue

Finite-State Machine Design

Question 24(a), GATE 1996: A synchronous circuit has three D flip-flops with common clock. Q1 feeds D2, Q2 feeds D3, and Q2 XOR Q3 feeds D1 through the feedback gate. State Si denotes the binary value i of Q1Q2Q3, so S0=000,...,S7=111. Draw its state-transition diagram.
Question 24(a), GATE 1996: A synchronous circuit has three D flip-flops with common clock. Q1 feeds D2, Q2 feeds D3, and Q2 XOR Q3 feeds D1 through the feedback gate. State Si denotes the binary value i of Q1Q2Q3, so S0=000,...,S7=111. Draw its state-transition diagram.
Question 24(a), GATE 1996: A synchronous circuit has three D flip-flops with common clock. Q1 feeds D2, Q2 feeds D3, and Q2 XOR Q3 feeds D1 through the feedback gate. State Si denotes the binary value i of Q1Q2Q3, so S0=000,...,S7=111. Draw its state-transition diagram.
Tap to enlarge
Answer & solution

Answer: S0 self-loop; S1→S4→S2→S5→S6→S7→S3→S1. (no official key was published)

A D flip-flop takes its next output from its D input on the common active clock edge. All three updates use the old outputs simultaneously. Reading the circuit wires gives Q1(next)=Q2 XOR Q3, Q2(next)=Q1, and Q3(next)=Q2. In particular, do not feed the newly computed Q1 into Q2 during the same clock edge.

Evaluate the equations for every state:
S0: 000→000, hence S0→S0.
S1: 001→100, hence S1→S4.
S2: 010→101, hence S2→S5.
S3: 011→001, hence S3→S1.
S4: 100→010, hence S4→S2.
S5: 101→110, hence S5→S6.
S6: 110→111, hence S6→S7.
S7: 111→011, hence S7→S3.

To draw the diagram, put a self-loop on S0 and draw the separate seven-state directed cycle S1→S4→S2→S5→S6→S7→S3→S1. There is no external input, so each state has exactly one outgoing edge and there are no input labels to choose. The zero state is a fixed point because shifting zeros and XORing zeros still gives zeros. As a consistency check, the listed targets contain all eight states once; the transition function is invertible, since the old Q1 and Q2 are read from the new Q2 and Q3 and old Q3 is recovered by XORing new Q1 with new Q3.

Original paper, page 10