
HALF Adder
Behavioral
entity halfaddbehav is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
SUM : out STD_LOGIC;
Carry : out STD_LOGIC);
end halfaddbehav;
architecture Behavioral of halfaddbehav is
begin
Process(A,B)
begin
if ((A='0')and(B='0'))then
SUM<='0';Carry<='0';
elsif ((A='0')and(B='1'))then
SUM<='1';Carry<='0';
elsif ((A='1')and(B='0'))then
SUM<='1';Carry<='0';
elsif ((A='1')and(B='1'))then
SUM<='0';Carry<='1';
end if;
end process;
end Behavioral;