You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
This lesson explains the fetch-decode-execute (FDE) cycle, which is the fundamental process by which a CPU processes every instruction in a program. This topic is essential for AQA and OCR GCSE Computer Science.
The CPU does not process an entire program in one go. Instead, it works through instructions one at a time in a continuous loop called the fetch-decode-execute cycle. This cycle repeats billions of times per second in a modern computer.
The three stages are:
graph TD
A["Fetch: PC -> MAR -> read RAM -> MDR"] --> B["Increment PC"]
B --> C["Decode: split into Opcode + Operand"]
C --> D["Execute: ALU / Memory / Branch"]
D --> A
During the fetch stage, the CPU retrieves the next instruction from main memory (RAM). Here is what happens step by step:
| Step | Action | Components Involved |
|---|---|---|
| 1 | PC holds address of next instruction | PC |
| 2 | Address copied from PC to MAR | PC, MAR |
| 3 | Address sent to memory via address bus | MAR, address bus |
| 4 | Read signal sent via control bus | CU, control bus |
| 5 | Instruction sent from memory to MDR via data bus | Memory, data bus, MDR |
| 6 | PC incremented by 1 | PC |
Exam Tip: Many students forget step 6 — the PC must be incremented during the fetch stage so that the next cycle fetches the correct instruction. Write this step explicitly in exam answers.
During the decode stage, the CPU works out what the fetched instruction means:
For example, the instruction ADD 7 has:
During the execute stage, the CPU carries out the instruction. What happens depends on the type of instruction:
| Instruction Type | Example | What Happens |
|---|---|---|
| Arithmetic | ADD 5 | ALU adds 5 to the accumulator |
| Logic | COMPARE 10 | ALU compares accumulator with 10 |
| Data transfer | LOAD 200 | Data at address 200 is loaded into the accumulator |
| Branch | JUMP 50 | PC is set to 50; next instruction fetched from address 50 |
After the execute stage, the cycle starts again from the fetch stage. The PC (which was incremented in step 6 of the fetch stage, or changed by a branch instruction in the execute stage) now points to the next instruction.
This process continues indefinitely while the computer is running — billions of cycles per second in a modern processor.
+--------+
| FETCH | <--- PC provides address; instruction fetched from memory
+--------+
|
v
+--------+
| DECODE | <--- CU interprets the opcode and operand
+--------+
|
v
+---------+
| EXECUTE | <--- ALU, registers, or memory carry out the instruction
+---------+
|
+-------> (back to FETCH)
Suppose the following instructions are stored in memory:
| Address | Instruction |
|---|---|
| 100 | LOAD 50 |
| 101 | ADD 30 |
| 102 | STORE 51 |
Cycle 1:
Cycle 2:
Cycle 3:
Describe the purpose of the fetch-decode-execute cycle. — It is the process by which the CPU fetches an instruction from memory, decodes what the instruction means, and then executes it. This cycle repeats for every instruction in a program.
Explain what happens to the Program Counter during the fetch stage. — The address in the PC is copied to the MAR, then the PC is incremented by 1 so it points to the next instruction.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.