鶹Լ

Converting from denary to binary

A method of converting a denary number to binary

There is a very simple method to convert a number into a number. Let’s take the number 199.

Start by writing out the first few binary (128, 64, 32, 16, 8, 4, 2, 1).

1286432168421
128
64
32
16
8
4
2
1

Start at the far left point and say “Can 128 be taken away from 199?”. If it can, do that.

199 – 128 = 71. Because 128 could be taken off, put a 1 in the ‘128’ place value column:

1286432168421
1
1281
64
32
16
8
4
2
1

Now repeat for 64: 71 – 64 = 7

1286432168421
11
1281
641
32
16
8
4
2
1

And again for 32: 7 – 32 won’t work, so put a 0 in that place value column.

1286432168421
110
1281
641
320
16
8
4
2
1

Try again for 16: 7 – 16 won’t work, so add a 0 to that place value column.

1286432168421
1100
1281
641
320
160
8
4
2
1

Next is 8: 7 – 8 won’t work. Add a 0 to the ‘8’ place value column.

1286432168421
11000
1281
641
320
160
80
4
2
1

Try again for 4: 7 – 4 = 3, so add a 1 to the ‘4’ place value column.

1286432168421
110001
1281
641
320
160
80
41
2
1

Next try 2: 3 – 2 = 1, so add a 1 to the ‘2’ place value column.

1286432168421
1100011
1281
641
320
160
80
41
21
1

And finally, 1: 1 – 1 = 0 – add a 1 to the ‘1’ place value column.

1286432168421
11000111
1281
641
320
160
80
41
21
11

This means that 199 as a binary number is 1100 0111.

Note that binary numbers are usually written in blocks of four, separated by a space (eg 0111 1011). In denary, numbers are often written in blocks of three (eg 6 428 721).

A quick way to check whether your binary number is likely to be correct is by looking at the last digit. If the denary number was odd, this last binary digit should be a 1. If it was an even number this binary digit should be a 0.

More guides on this topic