library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity halfadder is port ( A, B : IN std_logic; S, C : OUT std_logic ); end halfadder; architecture behave of halfadder is begin C <= A AND B; S <= A XOR B; end behave;