Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

About the choice of FSM---Moore or Mealy

Status
Not open for further replies.

RemyMartin

Junior Member level 1
Junior Member level 1
Joined
May 12, 2003
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
133
It is well known that FSM goes into twos sorts: Moore and Mealy, I have some question about them:
1: Can one of them substitute the other?
2: Which one is better?
3: Mealy FSM can be descripted by two process, one is sequential, the other is combinational. The following is a sample program:
*************************************************************
module samplemealyFsm(clk,reset,Y,Z);
input clk,reset,Y;
output Z;
reg Z;
reg [1:0] CurrentState, NextState;
parameter ST0=2'b00,ST1=2'b01,ST2=2'b10,ST3=2'b11;
// the sequential process
always@(posedge clk or negedge reset)
if (!reset)
CurrentState=ST0;
else
CurrentState=NextState;
//the combinational process
always(CurrentState or Y)
begin
case(CurrentState)
ST0:
begin
NextState=ST1;
Z=decode(CurrentState,Y); // this means Z is the decode
//result of CurrentState and Y
end
ST1:
begin
NextState=ST2;
Z=decode(CurrentState,Y);
end
ST2:
begin
NextState=ST3;
Z=decode(CurrentState,Y);
end
ST3:
begin
NextState=ST0;
Z=decode(CurrentState,Y);
end
endcase
end
endmodule
*************************************************************
From the previous codes, we can get that the output of Mealy FSM Z changes asynchronously with clk; my 3rd question is "is this asynchronously change a good thing, since synchronous design is so popular."

Note: Moore FSM---The outputs depend only on the machine state, thus
synchronous design can be realized easily.
Mealy FSM---The ouputs depend on both the machine state and the
inputs to the machine, thus the outputs may change
asynchronously with the system clock.

Can somebody help me with those three questions? Thanks.
 

to question 1 & 2: Moore FSM and Mealy FSM have no different except their functionalities(whether or not the output is related to input), as described by their definition. In fact, you must care some points for both design.
to question 3: There are 3 points to remember when designing FSMs:
1. Reset signals be synchronous.
2. Synchronize the inputs and outputs to avoid glitchs generated by comb logic.
3. Avoid dead states.
 

What's more, you can also refer to your synthesis tools for more information on FSM design techniques. Most tools (i.e. Synplify Pro) provide FSM Compiler to help design safe FSMs.

Good luck!
 

kilone said:
to question 1 & 2: Moore FSM and Mealy FSM have no different except their functionalities(whether or not the output is related to input), as described by their definition. In fact, you must care some points for both design.
to question 3: There are 3 points to remember when designing FSMs:
1. Reset signals be synchronous.
2. Synchronize the inputs and outputs to avoid glitchs generated by comb logic.
3. Avoid dead states.
What do you mean by saying that "Synchronize the inputs??"
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top