Professional Documents
Culture Documents
entity LAV_AUT is
Port ( clk : in STD_LOGIC;
rst : in STD_LOGIC;
c : in STD_LOGIC;
l : in STD_LOGIC;
w : in STD_LOGIC;
estados_bits : out STD_LOGIC_VECTOR ( 4 downto 0) );
end LAV_AUT;
-- DEFINIENDO VARIABLES
begin
process(clk,rst)
variable T: integer range 0 to 50000000;
begin
if rst='1' then
clk_1Hz_s<='1';
elsif (rising_edge (clk))then
T := T+1;
if( T <=1 ) then
clk_1Hz_s<='1';
elsif( T<50000000 ) then
clk_1Hz_s<='0';
else
T:=0;
end if;
end if;
end process;
process(clk_1Hz_s,rst)
begin
if rst='1' then
ep <= inicio;
elsif (rising_edge (clk_1Hz_s) and c='1' and l='1') then
case ep is
when inicio=>
ep <=llenado;
when llenado=>
t <=t+1;
if t=5 then
ep<=lavado1;
t <=0;
else
ep<=llenado;
end if;
t <=t+1;
if t=5 AND w='1' then
ep<=lavado2;
t <=0;
elsif t=5 and w='0' then
ep<=centrifugado;
t<=0;
else
ep<=lavado1;
end if;
when others=>
ep<= inicio;
end case;
end if;
end process;
end case ;
end process;
end Behavioral;
end process;