# Difference between Mealy machine and Moore machine

Last Updated : 29 Jan, 2024

Mealy Machine is defined as a machine in the theory of computation whose output values are determined by both its current state and current inputs. In this machine at most one transition is possible.Â
It has 6 tuples: (Q, q0, âˆ‘, â–², Î´, Î»â€™)Â

1. Q is a finite set of statesÂ
2. q0 is the initial stateÂ
3. âˆ‘ is the input alphabetÂ
4. â–² is the output alphabetÂ
5. Î´ is the transition function that maps QÃ—âˆ‘ â†’ QÂ
6. â€˜Î»â€™ is the output function that maps QÃ—âˆ‘â†’ â–²Â

Prerequisite – Mealy and Moore MachinesÂ

The diagram is as follows:

### Moore Machine:

Moore’s machine is defined as a machine in the theory of computation whose output values are determined only by its current state. It has also 6 tuples

`(Q, q0, âˆ‘, â–², Î´, Î»)Â `
1. Q is a finite set of statesÂ
2. q0 is the initial stateÂ
3. âˆ‘ is the input alphabetÂ
4. â–² is the output alphabetÂ
5. Î´ is the transition function that maps QÃ—âˆ‘ â†’ QÂ
6. Î» is the output function that maps Q â†’ â–²Â

Diagram:

The difference between the Mealy machine and Moore machine is as follows:

 Moore Machine Mealy MachineÂ Output depends only upon the present state.Â Output depends on the present state as well as present input.Â Moore machine also places its output on the transition. Mealy Machine places its output on the transition. More states are required.Â Less number of states are required.Â Â There is less hardware requirement for circuit implementation.Â There is more hardware requirement for circuit implementation.Â Â They react slower to inputs(One clock cycle later).Â They react faster to inputs.Â Â Synchronous output and state generation.Â Asynchronous output generation.Â Â Output is placed on states.Â Output is placed on transitions.Â Â Easy to design.Â It is difficult to design.Â If input changes, output does not change If input changes, output also changes. Has more or the same states as that of the Mealy machine. Has fewer or the same states as that of the Moore machine.

Previous
Next