Professional Documents
Culture Documents
Library IEEE Use IEEE - STD - LOGIC - 1164.ALL Use Ieee - STD - Logic - Unsigned - All Use Ieee - STD - Logic - Arith - All
Library IEEE Use IEEE - STD - LOGIC - 1164.ALL Use Ieee - STD - Logic - Unsigned - All Use Ieee - STD - Logic - Arith - All
Library IEEE Use IEEE - STD - LOGIC - 1164.ALL Use Ieee - STD - Logic - Unsigned - All Use Ieee - STD - Logic - Arith - All
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
--library UNISIM;
--use UNISIM.VComponents.all;
entity ADDER is
Port (
CIN : in STD_LOGIC;
);
end ADDER;
begin
-- Z<=(A3 & A2 & A1 & A0) + (B3 & B2 & B1 & B0) + CIN;
S0 <= Z(0);
S1 <= Z(1);
S2 <= Z(2);
S3 <= Z(3);
end Behavioral;
entity ADDER_TB is
-- Port ( );
end ADDER_TB;
COMPONENT ADDER
);
end COMPONENT;
--inputs
--outpouts
signal S3 : STD_LOGIC;
signal S2 : STD_LOGIC;
signal S1 : STD_LOGIC;
signal S0 : STD_LOGIC;
begin
S3 => S3, S2 => S2, S1 => S1, S0 => S0, COUT => COUT);
stim_proc: process
begin
A <= "1010";
B <= "1010";
wait;
end process;
end Behavioral;