Related Articles

# GATE | GATE-CS-2006 | Question 37

• Last Updated : 19 Nov, 2018

Consider the circuit in the diagram. The ⊕ operator represents Ex-OR. The D flipflops are initialized to zeroes (cleared).

The following data: 100110000 is supplied to the “data” terminal in nine clock cycles. After that the values of q2q1q0 are:
(A) 000
(B) 001
(C) 010
(D) 101

Explanation:
The D flipflops are initialized to zeroes. This implies q0 = 0, q1 = 0 and q2 = 0 initially.

Clock cycle 1 :
q0 = data = 1 , q1 = q0before XOR q2before = 0 XOR 0 = 0 , q2 = q1before = 0

Clock cycle 2 :
q0 = data = 0 , q1 = q0before XOR q2before = 1 XOR 0 = 1 , q2 = q1before = 0

Clock cycle 3 :
q0 = data = 0 , q1 = q0before XOR q2before = 0 XOR 0 = 0 , q2 = q1before = 1

Clock cycle 4 :
q0 = data = 1 , q1 = q0before XOR q2before = 0 XOR 1 = 1 , q2 = q1before = 0

Clock cycle 5 :
q0 = data = 1 , q1 = q0before XOR q2before = 1 XOR 0 = 1 , q2 = q1before = 1

Clock cycle 6 :
q0 = data = 0 , q1 = q0before XOR q2before = 1 XOR 1 = 0 , q2 = q1before = 1

Clock cycle 7 :
q0 = data = 0 , q1 = q0before XOR q2before = 0 XOR 1 = 1 , q2 = q1before = 0

Clock cycle 8 :
q0 = data = 0 , q1 = q0before XOR q2before = 0 XOR 0 = 0 , q2 = q1before = 1

Clock cycle 9 :
q0 = data = 0 , q1 = q0before XOR q2before = 0 XOR 1 = 1 , q2 = q1before = 0

Thus, option (C) is correct.

Please comment below if you find anything wrong in the above post.

Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up