What is the difference between Mealy & Moore type of finite state machines?
This is perhaps best illustrated with an example and an anecdote.
I hate airports, and getting to them, but I love being on the plane. There are three distinct states that I have to enter into before getting on the plane:
In a Mealy machine, the preceding state from which you come from makes a difference - how you get somewhere is very important. In a Moore machine, how you get to a state makes no difference.
Let's add in an outcome to the above to create a Moore representation of a state machine:
With a Moore representation the outcome is attached directly to the state. With a Mealy representation - the particular outcome/output depends on where you have come from. For example, if I can get to the plane without having to catch a taxi and wait in the lounge, then I would be happy. Inputs make a difference. The where you come from is important. A Mealy representation state machine allows for this to be shown in the diagram. In other words, the output/outcome is shown OUTSIDE the state, during the transition.