Try it free
1. A simulation: step through a program
Press Step to run the program one line at a time and watch the variables change. Before a line displays anything, you are asked to predict what it will show. Finish with the Check yourself questions at the bottom.
2. Write real code
The first lesson of Python from scratch. Type in the box, press Run, and the exercises check your code for you. It all runs in your browser: nothing to install.
3. Five exam-style questions
One from each part of the course. Choose an answer, say how sure you are, then press Check. Every wrong answer tells you why it is wrong.
4. A topic note
Every topic has a short note like this one, ending with what the exam asks and what gains the mark.
Meet Bit. Bit is a seagull who lives on the roof of Morag's chip van, and Bit understands exactly two things in this world: chip and no chip.
Ask Bit about the weather, the football or the meaning of life and you get a blank stare. Hold up a chip and you have Bit's full attention. That is not much of a personality, but it is exactly how a computer works.
Two states, two digits
A computer is built from billions of tiny switches. Each switch is either on or off. There is no "sort of on". So a computer stores everything using just two digits: 1 for on and 0 for off. That is binary.
We count in tens (denary), probably because we have ten fingers. Bit has no fingers and counts in twos.
Place values
In denary, each column is worth ten times the one to its right: units, tens, hundreds. In binary, each column is worth twice the one to its right. Eight columns look like this:
Binary to denary: add up the columns that have a 1 in them. Here that is 64 + 8 + 4 + 1 = 77.
Denary to binary: work from the left and ask, "does this column fit?" Take 77. Does 128 fit? No: write 0. Does 64 fit? Yes: write 1, and you have 13 left. 32? No. 16? No. 8? Yes, leaving 5. 4? Yes, leaving 1. 2? No. 1? Yes. Answer: 01001101.
Your turn: denary to binaryExample 1 is worked for you. In each example after it, one more step is left for you, starting from the end. Write the missing steps on paper, then open Check your steps.
1. Convert 105 to 8-bit binary.
- Write the place values: 128, 64, 32, 16, 8, 4, 2, 1.
- Go from the left, taking away each one that fits: 64 fits (41 left), 32 fits (9 left), 8 fits (1 left), 1 fits (0 left).
- Put a 1 under 64, 32, 8 and 1, and a 0 under every other column.
- Check: 64 + 32 + 8 + 1 = 105. Answer, all 8 digits: 01101001
2. Convert 150 to 8-bit binary.
- Write the place values: 128, 64, 32, 16, 8, 4, 2, 1.
- Go from the left, taking away each one that fits: 128 fits (22 left), 16 fits (6 left), 4 fits (2 left), 2 fits (0 left).
- Put a 1 under 128, 16, 4 and 2, and a 0 under every other column.
-
Check your steps
- Check: 128 + 16 + 4 + 2 = 150. Answer, all 8 digits: 10010110
3. Convert 43 to 8-bit binary.
- Write the place values: 128, 64, 32, 16, 8, 4, 2, 1.
- Go from the left, taking away each one that fits: 32 fits (11 left), 8 fits (3 left), 2 fits (1 left), 1 fits (0 left).
-
-
Check your steps
- Put a 1 under 32, 8, 2 and 1, and a 0 under every other column.
- Check: 32 + 8 + 2 + 1 = 43. Answer, all 8 digits: 00101011
4. Convert 200 to 8-bit binary.
- Write the place values: 128, 64, 32, 16, 8, 4, 2, 1.
-
-
-
Check your steps
- Go from the left, taking away each one that fits: 128 fits (72 left), 64 fits (8 left), 8 fits (0 left).
- Put a 1 under 128, 64 and 8, and a 0 under every other column.
- Check: 128 + 64 + 8 = 200. Answer, all 8 digits: 11001000
5. Convert 99 to 8-bit binary.
-
-
-
-
Check your steps
- Write the place values: 128, 64, 32, 16, 8, 4, 2, 1.
- Go from the left, taking away each one that fits: 64 fits (35 left), 32 fits (3 left), 2 fits (1 left), 1 fits (0 left).
- Put a 1 under 64, 32, 2 and 1, and a 0 under every other column.
- Check: 64 + 32 + 2 + 1 = 99. Answer, all 8 digits: 01100011
Answers: (2) 10010110; (3) 00101011; (4) 11001000; (5) 01100011
How big can it get?
With all eight columns set to 1 you get 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255. So 8 bits can store any whole number from 0 to 255. That is 256 different values, because 0 counts too.
In the exam
You are asked to convert a denary number to 8-bit binary nearly every year, for 1 mark. Write all 8 digits, including the zeros at the front. 1001101 is not an 8-bit answer; 01001101 is.
5. A full practice paper, free
Practice paper A is a complete 80-mark paper, built to match the 2025 exam question by question, with new contexts. Sit it in 1 hour 30 minutes, then mark it yourself. The course has six more. It is our own paper, not an SQA or Qualifications Scotland paper.
Create an account
More free help: revision guides to the questions candidates find hardest.