Full adders
Introduction
If you haven't yet worked through and understood how a half adder works, then you should go back and work through our half adder notes before starting on this section. A half adder is used to add two bits together. A full adder is used to add three bits together. One of the commonest ways of implementing the full adder is to use two half adders joined together with an OR gate. That is one reason why you need to understand how a half adder works before starting on understanding a full adder!
A full adder has 3 bits as an input, which we will call A, B and Cin.
Cin is a bit but it is actually the carry from the previous column's addition. If you remember when we looked at the half adder and we were adding 2 bits, we always generated a carry from the previous column's addition. For example, let's call the right hand column 'column k'. We added just 2 bits on this occasion (the 0 and a 1) as that was the first addition. The sum was 1 but we carried a 0 into the next column. We then had to add 1 + 1, along with adding the previous column's carry, the 0. The previous column is column k - 1. Each time we did an addition, we had to also add a carry from column k - 1, and we also generated a carry, which had to be added in to the next column.
Apart from our 3 input bits, we also have the output. As before, this will be a sum (S) and a carry (Cout). Cout is short for carry out, which is just the value of the carry generated by adding the bits.
Looking at the different permutations of ones and zeros when you have 3 bits, we can produce the truth table for a full adder:
In the first column, we have 0 + 0 + 0, which totals 0. That's 0 for the sum and 0 for the carry.
In the second column, we have 0 + 0 + 1, which totals 1. That's 1 for the sum and 0 for the carry.
In the third column, we have 0 + 1 + 0, which totals 1. That's 1 for the sum and 0 for the carry.
In the fourth column, we have 0 + 1 + 1, which totals 2, which in binary is 10. That's 0 for the sum and 1 for the carry.
In the fifth column, we have 1 + 0 + 0, which totals 1. That's 1 for the sum and 0 for the carry.
In the sixth column, we have 1 + 0 + 1, which totals 2, which in binary is 10. That's 0 for the sum and 1 for the carry.
In the seventh column, we have 1 + 1 + 0, which totals 2, which in binary is 10. That's 0 for the sum and 1 for the carry.
In the eighth column, we have 1 + 1 + 1, which totals 3. which in binary is 11. That's 1 for the sum and 1 for the carry.
Now we understand the logic behind a full adder, we can design a diagram using logic gates to implement it.
There are many different ways you can put logic gates together to achieve the truth table for a full adder. If we rearrange the order of the truth table for a moment (without changing any values in any of the cells), we can see an easy implementation.
If you look at the top four rows, the Cin is always a 0, but the sum is now behaving like an XOR with respect to A and B.
If you look at the bottom four rows, the Cin is always a 1, but the sum is now an XNOR (and inverted XOR) with respect to A and B.
If you look at the top for rows, the Cin is always a 0, but the carry is behaving like an AND gate with resepct to A and B.
If you look at the bottom four rows, the Cin is a 1, but the carry is behaving like an OR gate with respect to A and B.
Putting these facts together, we can design a full adder logic gate circuit.
Using the truth table, look at each of the eight permutations in turn and work through the circuit diagram, to check that the output for the sum and carry is what you would expect it to be.
The above design is not at all the best way to implement a full adder. It's just one way that is perhaps easier to understand than other designs. Another way is simply to use two half adders and an OR gate. A simplified logic diagram is as follows:
The full logic gate diagram is as follows: