In: Electrical Engineering
Design a state machine to recognize if a binary string contains any occurrence of the sequence “10101”. Is it possible to design this state machine with less states? By using Finite State machine designer.
http://madebyevan.com/fsm/
Solution:
The finite state machine which detects the sequence 10101 is designed and plotted using Finite State Machine Designer tool and the image is attached here.
The design steps are follows.
1. It has to detect the sequence 10101 with overlapping is allowed. It changes its state for every clock pulse and input is taken.
2. Initially the FSM is in state S0 and when the input is one, it moves to state S1 otherwise it is in the same state.
3. From the state S1, when the input is zero, it moves to state S2 otherwise it is in the same state.
4. From the state S2, when the input is one, it moves to state S3 otherwise it is moved to state S0.
5. From the state S3, when the input is zero, it moves to state S4 otherwise it is moved to state S1.
6. From the state S4, when the input is one, it moves to state S3 and the output becomes one, otherwise it is moved to state S0.
5. From the state S2, when the input is one, it moves to state S3 otherwise it is moved to state S0.