i saw this diagram in my textbook for the problem :
Suppose we wish to design a circuit that detects a sequence of three or more consecutive 1’s in a string of bits coming through an input line (i.e., the input is a serial bit stream)
this is the diagram the book suggests .
si means we have read i consecutive 1's from the input (s3 means 3 or more consecutive 1's) and s0 is the start state.
my problem is when we are in state s2 and we read a 1 in input the output is still 0 while it should change to 1.
and also when we are in state s3 and we read a 0 the output is still 1 while it should change to 0.
my mealy implementation (excluding some arcs) is
here we do not have the above problems .
i know the first one is a Moore implementation while the second one is a Mealy implementation .
BUT shouldn't they do the same thing .