Design a FSM (Finite State Machine) to detect more than one "1"s in last 3 samples.
For example: If the input sampled at clock edges is 0 1 0 1 0 1 1 0 0 1
then output should be 0 0 0 1 0 1 1 1 0 0
And yes, you have to design this FSM using not more than 4 states!!
S0--when you have zero 1's
S1--when you have one 1'
S2--when you have two 1's and
S3--when you have three 1's
Initially you start from state S0... whenever you encounter a 1' you go to next state i.e S0 to S1 or S1 to S2 etc... whenever you encounter a 0' you go to the previous state i.e S1 to S0 or S2 to S1 etc...
I have some confusion which I summarise here:
Input 0 1
S0: Initial S0/0 S1/0
S1 S2/0 S3/1
S2 S0/0 S3/1
S3 X S3/1
Could someone please help me to fill this state.S2/0 and S2/1 states are looking to be feasible [for 101 , this state should be S2/0,for 011 S2/1].
My opinion is that this state machine cannot be designed using 4states...Correct me if I am wrong...