Decimal to Binary Conversion
Decimal to binary conversion
- It is important to know the process of converting from decimal to binary to understand how computers interpret and process data
Example 1
- To convert the decimal number 45 to binary, start by writing out the binary headings from right to left
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
- Start at the leftmost empty column heading (128). Is the decimal number > column heading? (45 > 128) No, put a 0 in the 128 column. Repeat until you put a 1 under a heading. In this example it would be 32
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
0 | 0 | 1 |
- Next subtract column heading from decimal value, 45-32 = 13
- Repeat previous two steps until you have a value under each column heading
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 |
- 32 + 8 + 4 + 1 = 45
- Decimal 45 is 00101101 in Binary
Exam Tip
Don't forget to show your working! Data conversion questions will often be worth 2 marks, 1 for the answer and 1 for your working
Example 2
- To convert the decimal number 213 to binary, start by writing out the binary headings from right to left
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
- Start at the leftmost empty column heading (128). Is decimal number > column heading? (213 > 128) Yes, put a 1 under the heading.
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
1 |
- Next subtract column heading from decimal value, 213-128 = 85
- Repeat process until you have a value under each column heading
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
1 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
- 128 + 64 + 16 + 4 + 1 = 213
- Decimal 213 is 11010101 in Binary
Exam Tip
At GCSE you will only be asked to convert from/to binary up to and including 8 binary digits (8 bits). That means you are working with a decimal range of 0-255 (00000000-11111111)