# Mealy vs Moore Design

Hi all

2. ## mealy vs moore machine

The advantage of the Moore model is a simplification of the behaviour. The use of a Mealy FSM leads often to a reduction of the number of states.

Moore model is very easy to code. The program of Mealy is complex.

1 members found this post helpful.

•

3. ## difference between mealy and moore

So if I can make state table of Both Designs mealy would always be my first choice. right?

4. ## difference between mealy and moore machine

See Mealy is faster than moore. Mealy Next state output is the function of state and input but the Moore next state is a function of previous state only

vipul

5. ## mealy sequence detector

Originally Posted by vipulsinha
See Mealy is faster than moore. Mealy Next state output is the function of state and input but the Moore next state is a function of previous state only

vipul
But why should it make mealy faster?
Also I think moore has an advantage that it will not give false output in between clocks due to transition in inputs

6. ## difference between moore and mealy

Hi guys!
Please go through any text book covering both machines.
thing is....
Whether it is mealy or moore,next state depends on both input a well as present state.
only the difference is Output where u will take. ...in mealy,output depends on present input as well as state.
but,in moore output is function of state only.Got it...?
mealy will be faster.In the sense that,output will change as soon as the input transition accoding to the logic.
In moore,it has to wait for one clock cycle since it changes with the state.
Better...u try out one example like sequence detector with both kinds of machines.
Mealy is fast but it is asynchronous...right...?since the output changes as soon as the inputs change according to the logic.
so what is the problem...?
problem is glitches....for any asynchronously behaving circuit will have glitches.
And the most important disadvantage of Mealy is that It may lead to Metastability.
Ok Guys!
one more thing....people will prefer moore as it is synchronous.
one more thing is that...u can convert mealy machine into moore by just taking the registered output....right...?
generally,Moore will hae more no of states compared to mealy.
u will come to know by solving a simple problem right from drwaing state machine to state diagrams to hard ware implementation to wveforms.okkkk....
bye...

9 members found this post helpful.

7. ## moore vs mealy

Balu everything u said makes sense to me except

Originally Posted by balu304
mealy will be faster.In the sense that,output will change as soon as the input transition accoding to the logic.
In moore,it has to wait for one clock cycle since it changes with the state.
b/c output depends on states as well not only the inputs so I don't think that mealy will be faster

8. ## difference between mealy moore machine

this is very good explanation given by balu 304 ...i think it is enough

9. ## convert mealy machine to moore machine

This following explanation is for tronix...
As I previously said,u should have tried on ur own by solving a simple sequence detector.it's ok...
now we take a sequence detector which whas to detect bit sequence of 101... ok...
Let me say.....
already it has reached a state which recognised bit stream of 10 and output is low(logic zero).now we will see for both machines what is going to happen.ok..
now, In mealy machine,as soon as the input bit is one..the output will become logic high.It need not go into another state.
Now let us see for Moore machine...
It is in the state which recognised the bit equence of 10 and state output is low.
now,If the incoming input bit is one it will go to another state upon the clock tick where we will take output which depends on the present state.
so we say that the new state is the one which detected the sequence of 101 and it's output is logic high.
so mealy is asynchronous where as moore is synchronous.
It is very difficult to tell like this.
I am not good at giving explainations through writing.
it is better..pls try out a simple circuit.
ok...bye...

in the above said example,mealy will take one state lesser than moore. In general, atleast one state is lesser in mealy compared to moore. state is nothing but the flipflops condition(state of logic loww or high).And state transition i.e. one state to another state happens with the clock edge.so mealy is faster as it contains less no of states.....right....?

3 members found this post helpful.

10. ## conversion of moore machine to mealy machine

Balu
Got d point. Absolutely correct , Mealy will be faster than Moore at least by setup time of f/fs. Right?

•

11. ## mealy vs. moore

any good book for learning state machines and vhdl code for state machines

12. ## converting mealy machine to moore machine

There is no point making such a fuss about the meally/moore distinction. You can view a mealy machine as moore + some logic, you can view moore machine as mealy + flops. This is an academic distinction and in general something you will pretty much never pay any attention to during logic design. As for speed, again, it is impossible to tell which one is 'faster' just by that distinction (mealy vs. moore). The remark about glitches is also not true, if the FSM is a part of a larger synchronous design there is no danger from glitches. In case the FSM outputs are going to another clock domain, glitches are still a very real problem even if you use a moore machine (still you have >1 flip flop driving a logic cone and thus glitches). Bottom line: you pick what is right for the design (and mostly never even think about mealy vs. moore distinction). All of the above generalized statements about one vs. other are false, with the exception of mealy usually leading to smaller number of states.

4 members found this post helpful.

13. ## moore sequence detector

While designing, what i keep in mind is final waveforms...not bothering whether i'll use mealy or moore...

in my design im using both mealy n moore, state machine is combination of both..

14. ## mealy to moore conversion

just two cents, mealy is more power-efficient than moore because of fewer flops. In power-critical designs, try to reduce the number of flops is a good idea.

15. ## moore output

Originally Posted by balu304
Hi guys!
Please go through any text book covering both machines.
thing is....
Whether it is mealy or moore,next state depends on both input a well as present state.
only the difference is Output where u will take. ...in mealy,output depends on present input as well as state.
but,in moore output is function of state only.Got it...?
mealy will be faster.In the sense that,output will change as soon as the input transition accoding to the logic.
In moore,it has to wait for one clock cycle since it changes with the state.
Better...u try out one example like sequence detector with both kinds of machines.
Mealy is fast but it is asynchronous...right...?since the output changes as soon as the inputs change according to the logic.
so what is the problem...?
problem is glitches....for any asynchronously behaving circuit will have glitches.
And the most important disadvantage of Mealy is that It may lead to Metastability.
Ok Guys!
one more thing....people will prefer moore as it is synchronous.
one more thing is that...u can convert mealy machine into moore by just taking the registered output....right...?
generally,Moore will hae more no of states compared to mealy.
u will come to know by solving a simple problem right from drwaing state machine to state diagrams to hard ware implementation to wveforms.okkkk....
bye...

thanks

16. ## how to convert mealy machine to moore machine

One is without cycle delay and makes timing path longer. Another is with a cycle delay and makes timing better.

17. ## Re: Mealy vs Moore Design

Hi,

One last thing...from an STA perspective:

Moore machines register the inputs and drive the outputs (possibly through some combinatorial logic).

Mealy machines allow inputs to propagate combinatorially from inputs to the outputs. These particular paths could become critical paths because of their non-local creation or logic depth.

Moore machines can therefore give you a bit more control over your critical paths.

1 members found this post helpful.

18. ## Re: Mealy vs Moore Design

both are useful depending on what kind of problems you are solving. Mealy happens to depend on current state and input while moore only depends on state.

19. ## Re: Mealy vs Moore Design

I would like to contradict balu here. Please refer the attached document for details. It states Moore (and not Mealy) suffers from glitches because of Clock to Q and combinational logic delays. Mealy, as expected, suffers from metastability.

HTH.

20. ## Re: Mealy vs Moore Design

Hi
@socware - the 'Digital Principles and Design ' by Donald d. Givone is very good for a detailed explanation of Moore and Mealy .It also has an worked example with serial adder.
other than that Digital logic by Tocci is also good

---------- Post added at 04:31 ---------- Previous post was at 04:28 ----------

@ soc
Hi the book principles of modern digital design by Parag.k.lala is good for learning VHDL as well as digital logic

•

--[[ ]]--