Lesson 4: Binary Numbers
The binary number system, which computers use to store and process information, only uses two digits: 0 and 1. In fact, the bi in binary comes from the Latin prefix meaning two. Binary is a base 2 number system. The 2 represents the number of digits the system uses.
Compare this to the decimal number system you use. The decimal system includes 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Its name also tells you how many digits it includes, as dec comes from the Latin prefix meaning ten. The decimal system is a base 10 number system.
So, if you saw the number 100, how would you know if it was in base 2 or base 10?
In math, a little subscript number is added to the right-most number in a set to tell you what base system the number set is in. When you see a number written as 1002, the little 2 lets you know the set of numbers is in base 2, or binary. If you see a number written as 10010, the little 10 tells you that the set of numbers is in base 10, or decimal.
Reading Binary Numbers
Reading binary numbers is different than reading decimal numbers. In the decimal system, you read all the numbers together at once as a whole number¬—1, 10, 100. But in binary, you read the numbers like a math equation. You have to solve a math problem for each individual number, or bit, and then add all the individual answers together to find out what the total whole decimal number equivalent is.
For example, in decimals, 1010=10, but in binary, 102=2!
To read a binary number, first you need to look at the placement of each 1 and 0, and you always read binary numbers from right to left.
In decimal (base 10) numbers, you have a 1s place, a 10s place, a 100s place, and so on to represent value. Each place is 10 times greater than the place before it. The binary system (base 2) has places, or columns, too. As binary only has two numbers, each place is worth double (two times) the one before it.
Binary places also have slightly different names. The right-most value in a binary number is your starting value, and it is in the “zero place.” The next place to the left is considered the “first place” because you’ve moved one spot from the start. The next place to the left after that is the “second place” because it is two spots over from the start.
Why does the place of the number matter?
Let’s look at an example, the binary number 1002.
- Starting at the right with the zero place, we see the number 0, which is also worth 0.
- Moving one place to the left (the first place), we see another 0. If we double 0, we still get a value of 0, as 0x2=0.
- Next, we move one more place to the left (the second place), and we see a 1. Since the 1 is two spots away from the start, to determine its decimal value, we have to double its value twice: 1+1=2, then 2+2=4. So, in binary, the 1 in 1002 is worth 4.
- Finally, we add the values of all three binary numbers together to find out the total whole decimal equivalent: 4+0+0=4. Therefore, 1002 is the same as decimal number 4, or 410.
Tips for converting binary numbers to decimal numbers:
- Read binary numbers like a math equation.
- Treat each number like its own math problem. Once you’ve solved each individual math problem, add all the individual answers together to get the answer.
- In binary, a number doubles its value each time it moves a place to the left. The place of the bit, the 1 or the 0, tells you how many times you need to double the number.
- Always read binary numbers from right to left.
Try lesson 1: Finding decimal and binary number equivalents.
Try lesson 2: Converting decimal numbers to binary numbers.