← IGCSE Computer Science Paper 1

Number of colours from the colour depth

A colour depth of n bits gives 2^n different colours, so each extra bit doubles the number. For example, 2 bits give 4 colours and 8 bits give 256 colours.

Understanding Number of colours from the colour depth in IGCSE Computer Science Paper 1

What it does: 2 bits make the combinations 00, 01, 10 and 11, which is 2^2 = 4 colours. Each extra bit multiplies the colours by 2, so 2^4 is double 2^3 (16 is double 8). 2^8 = 256. Each pixel uses 8 bits, so there are 256 different bit patterns. The number of colours is 2 to the power n. For example, 3 bits give 2^3 = 8 colours, but 3^2 would wrongly give 9. 1 bit can be 0 or 1, so 2^1 = 2 colours. This is the same as how many values n bits can store. Adding one bit always doubles the colours: 2^2 = 4 and 2^3 = 8, so 4 more colours are added.

Common mistakes: The program should output the number of colours, which is stored in colours. Outputting depth would only show the number of bits (3), not the 8 colours. It should be OUTPUT colours. Each extra bit doubles the number of colours, so the loop must multiply by 2, not add 2. It should be colours ← colours * 2, which gives 4 colours for 2 bits.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 43–58) and word search (Modules 28–58).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
A colour depth of 2 bits allows how many different colours?
2 colours4 colours
Matches
colours = 2 * n (n = 8 gives 16 colours)
↓
The colours are found by multiplying n by 2, but the correct rule is 2 to the power n. 8 bits give 2^8 = 256 colours, not 16.
Applying
Meanings
Term
colours = 2^n
Meaning
A colour depth of n bits gives 2^n different colours, so each extra bit doubles the number. For example, 2 bits give 4 colours and 8 bits give 256 colours.
Practice
depth ← 8
Testing
Gaps
colours = 2 bits
Check Answer
Spots
3OUTPUT "Colours:"
4OUTPUT depth

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Nebula Cat' badge — Orbit Debugger, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. A colour depth of 2 bits allows how many different colours?
A. 4 colours ✓
B. 2 colours
2 bits can make 2^2 = 4 different patterns (00, 01, 10, 11), so there are 4 colours. Do not stop at the number of bits.
2. A colour depth of 8 bits allows how many different colours?
A. 64 colours
B. 256 colours ✓
2^8 = 256. Each pixel uses 8 bits, so there are 256 different bit patterns.
3. Which formula gives the number of colours for a colour depth of n bits?
A. 2^n ✓
B. n^2
The number of colours is 2 to the power n. For example, 3 bits give 2^3 = 8 colours, but 3^2 would wrongly give 9.
4. An image has its colour depth increased from 3 bits to 4 bits. What happens to the number of colours?
A. It doubles from 8 to 16 ✓
B. It goes up by 1 from 8 to 9
Each extra bit doubles the number of colours. 2^3 = 8 and 2^4 = 16.
5. A colour depth of 1 bit allows 2 colours, for example black and white. True or false: 1 bit can store 1 colour only.
A. True: 1 bit gives 1 colour
B. False: 1 bit gives 2 colours ✓
1 bit can be 0 or 1, so 2^1 = 2 colours. This is the same as how many values n bits can store.

Match the Pairs

colours = 2^n → A colour depth of n bits gives 2 to the power n different colours
2^8 = 256 → An 8-bit colour depth allows 256 different colours
A 2-bit colour depth gives 4 different colours → 2^2 = 4
Adding one extra bit doubles the number of colours (3 bits to 4 bits: 8 to 16 colours) → 2^4 = 2 * 2^3
colours = 2 * n (n = 8 gives 16 colours) → The colours are found by multiplying n by 2, but the correct rule is 2 to the power n. 8 bits give 2^8 = 256 colours, not 16.
2 bits = 2^3 = 8 colours → The wrong power was used. The power is the number of bits, so 2 bits give 2^2 = 4 colours.

Key Term

colours = 2^n
A colour depth of n bits gives 2^n different colours, so each extra bit doubles the number. For example, 2 bits give 4 colours and 8 bits give 256 colours.

Fill in the Blanks

1. colours = 2 ^ bits
Hint: Type the operator that means 'to the power of'.
2. 2 bits give 2 ^ 2 = 4 colours
Hint: Work out two to the power of two and type the number of colours.
3. 8 bits give 2 ^ 8 = 256 colours
Hint: Work out two to the power of eight and type the number of colours.
4. bits = bits + 1 colours = colours * 2
Hint: Adding one bit multiplies the number of colours by this number.
5. bits = 4 colours = 2 ^ bits print(colours)
Hint: Type the base number that is raised to the power of the colour depth.

Spot the Error

Question 1
A depth ← 3
B colours ← 2 ^ depth
C OUTPUT "Colours:"
D OUTPUT depth
Line D — The program should output the number of colours, which is stored in colours. Outputting depth would only show the number of bits (3), not the 8 colours. It should be OUTPUT colours.
Question 2
A colours ← 1
B FOR i ← 1 TO 2
C colours ← colours + 2
D NEXT i
E OUTPUT colours
Line C — Each extra bit doubles the number of colours, so the loop must multiply by 2, not add 2. It should be colours ← colours * 2, which gives 4 colours for 2 bits.
Question 3
A depth ← 8
B colours ← depth ^ 2
C OUTPUT colours
Line B — The formula is 2 to the power of the colour depth, so the base is 2 and the power is the depth. It should be colours ← 2 ^ depth, giving 256, not depth ^ 2, which gives 64.
Question 4
A INPUT colours
B colours ← 2 ^ bits
C OUTPUT colours
Line A — The user should enter the colour depth (bits), which is then used in the calculation. Inputting colours leaves bits with no value. It should be INPUT bits.
Question 5
A old ← 2 ^ 2
B new ← 2 ^ 3
C ratio ← new - old
D OUTPUT ratio
Line C — To show that one extra bit doubles the colours, divide the new number of colours by the old number (8 / 4 = 2). It should be ratio ← new / old, not subtraction.

Student with a class code? Join your class →