Lesson 1 of 6 · Data & Binary

Number Systems

Binary, denary and hexadecimal. How to convert between all three, why each base exists, and where you encounter them in the real world.

Convert between binary and denary using place values
Explain why computers use binary
Use the 4-bit grouping trick to convert hex to binary and back
Convert between hex and denary via binary

Why do computers use binary?

Before you touch a single conversion, answer this first: what is actually inside a computer?

Billions of microscopic transistors, each acting as a switch. A switch has two states: on or off. Not on-a-bit or on-mostly or on-sometimes. Just on or off. Two states. That is it.

Binary has exactly two digits: 0 and 1. A 0 maps to a switch that is off. A 1 maps to a switch that is on. This is why computers use binary -- not because someone chose it arbitrarily, but because the physical hardware that computers are made of can only be in two states.

The key point for exam questions: Computers use binary because transistors (electronic switches inside a processor) can only be in one of two states -- on or off -- which directly map to 1 and 0. Voltage above a threshold = 1. Voltage below = 0.

Every number, letter, image, sound and instruction in a computer is stored as a sequence of 1s and 0s. The rest of this series explores exactly how that works.

Binary and denary

Denary (base 10) is the number system you use every day. It has ten digits: 0 through 9. The position of each digit tells you its value -- units, tens, hundreds, thousands.

Binary (base 2) uses only two digits. The positions work the same way, but instead of powers of 10, you use powers of 2.

Bit position1286432168421
Power of 2 27262524 23222120
Example: 10100101 10 10 01 01
Contribution 12803200401

128 + 32 + 4 + 1 = 165. The binary number 10100101 equals 165 in denary.

Estimation habit: Before you calculate, estimate. Look at the leftmost bit that is a 1. That is roughly the size of the answer. If the leftmost 1 is in the 128 position, your answer is at least 128. If only the rightmost bits are on, the answer is small. Build this habit -- it catches errors before they happen.

Converting denary to binary: the division method

Divide the denary number by 2. Write down the remainder (0 or 1). Divide the result by 2 again. Repeat until you reach 0. Read the remainders from bottom to top.

Example: Convert 38 to binary.

38 ÷ 2 = 19 remainder 0 19 ÷ 2 = 9 remainder 1 9 ÷ 2 = 4 remainder 1 4 ÷ 2 = 2 remainder 0 2 ÷ 2 = 1 remainder 0 1 ÷ 2 = 0 remainder 1 Reading remainders bottom to top: 00100110 Check: 32 + 4 + 2 = 38

Hexadecimal: binary in disguise

Hexadecimal (base 16) uses sixteen digits. The first ten are the usual 0 through 9. Then instead of inventing new symbols, it borrows letters from the alphabet: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.

0
0
0000
1
1
0001
2
2
0010
3
3
0011
4
4
0100
5
5
0101
6
6
0110
7
7
0111
8
8
1000
9
9
1001
10
A
1010
11
B
1011
12
C
1100
13
D
1101
14
E
1110
15
F
1111

Notice that each hex digit maps to exactly 4 binary bits. This is the 4-bit grouping trick and it is the most useful shortcut in this whole topic.

The 4-bit group trick: To convert binary to hex, split the binary into groups of 4 from the right. Convert each group independently to its hex digit. Example: 1010 1101 = A D = AD.

To convert hex to binary, replace each hex digit with its 4-bit binary equivalent. AD = 1010 1101.

Why does hex exist?

Binary numbers are accurate but hard to read. A memory address like 1010110100111011 contains 16 bits and is easy to misread. In hex that is AD3B -- four characters, easier to copy, harder to get wrong. Programmers and engineers use hex as human-friendly shorthand for binary values.

You see hex everywhere: HTML colour codes like #FF6B2B, MAC addresses like A4:C3:F0:1D:2E:88, and memory addresses in debuggers.

Converting hex to denary

Method 1 (via binary): Convert each hex digit to 4 bits, then read the whole binary number using place values. Method 2 (direct): Multiply the left digit by 16, add the right digit.

Example: Convert D7 to denary Method 1 (via binary): D = 1101 7 = 0111 Full binary: 11010111 Place values: 128+64+16+4+2+1 = 215 Method 2 (direct): D = 13, 7 = 7 (13 × 16) + 7 = 208 + 7 = 215

Converting denary to hex

Divide the denary number by 16. The quotient gives the left hex digit; the remainder gives the right hex digit. If either value is 10 or above, convert it to the corresponding letter (10=A, 11=B ... 15=F).

