Beruflich Dokumente
Kultur Dokumente
Integrantes: Cdigo
-Inglis Vidal Guillermo 20150107J
-Huauya Mamani, Roger 20150002C
-Valencia Guerrero,Cristhian 20150074D
-Quispe Cangalaya, Diego 20150033F
-Sanchez Escate, Zaid 20157004A
-Lazo Quispe, Cristian 20154016I
Curso:
Profesor:
Seccin:
A Grupo-03
1
Archivo VHDL Module llamado grupo_03:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.all;
entity grupo_03 is
Port ( clk : in STD_LOGIC;
reset : in STD_LOGIC;
moneda_c : in STD_LOGIC;
puerta_l : in STD_LOGIC;
peso_m : in STD_LOGIC;
estados_lavadora : out STD_LOGIC_VECTOR (7 downto 0));
end grupo_03;
process(clk,reset)
variable T: integer range 0 to 50000000;
begin
if reset='1' then
clk_1Hz_s <= '1';
elsif(rising_edge (clk)) then
T:=T+1;
if ( T<=1) then
clk_1Hz_s <= '1';
elsif( T< 50000) then
clk_1Hz_s <= '0';
else
T:=0;
end if;
end if;
end process;
process(clk_1Hz_s,reset,moneda_c,ep)
begin
if ep=inicio then
if moneda_c= '1' then
2
t<=0;
ep <= llenado;
else
ep <= inicio;
end if;
3
when secado2 =>
t <= t+1;
if t=5 then
ep <= centrifugado;
t <= 0;
else
ep <= secado2;
end if;
t <=t+1;
if t=12 then
ep <= inicio;
t<=0;
elsif puerta_l ='0' then
ep <= recesivo;
else
ep <= centrifugado;
end if;
else
ep <= recesivo;
end if;
end case;
end if;
end process;
-- Valores para las salidas
process(ep)
begin
case ep is
when inicio =>
estados_lavadora <= "00101000";
when llenado =>
estados_lavadora <= "00101001";
when lavado1 =>
estados_lavadora <= "00101010";
when lavado2 =>
estados_lavadora <= "00101101";
when secado1 =>
4
estados_lavadora <= "00101011";
when secado2 =>
estados_lavadora <= "00101110";
when centrifugado =>
estados_lavadora <= "00101100";
when recesivo =>
estados_lavadora <= "00101111";
end case;
end process;
end Behavioral;
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY lavadora IS
END lavadora;
COMPONENT grupo_03
PORT(
clk : IN std_logic;
reset : IN std_logic;
moneda_c : IN std_logic;
puerta_l : IN std_logic;
peso_m : IN std_logic;
estados_lavadora : OUT std_logic_vector(7 downto 0)
);
END COMPONENT;
--Inputs
signal clk : std_logic := '0';
signal reset : std_logic := '0';
signal moneda_c : std_logic := '0';
signal puerta_l : std_logic := '0';
signal peso_m : std_logic := '0';
--Outputs
signal estados_lavadora : std_logic_vector(7 downto 0);
5
-- Clock period definitions
constant clk_period : time := 10 ns;
BEGIN
-- Stimulus process
stim_proc: process
begin
-- hold reset state for 100 ns.
wait for 100 ns;
wait;
end process;
END;
6
Imagen de la simulacin: