Adding Positive Binary Numbers
This is pretty straighforward.
These are the rules.
We can only use the symbols 0 and 1
0 + 0 = 0
0 + 1 = 1
1 + 1 = 0 and carry a 1
1 + 1 + 1 = 1 and carry a 1
First Easy Example
3 + 1 = 4
0011
(3)
+ 0001 (1)
0100 (4)
Start at the far right column. 1 + 1 = 0 carry a 1.
00111
+ 00 01
0
Next, move to the immediate left column. 1 + 1 + 0 = 0 carry a 1.
010111
+ 0 0 0 1
0 0
Finally, moving left again, 1 + 0 + 0 = 1.
010111
+ 0 0 0 1
1 0 0
Last column, (far left one) 0 + 0 = 0.
010111
+ 0 0 0 1
0 1 0 0
Second Easy Example
5 + 4 = 9
0101
(5)
+ 0100 (4)
1001 (9)
Start at the far right column. 1 + 0 = 1
0101
+ 0100
1
Next, move to the next immediate left column. 0 + 0 = 0
0101
+ 0100
01
Again move to the left. 1 + 1 = 0 carry a 1
10101
+ 0100
001
Finally, 1 + 0 + 0 = 1.
10101
+ 0100
1001
Easy right?
Third Easy Example
Alright, one more example, slightly different. Just to make sure you get what's going on.
5 + 7 = 12
0101
(5)
+ 0111 (7)
1100 (12)
Start from the far right. 1 + 1 = 0 and carry the 1.
01101
+ 01 11
0
Then move to the immediate left. 1 + 0 + 1 = 0 and carry the 1.
011101
+ 0 1 1 1
1 0
Now we have 1 + 1 + 1 = 1 and carry another 1.
1011101
+ 0 1 1 1
1 1 0
Finally, 1 + 0 + 0 = 1
1011101
+ 0 1 1 1
1 1 1 0
There we go.
Oh and one more thing to note. Say you have numbers like 14 + 10 = 24.
1110
(14)
+ 1010 (10)
11000 (24)
Usually to represent this, you try and group the binary numbers in groups of 4's with 0's in the front for padding.
Thus, 11000 would often be displayed like 0001 1000. You can add 0's to the front without changing the number. That's all.