What is the binary system?
The word “binary” describes a system that has only two possible digits. To understand this, let’s first compare this to a system you’re probably more familiar with, the Decimal system.
The word “decimal” describes a system that has ten possible digits. These are the digits 0 through 9. Every number expressed in the decimal system is a combination of these ten digits. You use the decimal system every day, it comes naturally, we all have 10 fingers and 10 toes (unless your family tree doesn’t fork, but let’s not go there), and some of us use those 10 fingers and toes extensively to help with every day addition and subtraction.
The binary system works essentially the same way, with the only difference that it only has two digits. These are visually expressed by the digits 0 and 1. Every number expressed in the binary system is a combination of these two digits.
Why do we need the binary system?
The binary system is essential in technology. The reason is that any electronic circuit can have only two possible states, on or off. A simple example is the light in your room. The switch has only two options, on or off. Another example of a binary system would be Morse code. It also works with only two digits, a dot or a dash. Anything expressed in Morse code is done with these two digits. Electronic circuits work the same way, they are either on or off. And every sequence of these two signals has a certain meaning. Every communication that takes place inside your computer uses this binary system.
How does it work?
If you’re not used to them, binary numbers look pretty strange. Here’s an example:
1 0 1 0 1 1 1 0
So what is this number in the decimal system? Converting binary numbers to decimal numbers is not that difficult if you know the secret
The secret of the binary system?
The first thing to know is that you read binary numbers from right to left. The second thing you need to understand is that each digit is based on a power of the number 2. Check this out:
2 to the power of 0 equals 1
2 to the power of 1 equals 2
2 to the power of 2 equals 4
2 to the power of 3 equals 8
2 to the power of 4 equals 16
2 to the power of 5 equals 32
2 to the power of 6 equals 64
2 to the power of 7 equals 128
…
2 to the power of 1 equals 2
2 to the power of 2 equals 4
2 to the power of 3 equals 8
2 to the power of 4 equals 16
2 to the power of 5 equals 32
2 to the power of 6 equals 64
2 to the power of 7 equals 128
…
See the pattern? Now let’s take these numbers to use them as a template while remembering that binary numbers are read from right to left:
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Now let’s use this template on that ugly binary number from our earlier example. At the top is our template, at the bottom is our binary number:
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
1 | 0 | 1 | 0 | 1 | 1 | 1 | 0 |
Now we use simple multiplication and addition. If the binary number is a 1, it means this digit is “on” or “true” and we add the corresponding number from the template, if it is a 0, it means the digit is “off” or “false”, and we do not add the corresponding number from the template.
In our example, the digits for 128, 32, 8, 4 and 2 are true, so we add
128 + 32 + 8 + 4 + 2 = 174
You could also express it as
128*1 + 64*0 + 32*1 + 16*0 + 8*1 + 4*1 + 2*1 + 1*0 = 174
This means our binary number 10101110 is the number 174 in the decimal system.
No comments:
Post a Comment