My task is to design a FSM whose output goes high for a single cycle whenever the pattern 0110 is detected on its input. The patterns may overlap, so an input 0110110 of would cause the output to go high twice- once for the first pattern (0110110), and once for the second pattern (0110110). a is used for the input and f is used for the output.
I am assuming I will need five state bubbles like this.
Is this correct or am I missing some cases based on the pattern going high twice if the pattern overlaps?