# One bit adder with carry.

When we add two numbers together in decimal, we begin by adding corresponding pairs of digits going from right to left. At each stage, we may have to carry a value over to the next step, to include in the addition of the next pair of digits.

• E.g. adding 17 and 16.
• Step 1 (7 + 6 = 13) ( we carry the one into the next column).
• Step 2 (1+1+1 = 3).
• so the answer is 36.

So, if we can build a circuit element that can add two binary digits and cope with any carry over, then we can link these together, to be able to add binary numbers of any length. This circuit element is shown below. From the truth table for the above circuit, we can see that the output (D) and the "carry over" bit (Co), represents the addition of the inputs A and B, along with any "carry in" (Ci).

Example
Consider adding the binary numbers 0111 and 0110. We need a circuit for each pair of digits. The carry out bit Co is connected to the carry in bit Ci of the next circuit.

• For the first circuit A = 1 and B = 0. (There is nothing to carry into the first step so Ci =0).
• 1 + 0 + 0 = 1 with nothing to carry over. So D = 1 and Co = 0 (in agreement with the truth table).
• The second circuit then adds the second pair of digits. A = 1 and B =1 (Ci = 0 as there was nothing to carry in from the first circuit).
• 1 + 1 + 0 = 1 0. So we put zero down and carry the 1. i.e. D = 0 and Co = 1.
• A third circuit adds the third pair of digits. A = 1, B = 1 and Ci = 1 (as there was a carry from the previous circuit).
• 1 + 1 + 1 = 1 1. So we put 1 down and carry the 1. i.e. D = 1 and Co = 1.
• A fourth circuit adds the final pair of digits. A = 0, B = 0 and Ci = 1 (as there was a carry from the previous circuit).
• 0 + 0 + 1 = 1 with no carry, so D = 1 Co = 0.

So the D outputs from each of the four circuits combine to make 1101 which is the addition of 0111 and 0110.

In fact this basic circuit actually has the ability to subtract, multiply or divide binary numbers, as well as adding them. (Subtraction of a binary number can be performed by first converting it to a format called two’s compliment and then adding this to the number we wish to subtract from. Multiplication is just repeated addition and division is based on repeated subtraction).