Example: Convert 215 to hex Step 1: 215 ÷ 16 = 13 remainder 7 Step 2: Convert each part to a hex digit: 13 = D 7 = 7 Answer: D7 Check: (13 × 16) + 7 = 208 + 7 = 215 ✓ Example: Convert 172 to hex Step 1: 172 ÷ 16 = 10 remainder 12 Step 2: Convert: 10 = A 12 = C Answer: AC Check: (10 × 16) + 12 = 160 + 12 = 172 ✓

Binary Conversion Trainer

Binary Conversion Trainer

Interactive
Click Bits
Denary to Binary
Hex Explorer
Speed Challenge

Click any bit to toggle it on or off. Watch the denary and hex values update instantly.

0
Hex: 00

Enter a denary number (0-255). The tool shows the division method step by step.

Enter a number above and click Convert.

Toggle bits in either 4-bit group. See how two groups combine to form a 2-digit hex number.

1
0
1
0
A (10)
=
1
1
0
1
D (13)
AD = 173
Press Start to begin
0
Correct
0
Streak
0
Total
Exam Focus
  • Conversion tables: you may be asked to fill in missing denary, binary and hex values in the same table. Practice all three in one go.
  • Show your working on any conversion. A correct answer with no working shown typically loses a mark.
  • Minimum bits questions: "What is the minimum number of bits needed to represent 240 different colours?" Answer: 8 bits (since 27=128 which is too small, 28=256 which is enough).
  • Hex is always written in upper case in mark schemes (D7, not d7). Match this habit.
  • The leftmost bit in an 8-bit binary number has the value 128, not 64. The most common place-value error is shifting the table by one position.

Check your understanding

1. Convert the binary number 01001110 to denary.
68
78
74
82
64+8+4+2 = 78. Notice 01001110: positions 64, 8, 4, 2 are on.
2. What is the hexadecimal value of the binary number 10011100?
8C
B4
9C
A4
Split into groups of 4: 1001 | 1100. 1001 = 9, 1100 = 12 = C. Answer: 9C.
3. Why do computers use binary rather than denary?
Binary uses fewer digits so calculations are faster
Transistors inside processors can only be in two states (on or off), matching binary 1 and 0
Binary was invented before denary
Binary uses less storage space than denary
The physical reason is the key point: transistors have two stable states. This maps directly to binary 1 and 0. Any answer that says "because switches are on or off" earns the mark.
4. What is the minimum number of bits needed to represent 150 different characters?
6 bits (26 = 64)
7 bits (27 = 128)
8 bits (28 = 256)
9 bits (29 = 512)
27=128, which is less than 150, so 7 bits is not enough. 28=256, which covers 150. The minimum is 8 bits.
5. Convert D7 (hexadecimal) to denary.
197
207
215
223
D=13, 7=7. (13×16)+7 = 208+7 = 215. Via binary: 1101 0111 = 128+64+16+4+2+1 = 215.

Think Deeper

Computers use binary because transistors have two states. But why do engineers not build transistors with three stable states, giving computers a base-3 (ternary) system? What would be the advantages and disadvantages?
Ternary transistors have been researched. The advantages would include storing more information per component (log23 ≈ 1.58 bits per trit versus 1 bit per binary transistor), which means fewer components for the same storage. However, the engineering challenge is reliability: distinguishing three voltage levels reliably in noisy, variable conditions is far harder than distinguishing just two. Binary is so robust partly because the gap between 0 and 1 is large -- any small error or noise still gives a clear 0 or 1. With three levels, the gaps between levels are smaller and errors are more likely. The global investment in binary manufacturing infrastructure (billions of pounds) is also a practical barrier to switching.
A 1-byte (8-bit) number can represent 256 different values (0-255). If computers used 10-bit bytes instead, how many values could be represented? How would this affect memory addresses and character encoding?
210 = 1024 values per "byte". Character encoding would be simpler -- basic ASCII, extended ASCII, and many Unicode code points could all fit in a single unit. Memory addresses would grow in range: a 10-bit address space covers 1024 locations. However, all existing hardware, software and data formats are built around 8-bit bytes. Changing the base unit would require redesigning processors, operating systems, file formats and networking protocols simultaneously -- an essentially impossible global upgrade.
Printable Worksheets

Practice what you've learned

Three printable worksheets covering number systems at three levels: Recall, Apply, and Exam-style.

