TU-VHDL/02_Fulladder/halfadder.vhd
2025-02-10 20:28:13 +01:00

16 lines
337 B
VHDL

-- The halfadder design
library IEEE;
use IEEE.std_logic_1164.all;
entity halfadder is
port (a_i : in std_logic;
b_i : in std_logic;
sum_o : out std_logic;
cy_o : out std_logic);
end halfadder;
architecture behavior of halfadder is
begin
sum_o <= a_i xor b_i;
cy_o <= a_i and b_i;
end behavior;