- Joined
- Jan 21, 2007
- Sythe Gold
- 1,234
- Messages
- 14,211
Basic Binary
By SuF
By SuF
What is Binary?
Binary is a number system that is used mainly in computer systems. It is comparable to the decimal number system that we naturally use with the numbers 0 through 9. Since there are 10 different numbers in the decimal system it is base 10. Binary only has two numbers, 0 and 1, so it is base 2.
Some examples of binary numbers are:
101 (5)
111 (7)
100001 (33)
100000011 (259)
Some examples of binary numbers are:
101 (5)
111 (7)
100001 (33)
100000011 (259)
Counting in Binary
To understand how to count in binary, let’s review how to count in the decimal system. You start with a single digit and you count upwards through all 10 digits until you run out at which point you increment the number to the left and restart the counting at 0.
Example:
1,2,3,4,5,6,7,8,9,10,11,12…
27,28,29,30,31…
98,99,100…
Now in the binary system, you do the exact same thing except that you only have 2 digits until you have to restart the counting.
Example:
0 = 0
1 = 1
10 = 2 (We had counted through all the digits so we incremented the place to the left)
11 = 3
100 = 4 (This is just like the number ‘99’. Both places were as high as they go so we had to add a third place)
101 = 5
110 = 6
111 = 7
1000 = 8
What is explained above is the simplest form of counting in binary, but there is another way which is much easier for bigger numbers.
In the decimal number system, each place is a power of 10. The first place is 10^0, the second 10^1, the third 10^2 and so on.
Example
100 = 10^2
1000 = 10^3
2000 = 10^3*2(There is 2 digits in that place)
This is very useful when it comes to binary, as the same rules apply. The first place is 2^0, the second is 2^1, the third 2^2 and so on.
Example
2 = 2^1
4 = 2^2
8 = 2^3
16 = 2^4
32 = 2^5
64 = 2^6
128 = 2^7
256 = 2^8
And so on. Notice that with each increasing power, the number doubles. That makes sense because you are multiplying the previous number by 2. This is very useful when trying to find out very large numbers in binary.
Example:
Let’s figure out what the number 150 is in binary.
Well first we must find what power of 2 is closest without being bigger than the number we are trying to find. In this case this number is 128 or 2^7. Now that we know that, we realize that the number 128 in binary is extremely simple to find as it is a power of two.
128 = 10000000(Binary)
The eighth place in a binary number is worth 128 just as the eighth place of the decimal system is worth 10million.
Now what we must do is take 150 and subtract what we have already, 128 which gives us with 22.
We now have to repeat the process above until we finish the number.
16 or 2^4 is closest to 22 which means it is 1 and four 0s, or 1000. Let’s add that into what we got before (10000000) and we get 10010000. Now we only have 6 left. Highest is 4 or 2^2 or 100 which makes our number 10010100. The 2 left we have is 2^1 or 10 which finally completes our number as 10010110.
Notice that the place the 1 goes for 2^n is n+1. Example: The place for 2^6 is the 7th place from the right.
Now try these on your own and check your answers at the bottom of this post.
1. 203
2. 450
3. 789
4. 1337
Adding Binary Numbers
Adding binary numbers is very easy as it follows the exact same steps as adding decimal numbers. Example:
That basic addition is pretty simple yes? You add binary numbers the same way.
As you can see, this is just like decimal addition. When you have two 1s in the same column, it equals a 1 in the column next to it. Example:
100 = 4
10 = 2
Just as is the decimal system, 0s are just place holders and mean nothing. As you can see, each place you go to the left, the value of that place doubles. Another way of looking at 1s and 0s is true or false. Example:
1001 = 9
If you were to think of this as:
TFFT
Then you see that the 4th place worth 8 is true. The places that are worth 4 and 2 are false and finally the place worth 1 is true. To find the value, you just add all the true values together.
Now in this problem you see some places with three 1s. No problem. This just means that there is 3 times the value of that place, just like when you have two 1s it’s worth 2 times the value of that place. So you just carry over two of them to the next left place and keep one where it is.
What if there are more than three 1s? If there are 4, you carry over two 1s, and then deal with that place as you would normally. If it has 5, you carry 2 and leave one where it is. This is just like adding in the decimal system, but it is more confusing since you do not use binary every day.
Now try these problems on your own and check your answers at the end of the post.
5. 110 + 111
6. 10100 + 11101
7. 10011 + 100101 + 1010011
8. 1111 + 11001 + 11111 + 1010
Multiplying Binary Numbers
Just like addition, multiplying binary numbers works just like multiplying decimal numbers. Example:
That’s like third grade math? Binary is the same thing, except you get a ton of 0s. Just like in the decimal system, if you multiply anything by 0, you get zero. So, the only time you get a 1 is when you do 1x1. The only hard part about this is that you get a ton of zeros and you have to keep the number of zeros you add to the beginning correct. Example:
Notice now you only get two 1s out of that entire problem. Try these on your own and check your answers at the bottom.
9. 1001 * 1010
10. 1110 * 10011
11. 10101 * 10110
12. 110011 * 111011
Answers
1. 11001011
2. 111000010
3. 1100010101
4. 10100111001
5. 1101
6. 110001
7. 10001011
8. 1010001
9. 1011010
10. 100001010
11. 111001110
12. 101111000001



















