Introduction
When we talk about the Mealy and Moore machine, then the first thing that we should know is about finite state machines. Machines with a limited number of states are known as finite state machines(FSM), and these machines are sequential circuits with a limited number of ways in which their history might affect their future behavior. And, they are used because there is no machine with an infinite storage capacity. In this blog, we will learn about the Difference Between Mealy and Moore Machine.
Also see, Turing Machine in TOC.
What is Mealy Machine?
It is a finite state machine whose current output is determined by its current state, and the existing external input and output symbol is linked to the transition state and Input of a finite state machine.
The mealy machine can be symbolized as (Q, ∑, O, δ, X, q0) where −
- Q is a finite set of states.
- ∑ It is a finite set of symbols known as the input alphabet.
- O is a finite set of symbols known as the output alphabet.
- δ is the input transition function (δ: Q × ∑ → Q)
- X is the output transition function (X: Q × ∑ → O)
- q0 is the initial state; any input is processed from this state(q0 ∈ Q).
Also See, Moore Machine
We can design a Mealy machine that generates 2's complement of a binary number.
The state diagram of the Mealy Machine is −
The state table of a Mealy Machine is shown below −
states(Q) | State | Input | Output | State | Output |
---|---|---|---|---|---|
A | A | 0 | 0 | B | 1 |
B | B | 1 | 1 | B | 0 |
Here, the finite set of states(Q) is {A, B}. And, input alphabets are Ʃ = (0,1) and output alphabets are ∆ = (0,1). Also, Input is 1100, read input is 0011, and output is 0100. Input taking and output giving processes are done from right to left.
Also Read - Simplification of CFG
Characteristics of a Mealy Machine
The characteristics of a Mealy machine are mentioned below:
- Output Dependency: Outputs depend on both the current state and inputs.
- Output Timing: Outputs can change immediately upon a state transition and input change.
- Output Function: Output function is defined by a state transition table that specifies outputs for each state and input combination.
- Number of Outputs: Each state-input combination can have a unique output.
- Behavior: More responsive to input changes as outputs can change with every input transition.
- State Transitions: State transitions are triggered by input changes.
- Complexity: Potentially more complex than Moore machines due to the immediate dependency on input changes.
- Applications: Well-suited for systems where output changes are closely tied to specific input conditions.