A sequential circuit takes an input stream of 0's and 1's and produces an output stream of 0's and 1's. Initially it replicates the input on its output until two consecutive 0's are encountered on the input. From then onward, it produces an output stream, which is the bit-wise complement of input stream until it encounters two consecutive 1's, whereupon the process repeats. An example input and output stream is shown below.
J-K master-slave flip-flops are to be used to design the circuit.
Give the state transition diagram
As we get $4$ states (renaming state component to binary states), we need two FFs to implement it.