Documentos de Académico
Documentos de Profesional
Documentos de Cultura
CHIMBORAZO
FACULTAD DE INFORMTICA Y ELECTRNICA
ESCUELA DE INGENIERA ELECTRNICA EN
TELECOMUNICACIONES Y REDES
VHDL
Cdigo VHDL mquina despachadora de
refrescos
Semestre: Noveno A
Nombre:
Riobamba Ecuador
VHDL
Pgina 1
CDIGO VHDL
Library IEEE;
Use IEEE.STD_LOGIC_ll64.ALL;
Use IEEE.STD_LOGIC_ARITH.ALL;
Use IEEE.STD_LOGIC_UNSIGNED.ALL;
Entity maquina is
Port ( CLK,MONEDA,MP,PRECIO,LC,LS : in STD LOGIC;
CAP,LIMPIA,SIRVE,CAMBIO,DEC : out STD LOGIC);
End maquina;
Pgina 1
CAMBIO<='0';
DEC <= '0';
if MP = '0' then
edo_fut <= D;
else
edo_fut <= A;
end if;
when D =>CAP <= '0';
LIMPIA <= '0';
DEC <= '0';
if PRECIO = '0' then
edo_fut <= H;
CAMBIO <='1';
else
edo_fut <= E;
SIRVE <= '1'
end if;
when E => LIMFIA <= '0';
CAMBIO <= '0';
DEC <= '0';
if LS='0' then
edo_fut <= E;
SIRVE <= '1';
else
edo_fut <= F;
CAP <= '1';
end if;
when F => LIMFIA < = '0' ;
SIRVE <= '0';
CAMBIO <= '0';
DEC <= '0';
edo_fut <= G;
CAF <= '1';
when G =>CAP<= '0' ;
SIRVE <= '0';
CAMBIO <= '0';
LIMPIA <= '1';
DEC <= '0';
edo_fut <= A;
when I => CAP <= '0';
SIRVE <= '0';
LIMPIA <= 'l';
VHDL
Pgina 2
CAMBIO<= '0';
edo_fut <= D;
DEC <= '1';
end case;
end process p_estados;
p_reloj: process(CLK)
begin
if (CLK' event and CLK= '1' then
edo_pres <= edo_fut;
end if;
end process p_reloj;
end arq_maq;
VHDL
Pgina 3