1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

What is Binary?

How do you read and write binary numbers?

By

Binary Numbers
When you learn most types of computer programming, you will touch upon the subject of binary numbers. Although this is a simple concept once explained, it is not always obvious how to read them. To understand binary numbers, let's first look at our normal system of base 10 numbers.

Let's take the number 345 for example. This is a three digit number. We know that the farthest right number, 5, represents the 1's column, and there are 5 ones. The next number from the right, the 4, represents the 10's column. There are 4 clicks in the 10s column, which we interpret as forty. Finally, the third column that contains the 3 represents the 100s column, and we know it to be three hundred.

Binary works in the same way. Each column represents a value, and when you have enough you move to the next column. The difference is that in our base 10 system we need to have 10 before we move to the next column. We can have any value 0-9, but once it goes above that, we add a column. In base two, you can only have 0 or 1 before moving on to the next column.

The number one is represented as 1 in both base ten and binary, so let's move on to the number two. In base ten this is represented as a 2, however in binary we can only have a 0 or a 1 before moving on to the next column. The number 2 is written as 10. This means 1 in the 2s column and 0 in the 1s column.

Let's take a look at the number three. Obviously in base ten it is written as 3. In base two (binary) it is written as 11. This means a 1 in the 2s column and a 1 in the 1s column. 2+1 = 3.

Each slot represents a value that is double the last value. The chart on this page helps to demonstrate this. The values of slots, starting on the right are 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, etc.

Now that we know how binary works, reading it is simply a matter of doing some simple math. Let's try a few:

1001
Since we know the value's each of these slots represent, then we know this number represents 8 + 0 + 0 + 1. In base ten this would be the number 9.
11011
Again we can calculate what this is in base ten by adding the values of each slot. In this case it would be 16 + 8 + 0 + 2 + 1. This would be the number 27.
  1. About.com
  2. Technology
  3. PHP / MySQL
  4. Programing Glossary
  5. What is Binary?

©2014 About.com. All rights reserved.