TopMyGrade

GCSE/Computer Science/AQA

CS3.1Number bases: decimal (denary), binary and hexadecimal; counting in each base

Notes

Number bases

Computers store and process all data as numbers. Humans usually count in base 10 (decimal), but computers use base 2 (binary). Programmers and engineers also use base 16 (hexadecimal) as a more compact way of writing binary. You need to be confident counting in all three bases.

What "base" means

The base (or radix) is the number of distinct digits you use, and the value of each place is a power of that base.

  • Decimal (base 10): digits 0-9; place values 1, 10, 100, 1000, …
  • Binary (base 2): digits 0-1; place values 1, 2, 4, 8, 16, 32, 64, 128, …
  • Hexadecimal (base 16): digits 0-9 and A-F; place values 1, 16, 256, 4096, …

In hex, A=10, B=11, C=12, D=13, E=14, F=15. We need single-character digits for values up to 15.

Counting in binary

0    = 0
1    = 1
10   = 2     (one 2, zero 1s)
11   = 3     (one 2, one 1)
100  = 4
101  = 5
110  = 6
111  = 7
1000 = 8
1001 = 9
1010 = 10
1011 = 11
1100 = 12

Each new column to the left is double the value of the column to its right. To go from binary 1010 to decimal: 8 + 0 + 2 + 0 = 10.

Counting in hex

0..9 → 0..9
A    = 10
B    = 11
C    = 12
D    = 13
E    = 14
F    = 15
10   = 16    (one 16, zero 1s)
11   = 17
1A   = 26    (16 + 10)
FF   = 255   (15×16 + 15)

Two hex digits can represent any value 0-255 — exactly one byte (8 bits).

Why three bases?

  • Decimal is for humans — natural to read and write.
  • Binary is the underlying physical representation in transistors (on/off, 0/1).
  • Hex is a compromise — every hex digit corresponds to exactly 4 bits (a nibble), so it's a compact way to write long binary values. 11111111 (8 bits) becomes FF (2 hex digits).

This is why colour codes (#FF6633), MAC addresses (00:1A:2B:3C) and memory addresses are written in hex.

Bit, nibble, byte

  • Bit (b): a single binary digit, 0 or 1.
  • Nibble: 4 bits — exactly one hex digit.
  • Byte B: 8 bits — two hex digits.

A byte can store 2⁸ = 256 distinct values (0-255 unsigned, or -128 to +127 signed in two's complement — beyond GCSE).

Quick recognition

When you see a number prefix or suffix, it tells you the base:

  • 0b1010 or just 1010₂ → binary
  • 0x1A or 1A₁₆ → hexadecimal
  • No prefix → assume decimal in plain text

Worked exampleWorked example — counting upwards in binary

Add 1 to a binary number by working right to left, flipping bits and carrying.

0011 + 1 = 0100   (carry through three 1-bits)
0111 + 1 = 1000

Common mistakesPitfalls

  1. Forgetting hex letters are 10-15. A is not 11 — A is 10.
  2. Padding wrong. Each binary place is a power of 2 starting from 1 (2⁰), not from 2 (2¹).
  3. Mis-reading hex with similar letters. Be careful with O vs 0 and I vs 1.
  4. Using base notation incorrectly. 10 in any base means "1 of the base + 0 of the units" — so binary 10 = 2, hex 10 = 16, decimal 10 = 10.
  5. Confusing nibble and byte. A nibble is 4 bits, a byte is 8 bits.

Try thisQuick check

Without converting, which is bigger: binary 1011 or hex C?

  • Binary 1011 = 8 + 2 + 1 = 11.
  • Hex C = 12.
  • So hex C > binary 1011.

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

Practice questions

Try each before peeking at the worked solution.

  1. Question 13 marks

    Bases and digits

    State the digits used in (a) binary, (b) decimal, (c) hexadecimal.

    Ask AI about this

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

  2. Question 22 marks

    Why hex?

    Explain two reasons computer scientists use hexadecimal rather than binary.

    Ask AI about this

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

  3. Question 34 marks

    Hex digit values

    State the decimal value of each hex digit: A, C, E, F.

    Ask AI about this

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

  4. Question 42 marks

    Place values

    State the place values of the leftmost four bits in an 8-bit binary number, from highest to lowest.

    Ask AI about this

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

  5. Question 53 marks

    Counting up

    Write the next three numbers in binary after 1100.

    Ask AI about this

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

  6. Question 63 marks

    Counting up in hex

    Write the next three numbers in hex after 19.

    Ask AI about this

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

  7. Question 73 marks

    Bit / nibble / byte

    Define bit, nibble and byte, stating how many bits each holds.

    Ask AI about this

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

Flashcards

CS3.1 — Number bases — decimal, binary and hexadecimal

11-card SR deck for AQA GCSE Computer Science topic CS3.1

11 cards · spaced repetition (SM-2)