In examining how incrementing can be made faster, we saw that the carry signal is propagated whenever there is a one in the input. If there is a one in the input, the carry bit is set if and only the previous carry bit is set. If there is a zero in the input, the carry bit is never set. We see similar behavior in general addition circuits.
| Carry | ... | |||||||
| Input X | ... | |||||||
| Input Y | ... | |||||||
| Output | ... |
If both
and
are set to one, then
is
always set - this is called generating the carry bit. If one of these
bits is one and the other is zero, then
(with
the exception of
) - this is called propagating the carry
bit. If both
and
are set to zero, then
is always
zero. We abstract this into two bits
and
representing
whether the carry value is generated and propagated respectively.
We can reformulate the carry bits in terms of the
and
bits.
If we unwind the recursion, we eventually get the following formula.