GATE | GATE-CS-2003 | Question 90
A 1-input, 2-output synchronous sequential circuit behaves as follows :
Let zk, nk denote the number of 0’s and 1’s respectively in initial k bits of the input (zk + nk = k). The circuit outputs 00 until one of the following conditions holds.
zk - nk = 2. In this case, the output at the k-th and all subsequent clock ticks is 10. nk - zk = 2. In this case, the output at the k-th and all subsequent clock ticks is 01.
What is the minimum number of states required in the state transition graph of the above circuit?
Explanation: The answer must be 5 to this question as we just need to count the difference of the number of 0’s and 1’s in the first k bit of a number. And we just need to count till this count reaches 2 or -2 (negative when number of 0’s is less than number of 1’s) . So, the possibilities are -2, -1, 0, 1 and 2 which represents the five states of the state transition diagram.
For state -2, the output of the circuit will be 01, for state 2, output will be 10 (both these states not having any outgoing transitions) and for other 3 states, output will be 00 as per the given description of the circuit.
Quiz of this Question