What Is Mealy Machine?
In the theory of computation, a Mealy machine is a finite-state machine whose output values are determined both by its current state and the current inputs.
Mealy machine can be described by a 6 tuple (Q, δ, Ʃ, O, X, q_{0 }) where:
- Q is a finite set of states.
- Ʃ is a finite set of symbols referred to as the input alphabets.
- δ is the input transition function where δ:Q x Ʃ ―>Q
- O is a finite set of symbols referred to as output alphabet.
- X is the output transition function where X:Q x Ʃ―>O
- q_{0 }is the initial state from where any input is processed (q_{0 }ϵQ)
What You Need To Know About Mealy Machine
- Mealy machine changes its output based on its current input and present state.
- Mealy machine will have same or fewer states than Moore machine.
- Output is placed on transition.
- The value of the output function is a function of the transitions and the changes, when the input logic on the present state is done.
- Mealy machines react faster to inputs. They generally react in the same clock cycle.
- Asynchronous output generation through the state changes synchronous to the clock.
- Generally requires fewer states for synthesis.
- Requires less hardware to design.
- A counter is not a Mealy machine.
- Not necessarily easy to design.
What Is Moore Machine?
In the theory of computation, a Moore machine is a finite-state machine whose output values are determined only by its current state. A Moore machine can be described as by a 6 tuple (Q, δ, Ʃ, O, X, q_{0 }) where:
- Q is a finite set of states.
- Ʃ is a finite set of symbols referred to as the input alphabets.
- δ is the input transition function where δ:Q x Ʃ ―>Q
- O is a finite set of symbols referred to as output alphabet.
- X is the output transition function where X:Q x Ʃ―>O
- q_{0 }is the initial state from where any input is processed (q_{0 }ϵQ)
What You Need To Know About Moore Machine
- Output of Moore machine only depends on its current state and not on the current input.
- Generally, it has more states than Mealy machine.
- Output is placed on transition.
- The value of the output function is a function of the current state and the changes at the clock edges, whenever state changes occur.
- In Moore machines, more logic is required to decode the output resulting in more circuit delays. They generally react one clock cycle later.
- Both output and state change synchronous to the clock edge.
- Generally requires more states for synthesis.
- More hardware is required to design.
- A counter is a Moore machine.
- Easy to design.
Difference Between Mealy And Moore Machine In Tabular Form
BASIS OF COMPARISON | MEALY MACHINE | MOORE MACHINE |
Description | Mealy machine changes its output based on its current input and present state. | Output of Moore machine only depends on its current state and not on the current input. |
States | Mealy machine will have same or fewer states than Moore machine. | It has more states than Mealy machine. |
Output | Output is placed on transition. | Output is placed on transition. |
Value Of Output Function | The value of the output function is a function of the transitions and the changes, when the input logic on the present state is done. | The value of the output function is a function of the current state and the changes at the clock edges, whenever state changes occur. |
Reaction To Inputs | Mealy machines react faster to inputs. They generally react in the same clock cycle. | More logic is required to decode the output resulting in more circuit delays. They generally react one clock cycle later. |
Output And State | Asynchronous output generation through the state changes synchronous to the clock. | Both output and state change synchronous to the clock edge. |
States Requirement | Generally requires fewer states for synthesis. | Generally requires more states for synthesis. |
Hardware Requirement | Requires less hardware to design. | More hardware is required to design. |
Counter | A counter is not a Mealy machine. | A counter is a Moore machine. |
Design | Not necessarily easy to design. | Easy to design. |