In a look-ahead carry generator, the carry generate function G_{i} and the carry propagate function P_{i} for inputs A_{i} and B_{i} are given by:
${P}_{i}={A}_{i}\oplus {B}_{i}$ and ${G}_{i}={A}_{i}{B}_{i}$
The expressions for the sum bit S_{i} and the carry bit C_{i+1} of the look-ahead carry adder are given by:
${S}_{i}={P}_{i}\oplus {C}_{i}$ and ${C}_{i+1}={G}_{i}+{P}_{i}{C}_{i}$ ,where C_{0} is the input carry
Consider a two-level logic implementation of the look-ahead carry generator. Assume that all P_{i} and G_{i} are available for the carry generator circuit and that the AND and OR gates can have any number of inputs. The number of AND gates and OR gates needed to implement the look-ahead carry generator for a 4-bit adder with S_{3}, S_{2}, S_{1}, S_{0}, and C_{4} as its outputs are respectively: