HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
The Processor and the Fetch-Decode-Execute Cycle
  1. 1The CPU, its units, registers and buses
  2. 2The fetch-decode-execute cycle
  3. 3Performance, instruction sets and embedded systems
  1. Computer Science
  2. /The Processor and the Fetch-Decode-Execute Cycle
  3. /The fetch-decode-execute cycle

Course 3.1·Lesson 2 of 3

The fetch-decode-execute cycle

Every instruction goes through the same three stages: fetch, decode and execute. This lesson follows one instruction step by step. You see which register is filled at each step, which bus carries what, and what the control unit and the ALU do.

about 25 min1 simulation1 practice question
Lesson 2 of 3Show all lessonsHide
The Processor and the Fetch-Decode-Execute Cycle
  1. 1The CPU, its units, registers and buses
  2. 2The fetch-decode-execute cycle
  3. 3Performance, instruction sets and embedded systems

Try the code and the simulations beside the lesson.

A cycle that never stops

A cook follows a recipe one line at a time. Read the next line. Understand it. Do it. Then read the next line. The CPU works the same way, millions of times each second. It is called the fetch-decode-execute (FDE) cycle.

A loop of three boxes joined by arrows: Fetch, then Decode, then Execute, and back to Fetch. Under Fetch: PC to MAR, address bus, data bus to MDR, MDR to CIR, PC plus 1. Under Decode: the control unit decodes the instruction in the CIR. Under Execute: the instruction is carried out, the ALU calculates and the result goes to the ACC.

The picture shows the cycle as a loop of three stages. The steps inside each stage are listed below.

Fetch

The instruction is copied from RAM into the CPU.

  1. The address in the PC is copied to the MAR.
  2. The address in the MAR is sent along the address bus to RAM. The control unit sends a read signal along the control bus.
  3. The instruction at that address is sent along the data bus to the MDR.
  4. The instruction in the MDR is copied to the CIR.
  5. The PC is incremented by 1, so it holds the address of the next instruction.

Decode

  1. The control unit decodes the instruction in the CIR. It works out what the instruction means and what it needs, such as an address of some data.

Execute

  1. The instruction is carried out. The control unit sends signals to the parts that are needed.
    • To load data, its address goes to the MAR, and the data comes back along the data bus to the MDR. Then it goes into the ACC.
    • To calculate, the ALU does the work and the result goes into the ACC.
    • To store a result, the address goes to the MAR and the value goes to the MDR. Then it is written to RAM.

Then the cycle starts again with the next instruction.

One instruction, traced

The program from the last lesson starts at address 10. At the start the PC holds 10. Here is the first cycle, for LOAD 20.

  • Fetch. MAR gets 10. The instruction LOAD 20 comes to the MDR, then to the CIR. The PC becomes 11.
  • Decode. The CU finds that it must load the value at address 20.
  • Execute. MAR gets 20. The value at address 20, which is 7, comes to the MDR. It is copied to the ACC.

Notice that the MAR held two different addresses in one cycle. First it held the address of the instruction. Then it held the address of the data.

Practise with new numbers

Try it in Python

The program runs the whole tiny program through the cycle. It uses a variable for each register, and prints the registers after each fetch and each execute.

Read it first. Then run it. What does the PC hold after the last fetch?

1. Put the value 40 at address 21. Predict the final value at address 22, then run it.

2. Move the whole program so that it starts at address 50. Which line must you change as well as the memory?

Common mistakes

  • Incrementing the PC at the wrong time. The PC goes up during the fetch stage, before the instruction is executed.
  • Leaving out the buses. An exam answer should say which bus carries the address and which carries the instruction.
  • Saying the ALU decodes the instruction. Decoding is the job of the control unit.
  • Forgetting the MDR. An instruction does not go straight from RAM to the CIR. It goes through the MDR.

Remember these

  • Fetch: PC to MAR, address bus, data bus to MDR, MDR to CIR, PC plus 1.
  • Decode: the CU decodes the instruction in the CIR.
  • Execute: the instruction is carried out. The ALU does any calculation and the result goes to the ACC.
  • The MAR always holds the address that is about to be used, of an instruction or of data.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. Which register's contents are copied to the MAR at the start of a fetch?
  1. Which bus carries the instruction from RAM to the CPU?
  1. The PC holds 26 at the start of a fetch. What does it hold at the end of the fetch?
  1. Which part of the CPU decodes the instruction in the CIR?
  1. During one cycle the MAR holds 14 and then 31. Explain why.

References

  • Cambridge International, IGCSE Computer Science 0478 syllabus (2026, 2027 and 2028), section 3.1 Computer architecture, outcome 2(b): the fetch-decode-execute (FDE) cycle.

Enroll free in The Processor and the Fetch-Decode-Execute Cycle

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (3)

At the start of a cycle the program counter holds 40…Easy · High School (9–10) · by StemPy Lab
An examination question asks you to describe the fetch stage of the fetch-decode-execute cycle…Medium · High School (9–10) · by StemPy Lab
A program is stored from address 60. Address 70 holds 25 and address 71 holds 16…Hard · High School (9–10) · by StemPy Lab
Next: lesson 3Performance, instruction sets and embedded systems
← The Processor and the Fetch-Decode-Execute Cycle
← The CPU, its units, registers and busesPerformance, instruction sets and embedded systems →

Discussion (0)

Log in to join the discussion.

Loading…

1 Python program
5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

Python Labs (1)

Fetch, decode and execute in PythonPython Lab · by StemPy Lab