Syllabus & Goals 3 min
Cambridge 1.1 · Number systems Paper 1 · Computer Systems
By the end of this lesson you can:
- Explain why computers represent all data in binary.
- Describe the denary (base 10) and binary (base 2) number systems and their place values.
- Convert a binary number of 8, 12 or 16 bits to denary, showing the working.
Textbook: Chapter 1, §1.1.1–1.1.2 (pp. 2–4)
Recap / Warm-Up 5 min
This is the first lesson of the course, so start from something you already know. You count every day in denary — the base 10 system with the digits 0–9. Computers do not. They use only two digits.
Quick starter
A light switch has two states: off and on. If off means 0 and on means 1, how many different patterns can three switches make?
Reveal the answer
8 patterns — 000, 001, 010, 011, 100, 101, 110, 111. That is 2 × 2 × 2 = 23. Each extra switch doubles the number of patterns. This is exactly how a computer stores numbers.
Key Concept — binary represents data 14 min
1 · Why computers use binary
A computer contains millions of tiny switches (transistors). Each switch is either on or off — nothing in between. On is written as 1 and off as 0. A system with only these two digits is binary.
So every kind of data — numbers, text, sound, images, program instructions — must be converted into binary before the computer can store or process it. The switches are built from logic gates (Unit 10).
1; each one off is a 0. This bank holds 10110101, which is 181 in denary.Diagram · Advaslearning Hub
2 · Denary — base 10
Denary uses ten digits (0–9). Each column heading is a power of 10: units, tens, hundreds, thousands. Moving one column left multiplies the heading by 10.
| 10⁴ | 10³ | 10² | 10¹ | 10⁰ |
|---|---|---|---|---|
| 10 000 | 1000 | 100 | 10 | 1 |
3 · Binary — base 2
Binary works the same way, but each heading is a power of 2. Moving one column left doubles the heading. For an 8-bit number the headings are:
| 2⁷ | 2⁶ | 2⁵ | 2⁴ | 2³ | 2² | 2¹ | 2⁰ |
|---|---|---|---|---|---|---|---|
| 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
4 · Converting binary to denary
Write the binary number under its headings. Each time a 1 appears, add that column's heading to a running total. Ignore every column holding a 0.
The method works for any length. A 12-bit number adds four more headings (256, 512, 1024, 2048); a 16-bit number goes up to 32 768.
Worked Example — binary → denary 12 min
Worked example 1 · an 8-bit number
Question: convert 10110101 to denary. Show your working. [2]
- Write the headings 128 64 32 16 8 4 2 1 above the bits.each bit is only worth something once you know its column.
- Pick out the columns holding a 1: 128 + 32 + 16 + 4 + 1.
- Add them: 128 + 32 = 160; 160 + 16 = 176; 176 + 4 = 180; 180 + 1 = 181.a running total avoids adding five numbers in your head at once.
- Answer: 181. Marks: correct place values added (1); correct answer (1).
Worked example 2 · a 12-bit number
Question: convert 010011010110 to denary.
| Place value | 2048 | 1024 | 512 | 256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Bit | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 |
| Adds | – | 1024 | – | – | 128 | 64 | – | 16 | – | 4 | 2 | – |
- Extend the headings four places left: 2048 1024 512 256 then the usual eight.each new column doubles the one to its right.
- The 1s sit under 1024 + 128 + 64 + 16 + 4 + 2.
- 1024 + 128 = 1152; + 64 = 1216; + 16 = 1232; + 4 = 1236; + 2 = 1238.
- Answer: 1238.
Worked example 3 · a 16-bit number
Question: convert 0010110001101011 to denary.
| Place value | 32768 | 16384 | 8192 | 4096 | 2048 | 1024 | 512 | 256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Bit | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 1 |
| Adds | – | – | 8192 | – | 2048 | 1024 | – | – | – | 64 | 32 | – | 8 | – | 2 | 1 |
- Group the bits in fours to keep your place: 0010 1100 0110 1011.16 digits in a row are easy to misalign; groups of four are not.
- The 1s sit under 8192 + 2048 + 1024 + 64 + 32 + 8 + 2 + 1.
- 8192 + 2048 = 10 240; + 1024 = 11 264; + 64 = 11 328; + 32 = 11 360; + 8 = 11 368; + 2 = 11 370; + 1 = 11 371.
- Answer: 11 371.
The same method as an algorithm
Cambridge pseudocode
// Convert an 8-bit binary string to denary
DECLARE Binary : STRING
DECLARE PlaceValue, Total, Index : INTEGER
Binary ← "10110101"
Total ← 0
PlaceValue ← 128
FOR Index ← 1 TO 8
IF MID(Binary, Index, 1) = "1"
THEN
Total ← Total + PlaceValue
ENDIF
PlaceValue ← PlaceValue DIV 2
NEXT Index
OUTPUT "Denary value is ", TotalThe same algorithm in Python (IDLE)
# Convert an 8-bit binary string to denary binary = "10110101" total = 0 place_value = 128 for bit in binary: if bit == "1": total = total + place_value place_value = place_value // 2 print("Denary value is", total)
Denary value is 181
Try It Yourself 12 min
Goal: convert 00110110 and 00001011 to denary.
Goal: convert 11001100, 10010110 and the 12-bit number 100000000001 to denary. Show the headings you used.
Goal: (a) state the largest denary value a 12-bit number can hold. (b) What is the smallest number of bits needed to store the denary value 1000? Explain how you know.
Hint
With n bits the largest value is 2n − 1. Keep doubling from 1 until you pass 1000.
📝 Exam Practice 10 min
Answer the way the examiner expects — the command word and the marks tell you how much to write.
Explain why computers use the binary number system to represent data.
Mark scheme
- A computer is made of (millions of) switches / transistors / logic gates (1)…
- …that have only two states, on and off, represented by 1 and 0 (1).
Convert the 8-bit binary number 01011101 into denary. Show your working.
Mark scheme
- Working: 64 + 16 + 8 + 4 + 1 (1).
- Answer: 93 (1).
A stopwatch stores the hours, minutes and seconds in three separate 8-bit registers. When it stops, the registers hold the values below. Give the time the stopwatch shows.
| Register | Contents |
|---|---|
| Hours | 00000011 |
| Minutes | 00101101 |
| Seconds | 00010011 |
Mark scheme
- Hours: 3 (2 + 1) (1)
- Minutes: 45 (32 + 8 + 4 + 1) (1)
- Seconds: 19 (16 + 2 + 1) (1)
- So the display reads 03 : 45 : 19.
(a) State the largest denary value that can be stored in 8 bits. (b) State the largest denary value that can be stored in 16 bits.
Mark scheme
- (a) 255 / 2⁸ − 1 (1).
- (b) 65 535 / 2¹⁶ − 1 (1).
Recap & Key Terms 3 min
Computers store everything in binary because their switches have two states. Binary is base 2: each heading doubles, 128 64 32 16 8 4 2 1. To convert binary to denary, add the headings above every 1. The same method works for 12 and 16 bits.
- Bit
- The basic computing element that is either 0 or 1; short for binary digit.
- Binary number system
- A number system based on 2 that can only use the values 0 and 1.
- Denary number system
- A number system based on 10 that uses the digits 0 to 9.
- Byte
- A group of 8 bits.
- Place value (column heading)
- The value of a column; in binary each column is double the one to its right.
- Most / least significant bit
- The left-most bit (largest place value) / the right-most bit (place value 1).
Homework 1 min
Task (≤ 15 min): convert these binary numbers to denary, showing the headings you used: 00111100, 10000001, 11111111 and the 12-bit number 100000000001. [4]
Model answer
00111100= 32 + 16 + 8 + 4 = 60 (1)10000001= 128 + 1 = 129 (1)11111111= 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255 — the largest 8-bit value (1)100000000001= 2048 + 1 = 2049 (1)