What are some applications?
Example with n = 8, m = 5:
Design a circuit (parallel computer) to add n numbers, each m bits long, as fast as possible.
Discuss (in pairs)
Discuss (all together)
Subproblems: adding 2 m-bit numbers,
organizing n numbers for parallel accumulation.
carry-save (half) addition:
0 + 0 + 0 → 0 + 0_
0 + 0 + 1 → 1 + 0_
0 + 1 + 0 → 1 + 0_
1 + 0 + 0 → 1 + 0_
0 + 1 + 1 → 0 + 1_
1 + 0 + 1 → 0 + 1_
1 + 1 + 0 → 0 + 1_
1 + 1 + 1 → 1 + 1_
For example:
_10110 +
_01011 +
_11011 =
----------
_00110(base) +
11011_(carry)
Adding two carry-save numbers is two applications of the half adder.
(xb,xc) + (yb,yc) =
(zb,zc), where
(xb,xc,yb) → wa,wc, and
(wb,wc,yc) → za,zc.
a0 a1 a2 a3 a4 a5 a6 a7 \ / \ / \ / \ / s0 s1 s2 s3 \ / \ / s4 s5 \__ __ / \ / s6
Let T(n,m) = total number of logic gates to solve the problem
Let P(n,m) = time for signals to propagate through circuit (parallel time).
For constant bit length c,
T(n,c) is O(n).
P(n,c) is O(log2(n)). Let lg(n) := log2 := y such that n = 2y
For bit length m, using standard arithmetic,
T(n,m) is O(mn).
P(n,c) is O(mlg(n)).
For bit length m, carry-save arithmetic,
T(n,m) is O(mn).
P(n,c) is O(lg(m)log2(n) + m).