Try it free

A real sample of the course: no account needed. Try a simulation, write some Python, answer five exam-style questions and read a topic note. The full course has every topic in National 5 Computing Science.

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.

Bit, a cartoon seagull

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.

Two boxes: a chip labelled 1 and an empty box labelled 0

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:

Place-value table: 79 in binary is 0 1 0 0 1 1 1 1, because 64 + 8 + 4 + 2 + 1 = 79
1286432168421
01001101

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 binary

Example 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.

  1. Write the place values: 128, 64, 32, 16, 8, 4, 2, 1.
  2. 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).
  3. Put a 1 under 64, 32, 8 and 1, and a 0 under every other column.
  4. Check: 64 + 32 + 8 + 1 = 105. Answer, all 8 digits: 01101001

2. Convert 150 to 8-bit binary.

  1. Write the place values: 128, 64, 32, 16, 8, 4, 2, 1.
  2. 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).
  3. Put a 1 under 128, 16, 4 and 2, and a 0 under every other column.
  4.  
Check your steps
  1. Check: 128 + 16 + 4 + 2 = 150. Answer, all 8 digits: 10010110

3. Convert 43 to 8-bit binary.

  1. Write the place values: 128, 64, 32, 16, 8, 4, 2, 1.
  2. 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).
  3.  
  4.  
Check your steps
  1. Put a 1 under 32, 8, 2 and 1, and a 0 under every other column.
  2. Check: 32 + 8 + 2 + 1 = 43. Answer, all 8 digits: 00101011

4. Convert 200 to 8-bit binary.

  1. Write the place values: 128, 64, 32, 16, 8, 4, 2, 1.
  2.  
  3.  
  4.  
Check your steps
  1. Go from the left, taking away each one that fits: 128 fits (72 left), 64 fits (8 left), 8 fits (0 left).
  2. Put a 1 under 128, 64 and 8, and a 0 under every other column.
  3. Check: 128 + 64 + 8 = 200. Answer, all 8 digits: 11001000

5. Convert 99 to 8-bit binary.

  1.  
  2.  
  3.  
  4.  
Check your steps
  1. Write the place values: 128, 64, 32, 16, 8, 4, 2, 1.
  2. 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).
  3. Put a 1 under 64, 32, 2 and 1, and a 0 under every other column.
  4. 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.