UpperGrades

Binary and denary

AQA GCSE Computer Science (8525), specification 3.3.1 Number bases and 3.3.2 Converting between number bases

Computers store everything — numbers, text, images and sound — as binary: patterns of 0s and 1s. Denary is the everyday base-10 number system (AQA's specification calls it decimal). For AQA GCSE Computer Science you need to convert between the two in both directions, for whole numbers from 0 to 255.

What you need to know

  • Binary is base 2: each digit, called a bit, is either 0 or 1. Denary is base 10.
  • Computers use binary to represent all data and instructions.
  • Convert from denary to binary and from binary to denary, for values from 0 to 255 — that is, 8-bit binary numbers from 0000 0000 to 1111 1111.
  • The place values of an 8-bit number, from left to right, are 128, 64, 32, 16, 8, 4, 2 and 1. Each one is double the one to its right.

What you don’t need

  • Negative numbers and two's complement — they're in AQA's A-level, not the GCSE.
  • Fractions and floating point.
  • Values above 255: the largest number you'll be asked to convert is 255, which is 1111 1111.

Worked examples

  1. Convert the denary number 150 into 8-bit binary.

    1. Write out the place values: 128, 64, 32, 16, 8, 4, 2, 1.
    2. Go from left to right, taking each place value that still fits into what's left: 150 − 128 = 22. 64 and 32 don't fit. 22 − 16 = 6. 8 doesn't fit. 6 − 4 = 2. 2 − 2 = 0, and 1 isn't needed.
    3. Write a 1 under each place value you used and a 0 under the rest.

    Answer: 1001 0110 (128 + 16 + 4 + 2 = 150)

  2. Convert the 8-bit binary number 0110 1011 into denary.

    1. Line the bits up under the place values 128, 64, 32, 16, 8, 4, 2, 1.
    2. Add up the place values that have a 1 under them: 64 + 32 + 8 + 2 + 1.

    Answer: 107

Common mistakes

  • Not converting at all — for example, writing 20 as the binary for twenty. Binary only uses 0 and 1: twenty is 0001 0100.
  • Reading the place values the wrong way round. The leftmost bit of an 8-bit number is worth 128, not 1, so 1000 0000 is 128.
  • Counting up in twos (1, 2, 4, 6, 8…) instead of doubling (1, 2, 4, 8, 16…).
  • Dropping leading zeros. Write all 8 bits — 0001 0100, not 10100 — so every bit lines up with the right place value.
  • Not showing working on a two-mark conversion: showing which place values you used can earn a method mark even if the final answer slips.

Practise it

Learn it

Not a subscriber? Watch a sample lesson or see pricing.

Revise next

Written to the published AQA specification. UpperGrades isn’t affiliated with or endorsed by AQA.