Introduction to Automata

# Difference Between Mealy and Moore Machine

Both Mealy and Moore Machines accept the regular languages and provide the output. Before proceeding to the key difference between Mealy and Moore Machine, Let’s look at an example of the Mealy and Moore machines which helps us to understand all the key differences in the Mealy and Mealy machine

Moore Machine Example: The following is a Moore Machine which gives the first compliment of binary digit.

Mealy Machine Example:  The following is a Mealy Machine which gives the first compliment of binary digit.

## Key Difference Between Mealy and Moore Machine

Let’s explain all the major key differences between Mealy and Moore’s machine according to the above given diagram. A detailed description is given below

 Key Point Mealy Machine Moore Machine State Diagram Labels Transitions are labeled with both input and output. Transitions are labeled with input only and output is associated with states. Input and Output String Length If the length of the input string is “N”, then the length of the output string is also “N” If the length of the input string is “N”, then the length of the output string is “N+1”. Output Function ‘λ’ is the output function which maps Q×∑→ O. Where Q is state, and O is output. λ is the output function which maps Q → O. Where Q is state, and O is output. Output Dependency Output in Mealy Machine is placed in each transition. That’s why it depends on the present state as well as the present input. So, If input changes, output also changes because output depends on State and input. Output in Moore Machine is placed within each state. That’s why it depends only on the current state. So, If input changes, output does not change because output depends on only State. Output States after conversions The number of states can increase after conversion from Mealy to Moore machine. After conversion from Moore to Mealy machine, state numbers always decrease. Output synchronization Output is not synchronized with the clock. Mealy Machines react faster to inputs. Output is synchronized with the clock. Moore Machines react slower to inputs (1 clock cycle later). Responsiveness: More responsive to inputs since the output can change as soon as the input does. Less immediate response; outputs change only when the state changes. Number of States for Equivalent Functionality: Often requires fewer states than Moore to achieve the same function. May require more states to represent different outputs for the same set of inputs. Machine Designing It is more complex to design due to the direct input-output relationship. It is less complex in design because outputs are fixed per state.