Mealy machine has 6 tuples: (Q, q0, ∑, O, δ, λ’)
- Q : Finite set of states
- In diagram below Q = {A,B,C,D}
- q0 : Initial state/ Starting state
- In diagram below A is initial state
- ∑ : Input alphabet
- In diagram below input alphabets are {0,1}
- O : Output alphabet
- In diagram below output alphabets are {0,1}
- δ is transition function which maps Q×∑ → Q
- ‘λ’ is the output function which maps Q×∑→ O
![](https://i0.wp.com/1.bp.blogspot.com/-vgMbVQEjTvs/X0olV5APu3I/AAAAAAAAGLg/oBy5JfaEK_QneBwYgPJZ4-_BFVmXru2QwCLcBGAsYHQ/w328-h230/cbcad677-3ee2-4575-9b1a-4639a340a434.jpeg?w=780&ssl=1)
Moore machine has 6 tuples: (Q, q0, ∑, O, δ, λ’)
- Q : Finite set of states
- In diagram below Q = {A,B,C,D}
- q0 : Initial state/ Starting state
- In diagram below A is initial state
- ∑ : Input alphabet
- In diagram below input alphabets are {0,1}
- O : Output alphabet
- In diagram below output alphabets are {0,1}
- δ is transition function which maps Q×∑ → Q
- ‘λ’ is the output function which maps Q → O
![](https://i0.wp.com/1.bp.blogspot.com/-mbjHNhDTmH8/X0omTH14iJI/AAAAAAAAGLs/Qx3KvUC8B0goIkeIZy8S-9A_dUlEdBFYACLcBGAsYHQ/w328-h258/f444f036-cf40-4c73-bb2c-be4b0a7b8e41.jpeg?w=780&ssl=1)
Mealy machine vs Moore machine
Mealy machine | Moore machine |
Output depends on present state as well as present input. | Output depends on the present state. |
If input changes, output also changes | If input changes, output does not changes. |
Compare to Moore less number of states are required. Because states do not depends on output. | Compare to Mealy more number of states are required. Because states depends on number of output. |
Difficult to develop. Difficulty due to input affects output. | Easy to develop. |
Output is placed on transition arrow. | Output is placed with state. |
Reference:
- Introduction to the Theory of Computation” by Michael Sipser.