A Mealy state machine is a machine whose output depends not only on the input but also on the current state. It is used in designing the sequence detector which is a sequential state machine which takes an input string of bits and generates an output 1 whenever the target sequence has been detected.
Sequence detector is of two types:
In an overlapping sequence detector the last bit of one sequence becomes the first bit of next sequence. However, in non-overlapping sequence detector the last bit of one sequence does not become the first bit of next sequence. We need to design a non-overlapping Mealy Sequence Detector.
I have used the JFLAP tool to draw the Sequence Generator to detect the sequence 10010
I have also tested it for sequences 10010,100110010,000010010
The number of states are five.
Here is the State Table for the Mealy Sequence Generator
|0 1||0 1|
|q0||q0 q1||0 0|
|q1||q2 q0||0 0|
|q2||q3 q0||0 0|
|q3||q0 q4||0 0|
|q4||q0 q1||1 0|