Carry-lookahead logic uses the concepts of
generating and
propagating carries. Although in the context of a carry-lookahead adder, it is most natural to think of generating and propagating in the context of binary addition, the concepts can be used more generally than this. In the descriptions below, the word
digit can be replaced by
bit when referring to binary addition of 2. The addition of two 1-digit inputs A and B is said to
generate if the addition will always carry, regardless of whether there is an input-carry (equivalently, regardless of whether any less significant digits in the sum carry). For example, in the decimal addition 52 + 67, the addition of the tens digits 5 and 6
generates because the result carries to the hundreds digit regardless of whether the ones digit carries; in the example, the ones digit does not carry (2 + 7 = 9). Even if the numbers were, say, 54 and 69, the addition of the tens digits 5 and 6 would still
generate because the result once again carries to the hundreds digit independently of 4 and 9 creating a carry. In the case of binary addition, A + B generates
if and only if both A and B are 1. If we write G(A, B) to represent the binary predicate that is true if and only if A + B generates, we have :G(A, B) = A \cdot B where A \cdot B is an
and. The addition of two 1-digit inputs A and B is said to
propagate if the addition will carry whenever there is an input carry (equivalently, when the next less significant digit in the sum carries). For example, in the decimal addition 37 + 62, the addition of the tens digits 3 and 6
propagate because the result would carry to the hundreds digit
if the ones were to carry (which in this example, it does not). Note that propagate and generate are defined with respect to a single digit of addition and do not depend on any other digits in the sum. In the case of binary addition, A + B propagates if and only if at least one of A or B is 1. If P(A, B) is written to represent the binary predicate that is true if and only if A + B propagates, one has :P(A, B) = A + B where A + B on the right-hand side of the equation is an
or. Sometimes a slightly different definition of
propagate is used. By this definition A + B is said to propagate if the addition will carry whenever there is an input carry, but will not carry if there is no input carry. Due to the way generate and propagate bits are used by the carry-lookahead logic, it doesn't matter which definition is used. In the case of binary addition, this definition is expressed by :P'(A, B) = A \oplus B where A \oplus B is an
xor. '
Table showing when
carries are propagated or generated.' For binary arithmetic,
or is faster than
xor and takes fewer transistors to implement. However, for a multiple-level carry-lookahead adder, it is simpler to use P'(A, B). Given these concepts of generate and propagate, a digit of addition carries precisely when either the addition generates
or the next less significant bit carries and the addition propagates. Written in Boolean algebra, with C_i the carry bit of digit i, and P_i and G_i the propagate and generate bits of digit i respectively, :C_{i+1} = G_i + (P_i \cdot C_i). ==Implementation details==