Introduction to Automata

# Moore to Mealy Conversion Solved Examples

Each Moore Machine is easily converted into its corresponding Mealy Machine. The equivalence of the Moore and Mealy machines means that both machines produce the same output for the same input.

As we know, in the Moore machine, the output is attached to every state symbol, and in the Mealy machine, the output is attached to the input symbol.

## Method To Convert Moore to Mealy Machine

Find the output symbol of each transition from each state. Simply place the output symbol along with the input over the arrow.

The above procedure starts from an initial state and repeats till the end. Simple Moore to Mealy Machine examples are given below.

## Example 01- Moore to Mealy Conversion

Consider the following Moore Machine

Let’s convert the above Moore Machine into the corresponding Mealy Machine.

At q0 for input “0”, the transition also goes to the state q0, which gives output “a”. So for Mealy Machine, Just label output (a) with input (1) over the arrow as given below.

At q0 for input “1”, the transition also goes to the state q0, which gives output “a”. So for Mealy Machine, Just label output (a) with input (1) over the arrow as given below.

Hence, the above diagram converts the Moore Machine into the corresponding Mealy Machine.

## Example 02- Moore to Mealy Conversion

Consider the following Moore Machine

### Solution

At q0 for input “0”, the transition also goes to the state q0, which gives output “a”. So for Mealy Machine, Just label output with input over arrow as given below.

At q0 for input “1”, the transition also goes to the state q1, which gives output “b.” So for Mealy Machine, Just label output (b) with input (1) over the arrow as given below.

Now Move to q1 to discuss both inputs “0” and “1”.

The new state, At q1 for input “0”, the transition also goes to the state q1, which gives output “b.” So for Mealy Machine, Just label output (b) with input (1) over the arrow as given below.

At q1 for input “1”, the transition goes to the state q0, which gives output “a.” So for Mealy Machine, Just label output (b) with input (0) over the arrow as given below.

Hence in above diagram, the given Moore Machine is converted into corresponding Mealy Machine.

## Example 03- Moore to Mealy Conversion

Convert the following Moore machine into its equivalent Mealy machine.

### Solution

After applying the conversion rules, which we see in the above examples, the result in the Mealy Machine is given below.

### Important

Number of states

After conversion from Moore to the Mealy Machine, The states of the Mealy Machine are always less than or equal to the Moore Machine.

Transition Table

As discussed earlier in the Moore and Mealy Machine lectures, transition tables can also be obtained from corresponding Moore or Mealy diagrams.