laboratorio 6 maquina de estados
implementacion de una maquina de estados por medio de codigo vhdl aplicacion de un banda transportadora para la deteccion de cajas segun su tamaño
diseño de la maquina
codigo en vhdl
entity maquina is
Port ( a : in STD_LOGIC;
clk, reset : in std_logic;
y : out STD_LOGIC_vector (2 downto 0));
end maquina;
architecture Behavioral of maquina is
type state is (idle, s1,s2);
signal nextstate, currentstate: state;
begin
siguiente : process (a, currentstate)
begin
case currentstate is
when idle =>
nextstate <= s1;
when s1 =>
if a = '1' then
nextstate <= s2;
else
nextstate <= s1;
end if;
when s2 =>
nextstate <= idle;
end case;
end process;
Port ( a : in STD_LOGIC;
clk, reset : in std_logic;
y : out STD_LOGIC_vector (2 downto 0));
end maquina;
architecture Behavioral of maquina is
type state is (idle, s1,s2);
signal nextstate, currentstate: state;
begin
siguiente : process (a, currentstate)
begin
case currentstate is
when idle =>
nextstate <= s1;
when s1 =>
if a = '1' then
nextstate <= s2;
else
nextstate <= s1;
end if;
when s2 =>
nextstate <= idle;
end case;
end process;
implementacion en clase
No hay comentarios:
Publicar un comentario