# 1.4: Adding Binary Whole Numbers

- Page ID
- 27018

Before moving on to how integer values are stored and used in a computer for calculations, how to do addition of binary whole numbers needs to be covered.

When 2 one-bit binary numbers are added, the following results are possible: 0_{2}+0_{2} = 0_{2}; 0_{2}+1_{2} = 1_{2}; 1_{2}+0_{2} = 1_{2}; and 1_{2}+1_{2} = 10_{2}. This is just like decimal numbers. For example, 3+4=7, and the result is still one digit. A problem occurs, however, when adding two decimal numbers where the result is greater than the base of the number (for decimal, the base is 10). For example, 9+8. The result cannot be represented in one digit, so a carry digit is created. The result of 9+8 is 7 with a carry of 1. The carry of 1 is considered in the next digit, which is actually adding 3 digits (the two addends, and the carry). So 39 + 28 = 67, where the 10's digit (4) is the result of the two addends (3 and 2) and the carry (1).

The result of 1_{2}+1_{2} = 10_{2} in binary is analogous to the situation in base 10. The addition of 1_{2}+1_{2} is 0_{2} with a carry of 1_{2}, and there is a carry to the next digit of 1_{2}.

An illustration of binary addition is shown in the figure below.

Here the first bit adds 1_{2 }+1_{2}, which yields a 0_{2} in this bit and a carry bit of 1_{2}. The next bit now has to add 1_{2} +1_{2} +1_{2} (the extra one is the carry bit), which yields a 1_{2} for this bit and a carry bit of 1_{2}. If you follow the arithmetic through, you have 0011_{2} (3_{10}) + 0111_{2} (7_{10}) = 1010_{2} (10_{10}).