A state transition diagram has to be drawn for the following scenario. (Later it has to be implemented using D flipflops)
Scenario:-
A sequential machine to resolve a 4-bit security code. The code is "1010" and it is sent to the resolving circuitry as a sequence of bits. The output of the detector should be raised to 1 if and only if the correct code is detected.
It says the code is sent as a sequence of bits and I tried to come up with the state transition diagram as below.
Is it correct? Or is there something missing?
-
\$\begingroup\$ It's missing an accept indicator and the fact that the code must be 4 bits long. \$\endgroup\$Ignacio Vazquez-Abrams– Ignacio Vazquez-Abrams2015年08月18日 13:46:20 +00:00Commented Aug 18, 2015 at 13:46
-
\$\begingroup\$ @IgnacioVazquez-Abrams How to check for the length of the code? \$\endgroup\$S.Dan– S.Dan2015年08月18日 13:59:12 +00:00Commented Aug 18, 2015 at 13:59
1 Answer 1
For an input 1
the output will be 1
. As for any code ending with 1
. So it is incorrect. As a general rule - for detection of a sequence with length N
you need N states for Moore machine or N-1
for Mealy machine (your case).