Carry Lookahead Addition
Tom Kelliher, CS 315
Feb. 26, 1999
Homework due Monday.
Read 1.2.2.
Summary of fixed-connection network model.
- Carry lookahead addition algorithm, proof.
Parallel prefix computations.
- In general, the sum of two n-bit numbers results in an n+1-bit
sum.
- The problem reduces to computing the carries.
- For each bit position we determine if it would
- Propagate a carry (p).
- Generate a carry (g).
- Stop a carry (s).
What's the ``truth table'' for this.
- Example: 0x5c92 and 0x685c.
- The computation is carried out in a binary tree with addend, augend
bits transmitted to the leaves.
Dimensions of the tree?
- Steps of the computations:
- Step 1: compute p, g, s in the leaves.
- ascending steps:
- Receive inputs from children, who ``erase'' their values.
- Pass value received from right child to left child.
- Compute own value to pass to parent. What is the computation?
- Special case for root:
- Its value becomes the carry-out (or additional sum bit).
Output this value.
- Set value to s.
- descending steps:
- Receive value from parent.
- Keep first non-p value received (including the value received
by a left child from a right child).
- When finished, all leaves are labeled either s or g. Which is a
carry-in of 0 and which is 1?
- We know no leaf will be ``stuck'' with a p. Why?
- The carry-in for a leaf is the left-most non-p value to the right of
the leaf, as originally computed by the leaves.
Prove that the algorithm stores this carry in each leaf.
Thomas P. Kelliher
Fri Feb 26 10:24:32 EST 1999
Tom Kelliher