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

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, then output, then transition to another state?
  • Or do I receive inputs first, then transition to another state, then output?

Mealy state diagram


1 Answer 1


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.