1. The problem statement, all variables and given/known data I am trying to design a 5-bit sequence recognizer. The circuit has to detect two sequences of bits. The first sequence is 11001. The second is 10010. The output when no sequence should be 00. When the 1st input sequence is detected, the output should be 01. When the second sequence is detected, the output should be 10. Overlapping should also be detected. I'm designing a mealy type machine first. 2. Relevant equations 3. The attempt at a solution The first step that we always do is draw a state diagram or state table whichever is easier. I chose to draw the state diagram first. State Diagram: A = No pattern has been detected yet B = 1 has been detected. C = 11 or 10 has been detected D = 110 or 100 has been detected. E = 1100 or 1000 has been detected. F = 1101 or 1001 has been detected. I am only meant to output 01 when the first sequence is detected(11001) and output 10 when the second sequence is detected(10010). However as you can see with the bold bit numbers in the description for each state, if 10001(A>B>C>D>E>B) is detected, there will be an output of 01 there aswell even though that is not a valid sequence. Likewise with 11010(A>B>C>D>F>A), there will be an output of 10 even though its not a valid sequence. I am quite confused as to how to fix this?