Binary Addition
From ComputingForScientists
Contents 
1. Adding Decimal Numbers
The rules for adding binary numbers are similar to the rules for adding decimal numbers. When adding two decimal numbers such as
2 3 6 5 8 + 4 1 2 4 8 _________
a series of rules are followed. First, a table of all possible twodigit sums of two decimal numbers must be known:
0 + 0 ____ 0 
0 + 1 ____ 1 
0 + 2 ____ 2 
0 + 3 ____ 3 
... 
9 + 9 ____ 18 
The algorithm is:
 Add the numbers in the rightmost column using the table of all possible sums.
 If the sum is one digit, write the sum at the bottom of the first column.
 If the sum is two digits, write down the rightmost digit of the sum at the bottom of the first column and put the leftmost digit of the sum on the top of the column to the left of the first column. If there is no column to the left, write down this number to the left of the last number written down.
 Repeat the above process for the next column.
For example,
1 2 3 6 5 8 + 4 1 2 4 8 _________ 6
 Add the numbers in the first column:
8 + 8 = 16
. Is the sum one digit?
No
.  Is the sum two digits?
Yes
. Place the right digit on the bottom of the first column and the left digit in the next column to the left of the first column.
 Is the sum one digit?
2. Adding Binary Numbers
As with decimal numbers, we need a list of all possible sums of two binary numbers to refer to. They are
0 + 0 ____ 0 
0 + 1 ____ 1 
1 + 0 ____ 1 
1 1 + 1 ____ 1 0 
Note that we arrived at the result
1 + 1 ____ 1 0
in binary by using the same rule that we use when we when we run out of symbols when counting in decimal. The last possible decimal symbol is 9
, and to represent the next larger number, we place a zero in the rightmost column and a one in the column to the left:
1 1 + 9 ___ 1 0
In the case of binary numbers, to get the next value after the last possible binary symbol (1
), we place a zero in the first column and a one in the second column: 1 0
. (Another way of arriving at this result is to note that the binary representation of the decimal number 2
is 10
.)
This algorithm can be applied to the addition of numbers in any base. For example, in base 3, the possible symbols are 0
, 1
, and 2
. Using this rule, we arrive at 2+1 = 10
in base 3.
Example
Perform the following addition in binary:
1 0 1 1 1 + 0 0 1 0 1 _________
The numbers in the first column are added (1+1 = 10
in binary) and the carryover part is placed at the top of the next column:
1 1 0 1 1 1 + 0 0 1 0 1 _________ 0
The same is done for the second column:
1 1 1 0 1 1 1 + 0 0 1 0 1 _________ 0 0
The recipe given earlier only mentions adding two numbers, not three. To determine the sum of three 1
s in binary, break the sum of three numbers into a sum of two numbers:
1 1 1 0 (result of adding the top two 1s) + 1 => + 0 1 (bottom 1 with a leading zero added for clarity) __ _____ 1 1
The final answer is
1 0 1 1 0 + 0 0 1 1 1 _________ 1 1 1 0 1
To check your answer, convert the binary numbers to decimal numbers and do the addition in decimal.
 The top row
10110
equals22
in decimal (determined using the table method covered in the Binary Representation of Numbers).  The second row
00111
equals7
in decimal (determined using the table method). 
22 + 7 = 29
 The binary answer of
11101
equals29
in decimal (determined using the table method).
1 0 1 1 0 (22 in decimal) + 0 0 1 1 1 (7 in decimal) _________ 1 1 1 0 1 (29 in decimal)
3. Problems
3.1. Running Out of Digits
 What is the binary representation of the number that follows the binary number
111
?  What is the decimal representation of the number that follows the decimal number
999
?
Answer 

1. To find the binary number that follows 1 1 1 1 1 + 1 _________ 1 0 0 02. To find the decimal number that follows 999 , add 1 using decimal addition. 1 1 9 9 + 1 _________ 1 0 0 
3.2. Running Out of Digits
The hexadecimal number system uses the 16 symbols 0, ..., 9, A, ..., F, where AF correspond to the decimal numbers 1015.
 What is the hexadecimal representation of the number that follows
F
?  What is the hexadecimal representation of the number that follows the number given for your answer to the previous problem?
Answer 

To find these solutions, you need to know all possible sums of two hexadecimal symbols. To see all possible sums, go to [1]. To find the hexadecimal representation that follows the number, simply add

3.3. Carry Operations
Y 1 1 1 0 1 1 0 + 0 0 1 1 1 _________ X 1 0 1
What are X
and Y
?
Answer 

0 1 1 1 0 1 1 0 + 0 0 1 1 1 _________ 1 1 1 0 1
To assure you found the right values for 0 1 1 1 0 1 1 0 => 22 + 0 0 1 1 1 => 7 _________ 1 1 1 0 1 => 29 
3.4. Binary Addition
Perform the following binary addition. Show your work.
1 0 0 0 1 1 0 1 1 0 1 + 1 1 1 0 0 1 1 0 1 1 1 _____________________
Answer 

