To reduce the computation time, engineers devised faster ways to add two binary numbers by using carry look-ahead adders. They work by creating two signals (P and G) for each bit position, based on if a carry is propagated through from a less significant bit position (at least one input is a '1'), a carry is generated in that bit position (both inputs are '1'), or if a carry is killed in that bit position (both inputs are '0'). In most cases, P is simply the sum output of a half-adder and G is the carry output of the same adder. After P and G are generated the carries for every bit position are created. Some advanced carry look ahead architectures are the Manchester carry chain, Brent-Kung adder, and the Kogge-Stone adder.
Therefore, for 4-bit adder,
And the corresponding schematic is illustrated in the below figure,
The worst-case propagation delay of 4-bit Carry Look-ahead Adder is 5∆t, and the propagation delay of a 4-bit Ripple-Carry Adder is 9∆t. Therefore, the Carry Look-ahead Adder is faster than Ripple-Carry Adder.
//Edit by [email protected]
//Jan 10th, 2011
//Ver. 1.0
module Carry_Look_Ahead_Adder(A,B,Cin,Sum, Cout);
input [3:0] A,B;
input Cin;
output [3:0]Sum;
output Cout;
wire Cout_0,Cout_1,Cout_2;
wire [3:0] P, G;
assign P[0]=A[0]^B[0];
assign P[1]=A[1]^B[1];
assign P[2]=A[2]^B[2];
assign P[3]=A[3]^B[3];
assign G[0]=A[0]&B[0];
assign G[1]=A[1]&B[1];
assign G[2]=A[2]&B[2];
assign G[3]=A[3]&B[3];
assign Sum[0]=P[0]^Cin;
assign Cout_0=G[0]|P[0]&Cin;
assign Sum[1]=P[1]^(G[0]|P[0]&Cin);
assign Cout_1=G[1]|P[1]&G[0]|P[1]&P[0]&Cin;
assign Sum[2]=P[2]^(G[1]|P[1]&G[0]|P[1]&P[0]&Cin);
assign Cout_2=G[2]|P[2]&G[1]|P[2]&P[1]&G[0]|P[2]&P[1]&P[0]&Cin;
assign Sum[3]=P[3]^(G[2]|P[2]&G[1]|P[2]&P[1]&G[0]|P[2]&P[1]&P[0]&Cin);
assign Cout=G[3]|P[3]&G[2]|P[3]&P[2]&G[1]|P[3]&P[2]&P[1]&G[0]|P[3]&P[2]&P[1]&P[0]&Cin;
endmodule