AQA GCSE Computer Science (8525), section 3.4.5 (Systems architecture)
The cycle
A program is stored in main memory as a list of instructions. The CPU repeats the same three steps for each instruction. This is the fetch-execute cycle (also called the fetch-decode-execute cycle).
| Stage | What happens |
|---|---|
| Fetch | the next instruction is fetched from main memory to the CPU |
| Decode | the control unit works out what the instruction means and what has to be done |
| Execute | the instruction is carried out. This may include reading or writing data from or to main memory |
Then the cycle starts again with the next instruction. It goes on, billions of times a second, as long as the computer is on.
Worked example
Suppose the program says "add the number in address 21 to the total".
- Fetch: the instruction is copied from memory into the CPU.
- Decode: the control unit sees that it is an add instruction and finds out which address is involved.
- Execute: the data at address 21 is fetched, the ALU adds it to the total, and the result is stored.
The CPU then fetches the next instruction.
Remember
- It is the same cycle for every instruction.
- A faster clock means more cycles per second.
- You do not need to know the names of the specific registers.
Common mistake: describing execute as simply "the instruction is run" and missing out that it may involve reading or writing memory. Also, remember the order is always fetch, decode, execute, and then it repeats.
Exam tip: for "describe the fetch-execute cycle", name the three stages in order and say what happens in each. Mention that it repeats.
Check yourself
Where is the next instruction fetched from?
Main memory.
What happens during the decode stage?
The control unit works out what the instruction means and what needs to be done.
What happens after the execute stage?
The cycle repeats with the next instruction.