One step at a time
Answers are for parents and teachers.
1
Write six precise numbered instructions that tell someone who has never done it how to put a battery into a toy (an adult may help with the toy). Make sure that nothing is left for them to guess.
Model answer: 1 Find the small cover on the back of the toy. 2 Slide the cover off in the direction of the arrow. 3 Look at the + and − signs inside the toy. 4 Put the battery in with its + end beside the + sign. 5 Press it down gently until it sits flat. 6 Slide the cover back until it clicks. Check: each step says what to do and where, and the cover comes off before the battery goes in.
2
Six jobs do not depend on each other, and each takes 4 seconds. Work out the total time on 1 core, 2 cores, 3 cores and 6 cores.
1 core: 6 × 4 = 24 s. 2 cores: 3 jobs each, 12 s. 3 cores: 2 jobs each, 8 s. 6 cores: 1 job each, 4 s.
3
Job G takes 4 seconds. Job H takes 6 seconds and does not depend on G. Job K takes 3 seconds and needs the results of both G and H. How long does a dual core CPU need? How long does a single core need?
Dual core: G and H run together, and H finishes last at 6 s. Then K takes 3 s, so the total is 9 s. (The core that ran G is idle from 4 s to 6 s, waiting for H.) Single core: 4 + 6 + 3 = 13 s.
4
Use 011 = add and 110 = subtract. Complete the table for these three instructions and say how many times the cycle runs.
| Cycle | Fetch | Decode | Execute |
|---|---|---|---|
| 1 | 110 40 15 | ? | ? |
| 2 | 011 12 19 | ? | ? |
| 3 | 110 9 4 | ? | ? |
Cycle 1: subtract, 40 − 15 = 25. Cycle 2: add, 12 + 19 = 31. Cycle 3: subtract, 9 − 4 = 5. The cycle runs 3 times.
5
Draw the fetch–decode–execute cycle as three boxes joined by arrows in a circle. Under each box write in your own words what the CPU does there. Then write one sentence that explains why the arrow goes back to the start.
Model answer: Fetch: the CPU gets the next instruction from RAM. Decode: the CPU works out what the instruction means from its binary code. Execute: the CPU carries the instruction out. The last arrow goes back to fetch because the same three steps are repeated for the next instruction, until no instructions are left.