Академический Документы
Профессиональный Документы
Культура Документы
use IEEE.STD_LOGIC_1164.ALL;
entity full_adder is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
c : in STD_LOGIC;
s : out STD_LOGIC;
cout : out STD_LOGIC);
end full_adder;
component and_gate is
Port ( x : in STD_LOGIC;
y : in STD_LOGIC;
z : out STD_LOGIC);
end component;
component xor_gate is
Port ( x : in STD_LOGIC;
y : in STD_LOGIC;
z : out STD_LOGIC);
end component;
component or_gate is
Port ( p : in STD_LOGIC;
q : in STD_LOGIC;
r : in STD_LOGIC;
s : out STD_LOGIC);
end component;
begin
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity and_gate is
Port ( x : in STD_LOGIC;
y : in STD_LOGIC;
z : out STD_LOGIC);
end and_gate;
begin
z <= x and y;
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity xor_gate is
Port ( x : in STD_LOGIC;
y : in STD_LOGIC;
z : out STD_LOGIC);
end xor_gate;
begin
z <= x xor y;
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity or_gate is
Port ( p : in STD_LOGIC;
q : in STD_LOGIC;
r : in STD_LOGIC;
s : out STD_LOGIC);
end or_gate;
begin
s <= p or q or r;
end Behavioral;
-- Stimulus process
stim_proc: process
begin
-- hold reset state for 100 ns.
wait for 25 ns;
a <= not a;
wait for 25 ns;
b <= not b;
wait for 25 ns;
c <= not c;
end process;
END;