GCSE Link: None
Let's say you want to add two 1-bit integers (i.e. either 0 or 1) together.
We'll need two inputs (the two bits) and two outputs (because the output could be up to two bits).
We could write out a truth table like so, where A and
B are our inputs, and S0 and
S1 are our outputs (sum).
A |
+ |
B |
= |
S0 |
S1 |
|---|---|---|---|---|---|
0 |
+ |
0 |
= |
0 |
0 |
0 |
+ |
1 |
= |
0 |
1 |
1 |
+ |
0 |
= |
0 |
1 |
1 |
+ |
1 |
= |
1 |
0 |
We can now clearly see that
S0 = A · B
and that
S1 = A ⊕ B
. We can now draw the logic diagram for the half-adder, which adds two bits together.
Diagram 1 shows the logic diagram for the half-adder.
Diagram 1
The full-adder is a more complicated circuit which takes a third input C,
the carry-in bit. It can then add those three bits together resulting in two output bits. These
can then be chained to add any number of bits together.
Diagram 1 shows the logic diagram for the full-adder.
Diagram 2
You only need to be able to recognise this circuit in the exam, not draw it.
Write out the truth table for the full-adder.
A + B + C = S0 S1
0 + 0 + 0 = 0 0
0 + 0 + 1 = 0 1
0 + 1 + 0 = 0 1
0 + 1 + 1 = 1 0
1 + 0 + 0 = 0 1
1 + 0 + 1 = 1 0
1 + 1 + 0 = 1 0
1 + 1 + 1 = 1 1