# Mealy to Moore Conversion

In the Mealy machine, the output is delivered along the edge with the input symbol, but in the Moore machine, the output is connected to every state. State output symbols are distributed to input symbol routes to transform the Moore machine into a Mealy machine. However, in order to transform the Mealy machine into a Moore machine, we must first build a separate state for each new output symbol and disperse the incoming and outgoing edges.

**Example:**

The states q2 and q3 have both outputs 0 and 1. So we will create two states for these states. For q2, two states will be q20 and q21. Similarly, for q3 two states will be q30 and q31.

In Following example, we will demonstrate the process of converting a Mealy machine to an equivalent Moore machine. The conversion involves transforming the outputs from being associated with transitions to being associated with states in the resulting Moore machine. Let’s consider a Mealy machine and go through the step-by-step conversion process.

### Analyzing the Mealy Machine

Let’s begin by understanding the given Mealy machine. Here is the state transition table for the Mealy machine:

State | Input (X) | Next State | Output (Y) |
---|---|---|---|

A | 0 | B | 1 |

A | 1 | C | 0 |

B | 0 | C | 0 |

B | 1 | B | 1 |

C | 0 | A | 1 |

C | 1 | C | 0 |

### Identifying States and Outputs for the Moore Machine

To convert this Mealy machine to a Moore machine, we need to determine the states and outputs for the resulting Moore machine. We can start by listing the states from the Mealy machine, which are A, B, and C.

Next, let’s associate the outputs with states. For each state, we need to find the output that corresponds to all inputs.

For State A, the outputs associated with inputs 0 and 1 are 1 and 0, respectively. Since they are different, we assign a new output symbol to this state. Let’s call it Y1.

For State B, both inputs 0 and 1 have the same output, which is 1. Hence, we assign Y1 to this state as well.

For State C, the outputs associated with inputs 0 and 1 are 1 and 0, respectively. Similar to State A, we assign a new output symbol to this state. Let’s call it Y2.

Therefore, the outputs for the Moore machine are as follows:

State | Output |
---|---|

A | Y1 |

B | Y1 |

C | Y2 |

### Constructing the State Transition Table for the Moore Machine

Now, we need to construct the state transition table for the Moore machine using the states and outputs determined in the previous step. Since the outputs are associated with states rather than transitions, we only need to focus on state transitions.

State | Input (X) | Next State |
---|---|---|

A | 0 | B |

A | 1 | C |

B | 0 | C |

B | 1 | B |

C | 0 | A |

C | 1 | C |

### Step 4: Incorporating Outputs in the Moore Machine

Finally, we integrate the outputs into the Moore machine. For each state, we associate the corresponding output symbol.

State | Input (X) | Next State | Output |
---|---|---|---|

A | 0 | B | Y1 |

A | 1 | C | Y2 |

B | 0 | C | Y2 |

B | 1 | B | Y1 |

C | 0 | A | Y1 |

C | 1 | C | Y2 |

### Conclusion

Through the step-by-step conversion process, we successfully transformed the given Mealy machine into an equivalent Moore machine. The resulting Moore machine has the same behavior and recognizes the same language as the original Mealy machine, but with outputs associated with states rather than transitions.

Remember that the conversion process may vary depending on the specific Mealy machine, but the general idea remains the same.