Q5.
There are four states (S0, S1, S2, S3) in a state machine corresponding to numbers x2, y1, z0, and 43,
respectively. Here x, y and z are digits of your registration number; e.g. if the registration number is 785
then x = 7, y = 8, z = 5 and the numbers are 72, 81, 50 and 43. If the machine is at a state, which represents
the highest number then if the input is 0 the machine transits to state representing the 2nd smallest number
and if the input is 1 it remains in the same state. Likewise, if the machine is at a state, which represents the
smallest number then if the input is 1 the machine transits to state representing the 2nd highest number and
if the input is 0 it remains in the same state. At any other state if the input is 0 the state transits to a state that
represents the next lower number and if the input is 1 the state transits to a state that represents the next
higher number. You are provided with T FFs and external gates.
a) Draw the state diagram.
b) Tabulate the state table.
c) Derive the state equations.
d) Synthesize using JK FFs
e) Draw the logic diagram of the circuit.