To understand how computers use binary and why binary works we need to step back momentarily. Lets think about how numbers and counting works in the way we are used to.

Base 10

When we start counting, we start with zero (it’s tempting to say we start counting at “one” but if you think about it, in order to get to one we have to start at zero). We then begin counting up through the digits, on up to 9. What happens when we try to pass 9, what digit comes next? (“Ten!” I hear you say).

In our decimal number system there are ten digits, that is 0 through to 9. After 0 comes 1, and then 2 and so on, each digit has a value of one more than the previous digit. There are no digits left when we pass 9 so we write down a zero and then we put a 1 in front of it, 10 (“ten!”).

What does “10” mean?

Now we have two columns, each containing a digit. The ‘zero’ on the right denotes the quantity of ‘ones‘ that we have.

Image showing the number 10 with the 1 and 0 separated. The 0 indicates that there are zero "ones" and the 1 indicates that there is one "ten".

The ‘one’ in the left column represents the number of ‘tens’. So we have one ten and zero ones. “Ten”!

Lets say we continue our counting. Before too long we will reach 99. (Nine tens and nine ones, “ninety nine”!).

This image shows the largest base ten number that can be made with two digits, 99.
There is a 9 under the Ones column and a 9 under the tens column. It is not possible to represent a larger number than 99 using only 2 digits.

After ninety nine is one hundred! That is, a zero in the ones column, a zero in the tens column and we have just added a new column called the hundreds.

This image shows the next value after 99. The 9 "ones" has 'rolled over' to zero as has the 9 "tens".
A new column has been added which has a place value ten times more than the previous tens. This is the "hundreds" column and it contains the digit 1.

Every time we run out of available digits (i.e. we get to 9 in all the columns we have got) we add a one in a new column in front that is worth ten times more than the previous column and roll the preceding columns back to zero.

Each column is worth ten times more than the previous column and we have ten available digits. So we say our counting system is based on ten; “Base 10”.

Binary

Binary only has two available digits, 0 and 1. So each column starts at 0 and goes up to 1. Once you reach 1 you cannot go any higher so you have to put a 0 in the current column and add a new column to the left with a 1.

  • In decimal (base ten) each column is worth ten times the last column because there are ten digits.
  • In binary (base two) each column is worth two times the last column because there are two digits.

If that idea makes sense to you then you can probably skip down to the next section “the binary number line“. If not, then read on!

Counting in Binary (also called Base 2) is exactly the same as counting in decimal (Base 10), except for one key difference. In binary there are only two digits!

  • Just like decimal, we start at zero.
  • After zero, the next digit is one.

Now there is a problem, there are no more digits! So we put down a zero and add a 1 to the next column.

10

What does this “10” in binary mean? It does not mean “ten”, at least, not “ten” in the way we are used to.

  • The first column is the ones column. In the binary number “10” we are saying that there are zero (0) ones.
  • The next column is the twos column.

“10” means that we have zero “ones” and one “two“: 0+0=2!

Lets continue the counting.

  • After “10” we can write “11”. That means there is one “two” and one “one”. That makes three!
  • Now we have a problem because there are no more digits. So we need to put zero in the “ones” column, put a zero in the “twos” column and we add a 1 in the next column along.

100

Does this binary “100” mean “one hundred”? No!

  • We have a zero in the ones column, so no ones.
  • We have a zero in the twos column, so no twos.
  • We have a one in the fours column, so one four: 0+0+4=4!

If we continue counting from here we will have:

  • 101 : One one, zero twos and one four = 1 + 0 + 4 = 5
  • 110 : No ones, one two and one four = 0 + 2 + 4 = 6
  • 111: One one, one two and one four = 1 + 2 + 4 = 7

Once again we have a problem. We have run out of digits. So what do we do?

1000

Hopefully by now you have realised that binary “1000” is not a thousand. This means we have:

  • No ones, no twos, no fours and one eight. So binary “1000” is eight!

We can carry on counting up like this forever so this particular explanation will stop here.

An animation showing binary values counting up from 0 to fifteen and beyond, Binary is Base Two, the highest digit is 1 and the place value of each column is two times more than the previous column.

Notice how the place value of each column in two times more than the previous column.

  • We start with a ones column, but instead of tens, the next column in twos
  • The next column after the twos is twice the previous column, so it is the fours, then the eights, then the sixteens, thirty twos, sixty fours, one hundred and twenty eights and so on forever.

The Binary Number Line

1286432168421
The binary number line: Remember to start with “1” on the right and keep on doubling!

This is a very useful tool for understanding and converting binary to decimal and vice versa.

Imagine we have the decimal number 199 and I want to express this as a binary value. We can use the binary number line to help us.

  • We need to a “1” under each of the numbers we need to add together to give us 199 and a “0” under the numbers that we do not need to add.
1286432168421
11000111
To make 199 using these numbers we need to add together 128, 64, 4, 2 and 1: (128+64+4+2+1 = 199)

So the decimal number 199 in binary is 11000111.

What would happen if I wanted to make the number 256? If I add together all of these numbes on the number line then the biggest number I can get is 255. So to get to 256 I would need to add a new column in front of the 128 column. This new column would be the 256 column.

You can also easily go the other way. For example, if you needed to convert binary 10101010 into decimal, put the ones and zeroes in the relevant columns and we have: 128 + 32 + 8 + 2 = 170

By admin