How Do Binary Numbers Work?
Decimal and binary numbers
Decimal numbers are all around us. Every time we count something, look at a clock or adjust the temperature on the oven, we're dealing with decimal numbers.
What a lot of people don't realise, however, is how important a role binary numbers also play in our lives. When you switch on your computer, glance at your phone or digital watch or set the Ti-Vo box to record, these devices are using a digital data system based upon binary numbers.
So what are these binary numbers, and why are they so important? In this article, we will take a look at the answers to these questions and more.
What a lot of people don't realise, however, is how important a role binary numbers also play in our lives. When you switch on your computer, glance at your phone or digital watch or set the Ti-Vo box to record, these devices are using a digital data system based upon binary numbers.
So what are these binary numbers, and why are they so important? In this article, we will take a look at the answers to these questions and more.
The construction of decimal numbers
Before delving into how binary numbers are constructed, it helps to have a full understanding of the composition of the decimal numbers we use on a daily basis. The decimal system takes its name from the root "dec-", meaning 10, in Latin. It's so-called as it comprises 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
When we count upwards from 0, we start counting through these numbers. As we don't have a single digit to denote the number 10, we write this by moving into a second column on the left and starting our right-hand count at 0 again, i.e., 10, 11, 12, 13, etc. Once we reach 20, we increase our left-hand column to 2 to denote that we have counted through two 10s and then continue as before.
The same thing happens when we reach 99 and want to continue. We have run out of digits to show how many 10s we have, and so move over a column to the left and start our count again, but this time with a 1 in the left-most column, i.e., 100, 101, 102, 103, etc.
This keeps repeating forever. Once all of our columns have reached 9, we start a new column on the left with a 1 and reset our previous columns back to 0.
Because we shift one column to the left each time we reach 10, we have each column worth 10 times as much as the one to its right. In a seven-digit number, the first column is worth millions, the second column 100 thousands, then 10 thousands, thousands, hundreds, tens and finally the units in the right-hand column.
You can see this demonstrated in the picture below.
When we count upwards from 0, we start counting through these numbers. As we don't have a single digit to denote the number 10, we write this by moving into a second column on the left and starting our right-hand count at 0 again, i.e., 10, 11, 12, 13, etc. Once we reach 20, we increase our left-hand column to 2 to denote that we have counted through two 10s and then continue as before.
The same thing happens when we reach 99 and want to continue. We have run out of digits to show how many 10s we have, and so move over a column to the left and start our count again, but this time with a 1 in the left-most column, i.e., 100, 101, 102, 103, etc.
This keeps repeating forever. Once all of our columns have reached 9, we start a new column on the left with a 1 and reset our previous columns back to 0.
Because we shift one column to the left each time we reach 10, we have each column worth 10 times as much as the one to its right. In a seven-digit number, the first column is worth millions, the second column 100 thousands, then 10 thousands, thousands, hundreds, tens and finally the units in the right-hand column.
You can see this demonstrated in the picture below.
So how does binary work?
Binary numbers are constructed in a similar way to decimal but with one major difference. Instead of 10 digits, we only use two: 0 and 1.
This means that we now have to move over to the left by one column each time we want to count to 2.
Let's build the first few binary numbers to demonstrate this:
This means that the first column from the right is counting how many ones there are; the second column is counting twos; the third column is counting fours; then eights and so on in increasing powers of 2.
This means that we now have to move over to the left by one column each time we want to count to 2.
Let's build the first few binary numbers to demonstrate this:
- Decimal 0 = Binary 0
- Decimal 1 = Binary 1
- Decimal 2 = Binary 10 (we don't have an individual digit above 1, so in order to count higher, we start a new column and reset our right-hand column to 0).
- Decimal 3 = Binary 11 (we have just increased our right-hand column by 1 as we would in decimal).
- Decimal 4 = Binary 100 (we can't increase either of the 1s in 11, so we move over one column and reset the right-hand columns)
- Decimal 5 = Binary 101 (we now continue with the right-hand columns as before)
- Decimal 6 = Binary 110
- Decimal 7 = Binary 111
- Decimal 8 = Binary 1000 (again, as soon as our columns fill with 1s, we create a new column and reset the existing right-hand columns).
This means that the first column from the right is counting how many ones there are; the second column is counting twos; the third column is counting fours; then eights and so on in increasing powers of 2.
The composition of a binary number
Take a look at the image above. It shows the binary number 1 011 001.
To convert this back into decimal, we remember that each column is worth twice the column to its right; hence, they are going up in powers of two, starting with 20 = 1 for the first column and going up until we have 26 = 64 in the seventh column.
Our number is therefore:
1 × 64 + 0 × 32 + 1 × 16 + 1 × 8 + 0 × 4 + 0 × 2 + 1 × 1 = 89.
Just like any decimal number can be calculated by counting up consecutive powers of 10, our binary numbers can be calculated by counting consecutive powers of 2.
To convert this back into decimal, we remember that each column is worth twice the column to its right; hence, they are going up in powers of two, starting with 20 = 1 for the first column and going up until we have 26 = 64 in the seventh column.
Our number is therefore:
1 × 64 + 0 × 32 + 1 × 16 + 1 × 8 + 0 × 4 + 0 × 2 + 1 × 1 = 89.
Just like any decimal number can be calculated by counting up consecutive powers of 10, our binary numbers can be calculated by counting consecutive powers of 2.
Why is the binary system so important?
The binary system is incredibly important in computing. Our devices work through electricity which comes in two states: on or off. As the binary system only has two values, 0 and 1, it is therefore very easy and quick to duplicate using this system of ons and offs.
For example, each time you press a key on your keyboard, that action is represented within your computer as a binary number, with the on and off of switches representing the 0s and 1s of the binary system.
For example, each time you press a key on your keyboard, that action is represented within your computer as a binary number, with the on and off of switches representing the 0s and 1s of the binary system.
Comments
Do you ever use binary numbers? What about other number systems? Don't forget to leave your comments below.