The fetch-decode-execute cycle

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

The fetch-decode-execute cycle

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What is the correct order of the stages in the cycle?
A Fetch, then decode, then execute
B Decode, then fetch, then execute
2. How often does the CPU run the fetch-decode-execute cycle?
A Once for every instruction in the program
B Only once, at the start of the program
3. What happens in the fetch stage?
A The instruction is carried out by the ALU
B The instruction is copied from RAM into the CPU
4. What happens in the decode stage?
A The CPU saves the instruction to storage
B The CPU works out what the instruction means
5. What happens in the execute stage?
A The CPU carries out the decoded instruction
B The CPU copies the next instruction from RAM

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1fetch AThe first stage: the CPU copies the next instruction from RAM into the CPU
2decode Bfetch -> decode -> execute -> fetch ...
3The three stages always happen in the same order for each instruction Cfetch -> decode -> execute
4After execute, the cycle starts again with the next instruction until the program ends DThe second stage: the control unit works out what the instruction means
5decode -> fetch -> execute EThe stages are in the wrong order. An instruction must be fetched from RAM before it can be decoded.
6fetch -> decode -> execute -> STOP FThe cycle does not stop after one instruction. It repeats for each instruction in the program.

Definitions

fetch-decode-execute cycle

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
The CPU repeats: fetch, decode, _______
2.
fetch -> ______ -> execute -> repeat
3.
______ FETCH; DECODE; EXECUTE UNTIL program ends
4.
_____: get the instruction from RAM
5.
execute, then the cycle _______

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A REPEAT
B DECODE instruction from RAM
C DECODE instruction
D EXECUTE instruction
E UNTIL program ends
Question 2
A FETCH instruction from the ALU
B DECODE instruction in the CU
C EXECUTE instruction
D REPEAT for next instruction
Question 3
A FETCH: instruction from RAM
B DECODE: work out the meaning
C EXECUTE: meaning is found
D NEXT: start FETCH again
Question 4
A Order for one instruction:
B 1 DECODE
C 2 DECODE
D 3 EXECUTE
Question 5
A WHILE program is running
B do FETCH, DECODE, EXECUTE
C stop after one instruction
D ENDWHILE

Answer Key

The fetch-decode-execute cycle
Section A: Quick Questions
Q1
A — Fetch, then decode, then execute
Q2
A — Once for every instruction in the program
Q3
B — The instruction is copied from RAM into the CPU
Q4
B — The CPU works out what the instruction means
Q5
A — The CPU carries out the decoded instruction
Section B: Match the Pairs
Q1
fetch → The first stage: the CPU copies the next instruction from RAM into the CPU
Q2
decode → The second stage: the control unit works out what the instruction means
Q3
The three stages always happen in the same order for each instruction → fetch -> decode -> execute
Q4
After execute, the cycle starts again with the next instruction until the program ends → fetch -> decode -> execute -> fetch ...
Q5
decode -> fetch -> execute → The stages are in the wrong order. An instruction must be fetched from RAM before it can be decoded.
Q6
fetch -> decode -> execute -> STOP → The cycle does not stop after one instruction. It repeats for each instruction in the program.
Section C: Definitions
Q1
fetch-decode-execute cycle — The CPU repeats three stages for every instruction: fetch it from RAM, decode what it means, then execute it. The cycle then starts again with the next instruction.
Section D: Fill in the Blanks
Q1
The CPU repeats: fetch, decode, execute
Q2
fetch -> decode -> execute -> repeat
Q3
REPEAT FETCH; DECODE; EXECUTE UNTIL program ends
Q4
fetch: get the instruction from RAM
Q5
execute, then the cycle repeats
Section E: Spot the Error
Q1
B — The first stage fetches the instruction from RAM. Decoding happens after the fetch and works out what the instruction means. Line 2 should be ' FETCH instruction from RAM'.
Q2
A — Instructions are fetched from RAM (main memory), not from the ALU. The ALU does calculations and comparisons. Line 1 should be 'FETCH instruction from RAM'.
Q3
C — Working out the meaning of an instruction is the decode stage. The execute stage carries out the action. Line 3 should be 'EXECUTE: carry out the action'.
Q4
B — The cycle always starts with fetch, because the CPU must get the instruction before it can decode it. Line 2 should be '1 FETCH'.
Q5
C — The cycle repeats for every instruction in the program. It does not stop after one instruction. Line 3 should be ' go to next instruction'.