Worked solution from the Hardware and Virtual Machines Paper 3 Advanced Theory booklet, Part 1 of 2.
Say what pipelining does and why it helps.
Pipelining lets several instructions be processed at the same time, each one in a different stage [1]
This increases the instruction throughput (more instructions completed in a given time), for example one instruction is being decoded while the next is being fetched [1]
Other points that score: each stage takes one clock cycle, and no two instructions can be in the same stage in the same cycle.
Call the six instructions A to F. Each one moves down one stage per clock cycle, and the next instruction starts one cycle after the one before it.
| Stage | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| IF | A | B | C | D | E | F | ||||||
| ID | A | B | C | D | E | F | ||||||
| OF | A | B | C | D | E | F | ||||||
| IE | A | B | C | D | E | F | ||||||
| WB | A | B | C | D | E | F |
Instruction A starts at IF in clock cycle 1 [1]
Instruction A passes through IF, ID, OF, IE, WB over five clock cycles (1 to 5) [1]
The other instructions each start one cycle later, so the last one (F) finishes in cycle 10 [1]
No extra stage boxes added on any row (cycles 11 and 12 stay empty) [1]
Numbering such as 1.1, 1.2 ... instead of letters is also accepted.
▶ Whole paper
Video solution of the whole paper · by qiphyedu. Tap the picture to open it on YouTube.
Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.