## 3. Converting decimal numbers to binary step-by-step

On the previous page we saw some examples of denary numbers which had been converted to binary numbers.

You can convert any positive decimal number from 0 to 255 into an eight digit binary number.

We are going to look at one step-by-step method of reliably doing this conversion below.

We will use denary number 211 in our example.

Step 1.

Start off with an empty table like the one below:

 128 64 32 16 8 4 2 1 0 0 0 0 0 0 0 0

This is equivalent to the binary number: 00000000

Step 2.

Is 211 larger than 128?

If yes, put a 1 underneath 128 in the table, if not, leave it at 0

 128 64 32 16 8 4 2 1 1 0 0 0 0 0 0 0

Step 3.

As we put a 1 under 128, subtract 128 from 211 to see what is left.

211 - 128 = 83

Step 4.

We have 83 left.

Is 83 larger than 64? If yes, put a 1 in the space under 64, if not, leave it at 0

 128 64 32 16 8 4 2 1 1 1 0 0 0 0 0 0

Step 5.

We started with 83 and we put a 1 under 64. Thus, subtract 64 from 83 to see what is left:

83 - 64 = 19

Step 6.

We have 19 left.

Is 19 larger than 32? If yes, put a 1 in the space under 32, if not, leave it at 0

 128 64 32 16 8 4 2 1 1 1 0 0 0 0 0 0

Step 7.

As 19 was NOT larger than 32, we left it at 0.

Is 19 larger than 16? If yes, put a 1 in the space under 16, if not, leave it at 0

 128 64 32 16 8 4 2 1 1 1 0 1 0 0 0 0

Step 8.

We started with 19 and we put a 1 under 16. Thus, subtract 16 from 19 to see what is left:

19 - 16 = 3

Step 9.

We have 3 left.

Is 3 larger than 8? If yes, put a 1 in the space under 8, if not, leave it at 0

 128 64 32 16 8 4 2 1 1 1 0 0 0 0 0 0

Step 10.

As 3 was NOT larger than 8, we left it at 0.

Is 3 larger than 4? If yes, put a 1 in the space under 4, if not, leave it at 0

 128 64 32 16 8 4 2 1 1 1 0 1 0 0 0 0

Step 11.

As 3 was NOT larger than 4, we left it at 0.

Is 3 larger than 2? If yes, put a 1 in the space under 2, if not, leave it at 0

 128 64 32 16 8 4 2 1 1 1 0 1 0 0 1 0

Step 12.

We started with 3 and we put a 1 under 2. Thus, subtract 2 from 3 to see what is left:

3 - 2 = 1

Step 13.

Is 1 larger than 0? If yes, put a 1 in the space under 1, if not, leave it at 0

 128 64 32 16 8 4 2 1 1 1 0 1 0 0 1 1

Using the method above, the denary number has been converted into binary: 11010011

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: Denary Numbers