4 bit Look Ahead Carry Adder

4 bit Look Ahead Carry Adder

4 bit Look Ahead Carry Adder(Behavioural + Data Flow Model)

library ieee;
use ieee.std_logic_1164.all;
 entity LookAheadCarryAdder4 is
  port( A : in std_logic_vector(0 to 3);
           B : in std_logic_vector(0 to 3);
           Cin : in std_logic;
           Cout : out std_logic;
           Sum : out std_logic_vector(0 to 3));
 end entity LookAheadCarryAdder4;
architecture LookAheadCarryAdder_4 of LookAheadCarryAdder4 is
 Signal C: std_logic_vector(0 to 4);
 Signal G: std_logic_vector(0 to 3);
 Signal P: std_logic_vector(0 to 3);
  begin
   process(A, B, Cin)
    begin
     C(0)<= Cin;
     loop1:
     for i in 0 to 3
     loop
     G(i)<= A(i) AND B(i);
     P(i)<= A(i) XOR B(i);
     Sum(i)<= P(i) XOR C(i);
     C(i+1)<= G(i) OR (P(i) AND C(i));
     end loop loop1;
     Cout<= C(4);
   end process;
end architecture LookAheadCarryAdder_4;