We will deliberately and hierarchically build larger and larger adder components...
Of course, we remember:
0+0 = 0 1+0=1 0+1 = 0 1+1=10 (2)
Add two binary bits...
Block diagram | Truth
Table
|
Hey, we know these functions (in the truth table):
S = x XOR y | |
C = x y |
Now, add three binary bits...
Block Diagram Truth Table
xy Sum Carry 000 0 0 001 1 0 010 1 0 011 0 1 100 1 0 101 0 1 110 0 1 111 1 1
We can build the full adder using two half adders and an OR gate:
Figure 3-27, p. 127
Cascade n full adders to add binary numbers of arbitrary size...
Example: Add two 4-bit numbers... A3A2A1A0 + B3B2B1B0
Solution using full adders chained together:
Figure 3-28, p. 128
This solution is:
Clean | |||||
Simple | |||||
Expandable | |||||
Hierarchical | |||||
BUT
slow...
|
The solution to this "slowness" is a Carry Lookahead Adder... we'll do this later.