Half Adder VHDL Code Using Behavioural Modeling
Half Adder VHDL Code Using Behavioural Modeling
COM/OP2R
entity half_adder is Port ( a, b: in STD_LOGIC; sum ,carry: out STD_LOGIC); end half_adder; --------------------------------------------architecture Behavioral_HA of half_adder is begin ------------------------------process(a,b) begin if (a='0')then sum<= b; carry<='0'; else sum <= not b; carry<='0'; A if (b='1') then 0 carry<='1'; 0 1 end if; 1 end if; end process; ---------------------------------end Behavioral_HA;
Entity declaration. a, b :- input port bits (bits to be added) Sum, carry:- output port bits.
Process statements (sensitivity list) Behavioral representation of half adder... Truth table:-
B 0 1 0 1
Sum 0 1 1 0
Carry 0 0 0 1
RTL VIEW:-
INFOOP2R.WIX.COM/OP2R