ALGORITHMIC IMPLEMENTATION OF FULL ADDER architecture ALGORITHMIC_IMPLEMENTATION of FULL_ADDER is block begin process (A,B,CIN) variable S: BIT_VECTOR ( 1 to 3 ) := A & B & CIN; variable COUNT: INTEGER range 0 to 3 :=0; begin for i:= 1 to 3 loop if S(i) = then ‘1’ COUNT := COUNT +1; ; end if end loop; case COUNT is when 0 => COUT <= SUM <= ‘0’; ‘0’; 1 => COUT <= <= when ‘0’; SUM ‘1’; when 2 => COUT <= SUM <= ‘1’; ‘0’; when 3 => COUT <= SUM <= ‘1’; ‘1’; end case; end process;
ALGORITHMIC IMPLEMENTATION OF FULL ADDER architecture ALGORITHMIC_IMPLEMENTATION of FULL_ADDER is block begin process (A,B,CIN) variable S: BIT_VECTOR ( 1 to 3 ) := A & B & CIN; variable COUNT: INTEGER range 0 to 3 :=0; begin for i:= 1 to 3 loop if S(i) = ‘1’ then COUNT := COUNT +1; end if ; end loop; case COUNT is when 0 => COUT <= ‘0’; SUM <= ‘0’; when 1 => COUT <= ‘0’; SUM <= ‘1’; when 2 => COUT <= ‘1’; SUM <= ‘0’; when 3 => COUT <= ‘1’; SUM <= ‘1’; end case; end process;