13.09
SEO BACKLINKS
binary
Hello, I contacted my friend on Facebook to exchange a review blog.
So the story is that we exchanged review blogs to get to know each other.
What is binary ?
Binary is misunderstood by many of us. Many of us think that binary is very complexe, that humans can’t understand it but it fact binary is so simple that we forgot how to count using base 2 (binary). Binary is using only 2 digits, 1 and 0 (1 ON, 0 OFF). So in binary, there is 0, after there is 1… And after we are back to 0. In base 10 (Decimal), the base we use everyday, there is 0,1,2,3,4,6,7,8,9 and after 9 we have a serie of 10 so we restart counting from 10. Our computers can only calculate using binary. In fact, a program is simply a sequence of 1 and 0 that are guiding the current through the circuit. The job of a compiler is to translate a language like C, C#, BASIC.. in machine language.
Why should I learn counting in binary ?
Today, learning binary may seems obsolete, but it is not. Learning binary is still very usefull for low-level programmers who are using langages like ASM x86, C, BASIC… These languages require a good knowledge of how memory works and some times you might have to manipulate bytes, so knowing how to count in binary can be very usefull in this case. Even if you are a high-level programmer, learning how to count in binary is a plus. It will makes you understand how a computer is counting, how it manipulates the memory and basically, how it “thinks”.
How to convert a decimal number to a binary number ?
For exemple, lets say we want to convert the number 15 in binary (I always take 15 as an exemple because it is a simple number to convert), you first have to find the highest multiple of 2 in 15: (8×1). 15-8=7 so we have a rest of 7. Now we have to find the highest multiple of 2 in 7: (4×1). 7-4=3 so we have a rest of 3. Same thing, let’s find the highest multiple of 2 in 3: (2×1). 3-2=1 we have a rest of 1. Now let’s add all these multiplications:
(8 x 1) + (4 x 1) + (2 x 1) = 14 (rest 1)
(8 x 1) + (4 x 1) + (2 x 1) + (1 x 1) = 15
Our number in binary is underlined. So 15 is equal to 1111 in binary, it is as simple as that.
One important thing you got to know, a binary number finishing by 0 is always an even number and a binary number finishing by 1 is always an odd number. It may be hard the first time you try it but the pratice is the key. Enjoy
Follow this links
Related Posts:
Blog review - What is binary from programmingforbeginners.ca Hello, I contacted my friend on Facebook to exchange a review blog. So the story is that we exchanged review blogs to get to know each other. What is binary ? Binary is misunderstood by many of us. Many of us think that … Read More