1 1 1 1 1 1 1 1 1 0 0 0 1 1 0 1 1 0 1 + 1 1 1 0 0 1 1 0 1 1 1 _______________________ 1 0 1 1 1 0 1 0 0 1 0 0 To check your answer, convert the numbers in each row to decimal 1 0 0 0 1 1 0 1 1 0 1 => 1133 + 1 1 1 0 0 1 1 0 1 1 1 => 1847 ______________________ 1 0 1 1 1 0 1 0 0 1 0 0 => 2980 
3.5. Binary Addition
Perform the following binary addition. Show your work.
0 1 1 0 1 + 1 0 0 1 1 ___________
Answer 

1 1 1 1 0 1 1 0 1 + 1 0 0 1 1 ___________ 1 0 0 0 0 0 To check your answer, convert the numbers in each row to decimal 0 1 1 0 1 => 13 + 1 0 0 1 1 => 19 ___________ + __ 1 0 0 0 0 0 => 32 
3.6. Binary Addition
Perform the following binary addition. Show your work.
1 1 + 1 ___________
Answer 

To determine the sum of three 1 1 1 0 (result of adding the top two 1s) + 1 => + 0 1 (bottom 1 with a leading zero added for clarity) __ _____ 1 1 
3.7. Binary Addition
Perform the following binary addition. Show your work.
1 0 1 1 1 1 0 1 1 0 0 0 0 1 0 1 1 0 1 1 0 1 + 1 1 1 0 0 1 1 0 1 1 1 _____________________
For a hint, look at the following activity:
Answer 

1 1 1 1 0 1 1 0 1 1 0 1 1 1 0 1 1 1 1 0 1 1 0 0 0 0 1 0 1 1 0 1 1 0 1 + 1 1 1 0 0 1 1 0 1 1 1 _______________________ 1 1 1 0 1 0 0 1 0 0 0 0 To check your answer, convert the numbers in each row to decimal 1 0 1 1 1 1 0 1 1 0 0 => 1516 0 0 1 0 1 1 0 1 1 0 1 => 365 + 1 1 1 0 0 1 1 0 1 1 1 => 1847 ______________________ 1 1 1 0 1 0 0 1 0 0 0 0 => 3728 Another way to solve this problem is to find the sum of the two top numbers, 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 0 0 => 1516 + 0 0 1 0 1 1 0 1 1 0 1 => 365 _______________________ 1 1 1 0 1 0 1 1 0 0 1 => 1881 then add that sum to the third number, 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 0 0 1 => 1881 + 1 1 1 0 0 1 1 0 1 1 1 => 1847 ______________________ 1 1 1 0 1 0 0 1 0 0 0 0 => 3728 No matter which method is used, the answer will be 
3.8. Base 16 Addition
 Write out the table of all possible sums of the symbols 0, ..., 9, A, ..., F.
 Use the table to complete the following base16 addition.
0 B 3 + 0 2 F ________
Answer  

1. The table would be:
For a look at the full table with all possible sums, go to [2]. 2. Use the previous table to find the solution. 1 0 B 3 + 0 2 F ________ 0 E 2 
4. Activities
4.1. Extending the Addition Algorithm
Compute the following and write down any additional steps that you needed to add to the steps covered previously. Check your answer using the method covered previously. 1 1 1 1 1 1 + 1 1 ____ 
Answer  

Adding a stack of three binary numbers was covered in the notes. This process can be extended to handle four binary number. The first column of four ones can be broken into two twodigit "stacks"
The next complication is on how to "carry" the
There are several ways to reason this out:
Regardless of which method you use to find out how to carry the 1 0 1 0 1 1 1 1 1 1 + 1 1 _________ 1 1 0 0 Note that another way to solve this problem is to find the sum of the top two numbers and the sum of the bottom two numbers, which will be the same, and add them together. 
4.2. Base 2 Multiplication
 Create a table of all possible products of the symbols 0 and 1.
 Use the table to complete the base2 multiplication:
1 1 x 1 1 ____
Answer  

1. All possible products include:
2. 1 1 x 1 1 ____ 1 1 1 1 => the two 1's on the far left are carryovers + 1 1 0 _______ 1 0 0 1 == Base 3 Addition == # Write out the table of all possible sums of the symbols 0, 1, and 2. # Use the table to complete the base3 addition: <pre style="fontfamily:monospace;border:1px solid black;width:7em"> 0 1 2 + 0 2 0 ________

4.3. Base 3 Addition
 Write out the table of all possible sums of the symbols 0, 1, and 2.
 Use the table to complete the base3 addition:
0 1 2 + 0 2 0 ________
Answer 

1. All possible sums:
2. Use the previous answer to solve the problem. 1 0 1 2 + 0 2 0 ________ 1 0 2 
4.4. Base 4 Addition
 Write out the table of all possible sums of the symbols 0, 1, 2, and 3.
 Use the table to complete the base4 addition:
0 3 3 + 0 2 0 ________
Answer 

1. All possible sums include:
2. 1 0 3 3 + 0 2 0 ________ 1 1 3 
4.5. Base 16 Addition
 Write out the table of all possible sums of the symbols 0, ..., 9, A, ..., F.
 Use the table to complete the base16 addition:
0 A F + 0 2 F ________
Answer 

1. Look at this problem for the possible sums and use it to complete the base16 addition. 2. 1 0 A F + 0 2 F ________ 0 D E 