A computer is built from billions of tiny switches that are either off or on. Everything it stores, from a photo to this sentence, ends up as patterns of 0s and 1s. Learn to read those patterns and to write any whole number in binary.
Computers process data using logic gates and store it in registers, both made of switches that are either off or on. So all data is represented in binary (base 2), which uses only the digits 0 and 1. People use denary (base 10). In binary each place value is twice the one to its right: 1, 2, 4, 8, 16, 32, 64, 128 ... A single binary digit is a bit; 8 bits make a byte.
Fig. 1: the 8-bit binary number 10100101 is 165 in denary
Section 01
Why binary?
Click the bits in the lab to switch them on and off. Each bit is one switch inside the computer: a transistor that is either off (0) or on (1). Watch the denary value change as you go.
Two states: an electronic switch is reliably either off or on, so two digits are all the hardware needs to tell apart.
All data: numbers, text, images, sound and program instructions are all stored and processed as binary.
Size: n bits can store 2n different values. 8 bits store 0 to 255; 16 bits store 0 to 65 535.
Examiner trap
"Computers use binary because it is easier for them" earns nothing. Say why: the computer is made of switches (logic gates and registers) with only two states, on and off.
Section 02
Binary to denary.
Write the place values above the bits, then add up the place values of every 1.
128
64
32
16
8
4
2
1
0
1
0
1
1
0
1
0
Worked example 8 bits
Convert the binary number 01011010 to denary.
Write the place values 128, 64, 32, 16, 8, 4, 2, 1 above the bits.
The 1s are under 64, 16, 8 and 2.
Add them: 64 + 16 + 8 + 2 = 90.
Answer: 90
Worked example 16 bits
Convert 0000 0001 0010 1100 to denary.
The place values of 16 bits run from 32 768 down to 1.
The 1s are under 256, 32, 8 and 4.
Add them: 256 + 32 + 8 + 4 = 300.
Answer: 300
Your turn
Convert 11001001 to denary.
128 + 64 + 8 + 1 = 201
Stage 1 · Learn
Check what the sim just showed you
Four quick checks. Each correct answer earns XP and records this skill on your profile.
Quick check+10 XP
Why do computers represent data in binary?
Quick check+10 XP
In the lab, with 8 bits, what is the largest number you can make?
Quick check+10 XP
What is 00010110 in denary?
Quick check+10 XP
What is the place value of the leftmost bit in a 16-bit number?
Section 03
Denary to binary.
Two methods give the same answer. Use whichever you find quicker, and always check by converting back.
Subtract the place values: start at the largest place value that fits, write 1 and subtract it; write 0 where it does not fit; carry on to the 1s column.
Divide by 2: keep dividing by 2 and write down the remainders; read the remainders from the bottom up. The lab shows this ladder for every number.
Fill the register: an 8-bit answer always has 8 digits, so add leading zeros: 13 is 00001101.
Worked example Subtract the place values
Convert 147 to 8-bit binary.
128 fits: write 1. 147 − 128 = 19.
64 and 32 do not fit into 19: write 0, 0.
16 fits: write 1. 19 − 16 = 3.
8 and 4 do not fit: write 0, 0. Then 2 fits (1, leaving 1) and 1 fits (1).
Answer: 10010011
Your turn
Convert 58 to 8-bit binary.
32 + 16 + 8 + 2 = 58, so 00111010
Examiner trap
Leaving out leading zeros changes nothing in value, but if the question says "8-bit" you must give all 8 bits: 00111010, not 111010.
Stage 2 · Exam
Exam-style questions
Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.
Finish the four checks above to unlock the exam questions
Exam style+20 XP
Convert the denary number 200 to 8-bit binary.
Exam style+20 XP
How many different values can a 12-bit register store?
Exam style+20 XP
Which binary number is the same as denary 99?
Exam style+20 XP
Which statement is correct?
Skill unlocked
Binary and denary, mastered.
This skill is now recorded on your profile. Keep the chain going.