Recall
Worksheet 1
Key term matching + place value table + binary conversions • 20 marks
Apply
Worksheet 2
Conversion calculations with full working + hex colour scenario • 17 marks
Exam-style
Worksheet 3
Extended conversion and evaluation questions • 20 marks
Exam Practice
Lesson 1: Number Systems
5 MCQ with instant feedback + 3 written questions with mark schemes. Work through it like an exam.
Start exam practice Download PDF exam
Next Lesson
Binary Arithmetic
Continue
Teacher Panel
Lesson 1 - Number Systems
Lesson Objectives
State that computers use binary because transistors have two physical states (on/off)
Convert 8-bit binary numbers to denary using place values (128,64,32,16,8,4,2,1)
Convert denary numbers (0-255) to binary using the repeated division method
Use the 4-bit group trick to convert between binary and hexadecimal
Convert 2-digit hex values to denary via binary or direct multiplication
Calculate the minimum number of bits needed to represent n different values
Prerequisite Check
Ask these before starting the lesson:
What does the digit '3' represent in the number 352? (hundreds, tens, units -- to ensure place value understanding)
What is 23? What is 28? (tests comfort with powers of 2)
How many states can a light switch be in? (builds to the transistor analogy)
Timing Guide
0-5 min: Prerequisite check + Binary as switches physical metaphor
5-15 min: Place value table -- binary to denary (work through 3 examples together)
15-22 min: Division method -- denary to binary (2 teacher examples, 2 student practice)
22-30 min: Hexadecimal -- why it exists, 4-bit group trick
30-35 min: Click-Bits tool or Speed Challenge for consolidation
Common Misconceptions
"The leftmost bit has the smallest value" -- it has the LARGEST value (128 in an 8-bit number).
"Hex digits go from 0-F so F = 16" -- F = 15. Sixteen values exist (0-15), and they start at 0.
"Binary and hexadecimal are completely different systems" -- hex is simply a compact way to write binary using the 4-bit groups. Conversion is instant once students know the table.
"Computers use binary because it is simpler to calculate with" -- the reason is physical (transistor states), not mathematical convenience.
"You need 7 bits for 128 values, so 7 bits for 150 values" -- 27=128, which only gives 128 distinct values. 150 requires 8 bits (256 values).
Marking Guidance

Conversion questions: Marks are typically awarded for correct method AND correct answer. A student who shows clear working (division table or place-value table) but makes an arithmetic error may still earn the method mark. Always insist students show working.

Minimum bits questions: The answer must be justified. "8 bits" alone scores 0 on a 2-mark question. "8 bits because 28=256 which is the smallest power of 2 greater than or equal to 150" scores both marks.

Why binary questions: Accept any answer that refers to transistors, switches, or electronic components having two stable states. "Because it is easier" scores 0. "Because computers use switches that can only be on or off" scores the mark.

Error Analysis Activity
Show this to the class: "Convert 156 to binary. Answer: 10011100. Check: 64+16+8+4 = 92. Something is wrong." Ask students to find the mistake.
The student forgot the 128 bit. 156 = 128+16+8+4 = 10011100, and the check should be 128+16+8+4 = 156. The error was in the verification step, not the conversion.
Differentiation
Grade 4 Binary to denary using place value table (given). Denary to binary for small numbers (<64). Hex = "just look up the table".
Grade 7 All conversions without a table. Minimum bits calculations. Hex to denary via binary and direct method. Explain WHY hex is used in context.
Grade 9 Explain the limitations of 8-bit numbers. Calculate the number of distinct values representable with n bits. Discuss why hex is preferable to denary as a binary shorthand (exact powers of 2).
Classroom Activities
Binary Snap: Print cards with binary numbers on one side and denary on the other. Students pair-match. Excellent for the last 8 minutes of a lesson.
Hex Colour Challenge: Show hex colour codes (#FF6B2B, #2196F3). Students convert to RGB denary values and then to the actual colour. Bridges maths and design.
Broken Calculator: Present a worked conversion with a deliberate error. Students find and correct the mistake. More cognitively demanding than doing a fresh conversion.
Exit Tickets
Convert 215 to binary. Show your working. [2 marks: D7 in hex = 11010111, method mark for division steps]
What is the minimum number of bits needed to represent 240 different colours? Justify your answer. [2 marks: 8 bits, because 28=256 ≥240, 27=128 < 240]
Explain in one sentence why computers use binary. [1 mark: transistors/switches have two states]
Homework / Extension
Complete the full conversion table: given 10 denary numbers, convert each to binary AND hex. Show all working.
Extension: research why IPv6 addresses are written in hexadecimal. What would an IPv6 address look like in binary, and why would that be impractical?