Basic Binary 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) 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
:O, in your sig, you have 10100111001. Is this some binary you want us to decode? Thanks for teaching this, I always wanted to know how to write binary. This is gonna take a while to remember.
I did have that. No one understood it obviously. Binary is easy. Just remember 2,4,8,16,32,64,128,256,512,1024,2048 etc... Then its easy. And a calculator is nice.
Oh binary, we meet again. Good guide ^^ Already knew it all though. 01000010 01101001 01101110 01100001 01110010 01111001 00100000 01101001 01110011 00100000 01100110 01110101 01101110 00100000 01101111 01101110 01100101 00100000 01010011 01111001 01110100 01101000 01100101 00100001
I read the guide before and forgot what it's all covering but I just want to add: when you get to 2^10 as in 1024, afterwards you just go 1K, 2K, 4K, 8K, 16K and it's same thing basically. Therefore 2^20 is just 1K * 1K = 1MB And 2^16 is same as 1K * 2^6 which is 64 equalling 64KB
Great guide, I used to be interested in binary code because it looks so confusing, but you've made it look easy, thank you! Question: What is binary used for exactly?
Binary is a language understood by the computer and it's mostly important for programmers to understand.
Binary is a number system. Instead of having 10 symbols (0,1,2,3,4,5,6,7,8,9) it has 2 (0,1) which makes computer very easy to make. One means high current zero means low current.