Beruflich Dokumente
Kultur Dokumente
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity seguridad is
Port ( clk : in STD_LOGIC;
reset : in STD_LOGIC;
x : in STD_LOGIC;
y : in STD_LOGIC;
z : in STD_LOGIC;
s0 : inout STD_LOGIC;
s1 : inout STD_LOGIC;
s2 : inout STD_LOGIC);
end seguridad;
begin
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity sistema is
Port ( clk : in STD_LOGIC;
reset : in STD_LOGIC;
E0 : in STD_LOGIC;
E1 : in STD_LOGIC;
E2 : in STD_LOGIC;
y0 : out STD_LOGIC;
y1 : out STD_LOGIC);
end sistema;
architecture Behavioral of sistema is
signal d0,d1,d2,q0,q1,q2: STD_LOGIC;
begin
--instanciacion de las entidades de un flip flop tipo d
ff_d0: entity work.ff_d
PORT MAP(
clk => clk,
reset => reset,
d => d0,
q => q0
);
entity contador is
Port ( clk : in STD_LOGIC;
reset : in STD_LOGIC;
x : in STD_LOGIC;
y : out STD_LOGIC);
end contador;
entity ff_d is
Port ( clk : in STD_LOGIC;
reset : in STD_LOGIC;
d : in STD_LOGIC;
q : out STD_LOGIC);
end ff_d;
begin
process (clk,d,reset)
begin
if clk'event and clk='1' then
if reset='1' then
q <= d;
else
q <= '0';
end if;
end if;
end process;
end Behavioral;