0
\$\begingroup\$

I'm currently learning about mealy machines and I'm slightly confused.

If I am at state 00 and transition to state 01 indicated by the arrow. On the weighting on the arrow, the top refers to an input and the bottom refers to outputs.

  • What is the ordering of inputs, state transition and outputs?
  • Do I receive the input first, output then transition to another state?
  • Or do I receive inputs first, transition to another state then output?

Mealy state diagram

\$\endgroup\$
0
\$\begingroup\$

The order is not important.

You start with in input string. Let's say 00010000. Assume you already handled the first four digits of the input string getting you to state 00. Than the next input character is 0.

Being in state 00, there is an output arrow with 0 as 'input string'; which means WHEN you are in state 00 and the next to process character of the input string is a 0, than follow the arrow, and add the output to the output string. So to the output string the following will be appended: 0010,0

Now just continue parsing the entire input string, follow the arrows and concatenate all output strings together.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy