jny
Newbie level 3
- Joined
- May 9, 2014
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 33
If you use "single process/always which is synchronous" to develop your FSM, mealy is preferrable to reduce number of states and latency.
for example: (VHDL)
MOORE:
--------
MEALY:
-------
If you write like this both moore & mealy are synchronous.
I prefer mealy.
correct me if i'm wrong...
for example: (VHDL)
MOORE:
--------
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 process(clk)begin if(clk'event and clk = '1')then case my_state is when "00" => if( a = '0')then my_state <= "01"; end if; y <= "000"; when "01" => if(a = '1')then my_state <= "10"; end if; y <= "001"; when "10" => if(a = '0')then my_state <= "11"; end if; y <= "010"; when "11" => if(a = '1')then my_state <= "00"; end if; y <= "100"; end case; end if; end process;
MEALY:
-------
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 process(clk)begin if(clk'event and clk = '1')then case my_state is when "00" => if( a = '0')then my_state <= "01"; y <= "001"; end if; when "01" => if(a = '1')then my_state <= "10"; y <= "010"; end if; when "10" => if(a = '0')then my_state <= "11"; y <= "100"; end if; when "11" => if(a = '1')then my_state <= "00"; y <= "000"; end if; end case; end if; end process;
If you write like this both moore & mealy are synchronous.
I prefer mealy.
correct me if i'm wrong...
Last edited by a moderator: