You are on page 1of 4

MAQUINA DE MOORE DE CINCO ESTADOS

ESTADOS
ACTUAL
E0
000
E1

001

E2

010

E3

011

E4

100

Ent
1
0
1
0
1
0
1
0
1
0

ESTADO
SIGUIENTE
001/0
100/0
010/0
100/0
011/1
100/0
011/0
011/0
010/0
100/0

use IEEE.std_logic_arith.all;
use IEEE.std_logic_signed.all;
use IEEE.std_logic_unsigned.all;

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity detector111 is
Port ( clk : in STD_LOGIC;
reset : in STD_LOGIC;
Entrada : in STD_LOGIC;
y : out STD_LOGIC);
end detector111;

architecture M_moore of detector111 is

type TiposEstado is
(E0,E1,E2,E3,E4);
signal EstadoA, EstadoS: TiposEstado;

begin
-- registros de estados

Process (clk, reset)


Begin
If reset='1' then
EstadoS <=E0;
Elsif(clk'event and clk='1') then
EstadoA <=EstadoS;
end if;
end process;
-- estados siguientes
Process (EstadoA, EstadoS,Entrada)
Begin
Case EstadoA is
When E0 =>
If Entrada ='0' then
EstadoS <=E1;
else

EstadoS <=E4;
end if;
when E1 =>
If Entrada='1' then
EstadoS <=E2;
else
EstadoS <=E4;
end if;
When E2 =>
If Entrada='1' then
EstadoS <=E3;
else
EstadoS <=E4;
end if;
When E3 =>
If Entrada='1' then
EstadoS <=E3;
else
EstadoS <=E3;
End if;
When E4=>
If Entrada='1' then
EstadoS <=E1;
else
EstadoS <=E4;
end if;
when others =>
end case;
end process;
--- salida Moore
y <= '1' when EstadoA=E3
else

'0';
end M_moore ;

You might also like