# Moore and mealy machine equivalence

I have come up with a problem which wants to convert a Mealy machine to a Moore machine. I searched the web and found out how to convert a Mealy machine to Moore machine and vice versa, but I have other questions which I couldn't find them on the web:

• What is the meaning of equivalence between Moore and Mealy machine? As you know The output of Mealy machine depends on the inputs when the input changes the output changes but Moore machine is not.

• Why the conversion from Mealy to Moore is in the way described in this link?

• 1) Equivalence meaning that any machine of type A can be converted to machine type B and vice-versa. 2) There is a formal proof. For example here: lms.uop.edu.jo/lms/pluginfile.php/35159/mod_resource/content/0/… Dec 18, 2018 at 18:21
• I know what is the equivalence meaning but I don't know the definite meaning in this field
– user205457
Dec 18, 2018 at 18:23
• There is a formal definition in the very same paper. Dec 18, 2018 at 18:24

## 3 Answers

Here is another way to look at it. Ref https://courses.cs.washington.edu/courses/cse370/98wi/admin/Slides/registers/sld037.htm s37 of 49

# Moore versus Mealy Machines (with proper synchronisation)

• Moore machine outputs are a function of the state.
• Mealy machine outputs are a function of the state and inputs.

A common flaw with these machines is that the outputs are neither synchronised to the change of state nor the clock edge due to the vagaries of the combinational output logic which can create glitches due to propagation delays, races and hazards. Worse, a combinational feedback loop can be created if the outputs of a Mealy machine are connected to the inputs of a second Mealy machine whose outputs are connected to the inputs of the first Mealy machine.

By rearranging the machines, the outputs can be properly synchronised to both the change of state and the clock edge, Figures 1 and 2.

I've created a State Machine Wizard to implement a properly synchronised Moore machine.

Figure 1 ‐ Moore machine with outputs synchronised to state and clock.

Figure 2 – Mealy machine with outputs synchronised to state and clock.

The only difference between the two diagrams above is that for the Mealy machine there is a direct path from the input to the output logic, a path which isn't present in the Moore machine.