A Carry-Lookahead Generator is used in a Carry-Lookahead Adder (CLA) to significantly improve speed.
Unlike a Ripple-Carry Adder (RCA), which computes each carry sequentially, the CLG calculates all carry signals simultaneously from the inputs, reducing propagation delay.
Concept and Derivation
-
Define:
-
Carry Generate:
(A carry is generated when both inputs are1.) -
Carry Propagate:
(A carry will propagate through if at least one input is1.)
-
-
The general formula for carry:
Example for 4-Bit CLA
For a 4-bit Carry-Lookahead Adder, the carries are:
This allows parallel computation of all carries, avoiding ripple delay.
Verilog Implementation
module CLG(G, P, C, C_in, C_out);
input [3:0] G, P;
input C_in;
output [2:0] C;
output C_out;
// Carry outputs based on carry-lookahead logic
assign C[0] = G[0] | (P[0] & C_in);
assign C[1] = G[1] |
(P[1] & G[0]) |
(P[1] & P[0] & C_in);
assign C[2] = G[2] |
(P[2] & G[1]) |
(P[2] & P[1] & G[0]) |
(P[2] & P[1] & P[0] & C_in);
assign C_out = 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] & C_in);
endmodule