TopMyGrade

GCSE/Computer Science/AQA

CS3.2Converting between number bases: 8-bit unsigned binary ↔ denary; binary ↔ hexadecimal; denary ↔ hexadecimal

Notes

Converting between number bases

You must be able to convert between denary (decimal), binary and hexadecimal confidently — and AQA expects 8-bit unsigned binary work in particular. The methods are quick once you've practised.

Binary → denary (decimal)

Write the place values above each bit and add the values where the bit is 1.

Place: 128  64  32  16   8   4   2   1
Bits:    1   0   1   1   0   0   1   0

Add: 128 + 32 + 16 + 2 = 178.

Denary → binary (8-bit)

Two reliable methods.

Method A — subtract place values. Take the largest power of 2 ≤ the number. Subtract. Repeat.

Convert 178 to binary:

  • 178 - 128 = 50, place a 1 in the 128 column.
  • 50 - 32 = 18, place a 1 in the 32 column.
  • 18 - 16 = 2, place a 1 in the 16 column.
  • 2 - 2 = 0, place a 1 in the 2 column.
  • All other columns are 0.
  • Result: 10110010.

Method B — divide by 2 repeatedly. Read remainders bottom up.

178 ÷ 2 = 89  r 0   (LSB)
 89 ÷ 2 = 44  r 1
 44 ÷ 2 = 22  r 0
 22 ÷ 2 = 11  r 0
 11 ÷ 2 = 5   r 1
  5 ÷ 2 = 2   r 1
  2 ÷ 2 = 1   r 0
  1 ÷ 2 = 0   r 1   (MSB)

Reading remainders bottom-up: 10110010.

Pad with leading zeros to 8 bits if needed.

Binary → hex

Group the bits into nibbles of 4, starting from the right, then convert each nibble.

Convert 10110010:

  • Right nibble: 0010 = 2.
  • Left nibble: 1011 = 8 + 2 + 1 = 11 = B.
  • Result: B2.

If the number of bits isn't a multiple of 4, pad with leading zeros.

Hex → binary

Replace each hex digit with its 4-bit binary form. Always 4 bits per digit — pad with leading zeros if needed.

Convert 4F:

  • 4 = 0100
  • F = 1111
  • Result: 01001111.

Denary → hex

Two methods.

Method A — go via binary. Convert to binary, group into nibbles, convert each nibble.

Method B — divide by 16. Read remainders bottom-up.

Convert 254 to hex:

  • 254 ÷ 16 = 15 r 14 → E (LSB)
  • 15 ÷ 16 = 0 r 15 → F (MSB)
  • Result: FE.

Hex → denary

Multiply each digit by its place value (powers of 16) and sum.

Convert C3:

  • C is in the 16s column: 12 × 16 = 192.
  • 3 is in the 1s column: 3 × 1 = 3.
  • Total: 195.

Quick reference table

DecimalBinaryHex
000000
501015
101010A
151111F
161000010
64100000040
1281000000080
25511111111FF

Memorise the bottom row — it appears constantly.

Common mistakesPitfalls

  1. Grouping nibbles from the wrong end. Always group binary → hex starting from the right.
  2. Forgetting to pad to 8 bits. Many AQA questions specify "8-bit unsigned" — pad with leading zeros.
  3. Treating A as 11. A=10, B=11. Easy to slip.
  4. Reading remainder lists upside down. Remainders are read bottom-up (LSB at top of the list).
  5. Confusing place values. In hex, the second column is 16, not 10. In binary, the third column is 4, not 3.

Worked exampleWorked example — full conversion

Convert decimal 173 to binary and hex.

Binary (subtract place values): 173 - 128 = 45 → 1 45 - 32 = 13 → 1 13 - 8 = 5 → 1 5 - 4 = 1 → 1 1 - 1 = 0 → 1 Other columns 0. Result: 10101101.

Hex (group into nibbles): 1010 1101 = A D = AD.

Verify: A×16 + D = 160 + 13 = 173. ✓

AI-generated · claude-opus-4-7 · v3-deep-computer-science

Practice questions

Try each before peeking at the worked solution.

  1. Question 12 marks

    Binary to denary

    Convert the 8-bit binary number 10100101 to denary.

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-deep-computer-science

  2. Question 23 marks

    Denary to binary

    Convert the denary number 99 to 8-bit binary.

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-deep-computer-science

  3. Question 33 marks

    Binary to hex

    Convert the 8-bit binary number 11010110 to hexadecimal.

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-deep-computer-science

  4. Question 43 marks

    Hex to binary

    Convert the hex number 7B to binary.

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-deep-computer-science

  5. Question 53 marks

    Denary to hex

    Convert the denary number 200 to hexadecimal.

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-deep-computer-science

  6. Question 63 marks

    Hex to denary

    Convert the hex number 3F to denary.

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-deep-computer-science

  7. Question 74 marks

    Multi-step conversion

    A web colour is given as the hex code FF. Express its denary value, and explain how you would write FF as 8-bit binary.

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-deep-computer-science

Flashcards

CS3.2 — Converting between number bases

12-card SR deck for AQA GCSE Computer Science topic CS3.2

12 cards · spaced repetition (SM-2)