Mealy Vs. Moore Machine

Design of sequential circuit can be composed of designing combinational circuit and state register. Sequential circuits are implemented in two different ways:

  1. Mealy Machine
  2. Moore Machine

We can represent a sequential machine as M = <I,O,S,f,g>; where

I: Input set
O: Output set
S: State space
f: A function mapping IxS => O
g: A function mapping IxS => S

Let’s understand both type of sequential machines and compare them.

Mealy Machine

In case of Mealy machine, output is a function of not only the present inputs but also past inputs. In other words we can say; in case of Mealy, both output and the next state depends on the present input and the present state.

Mealy Machine

Mealy Machine: (a) Block Diagram, (b) State Transition Diagram

PS: Present State
NS: Next State [NS becomes PS after every sensitive edge of clock pulse]
CLK: Clock Signal

f: IxS => O

So, output function:

o(t) = f(i(t),s(t))

       = f(i(t),PS(t))

Similarly

g: IxS => S

So, Next state function:

s(t+1) = g(i(t),s(t))

NS(t)  = g(i(t),PS(t))

Moore Machine

In case of Moore machine, present output is not a function of present inputs but is a function of past inputs. The next state is a function of both the present input and the present state.

In this case the output is not associated with the transition but are associated with the state unlike the Mealy machine. This is because the output “O” is a function of present state (PS) and independent of present input “I”.

Of-course present input I influences the next state (NS) and that’s how it is going to influence the output but there is a time lag between the input and output. The present inputs are going to influence the outputs that are going to come after the next clock.

Moore Machine

Moore Machine: (a) Block Diagram, (b) State Transition Diagram

f: S => O

So, output function:

o(t) = f(s(t))

       = f(PS(t))

Similarly

g: IxS => S

So, Next state function:

s(t+1) = g(i(t),s(t))

NS(t)  = g(i(t),PS(t))


 

Click here to learn how to transform a Mealy machine to a Moore machine and vice versa.


 

Mealy Vs. Moore: A Comparison

Mealy Machine Moore Machine
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
From presentation point of view, output is placed on transition  Output is placed on state
Mealy will be faster, in the sense that output will change as soon as an input transition occurs Moore machine may be safer to use, because they change states on the clock edge
Asynchronous output generation though the state changes synchronous to the clock Both output and state change synchronous to the clock edge
Faster Predictable
Generally needs less states for synthesis. So less hardware required to design. Less states doesn’t always mean simpler to implement In general needs more states for synthesis. Advantage of Moore model is simplification of behavior and easy to design

6 comments for “Mealy Vs. Moore Machine

Leave a Reply

Your email address will not be published. Required fields are marked *