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.
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).
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.
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).