TutorChase logo
Login
AQA A-Level Computer Science

16.3.2 The Fetch-Execute Cycle

The fetch-decode-execute cycle is the essential process a CPU follows to retrieve, interpret, and execute instructions, forming the basis of all computer operations.

Introduction to the fetch-decode-execute cycle

The fetch-decode-execute cycle, often shortened to the instruction cycle, is the continuous sequence of steps that a processor follows to perform tasks. Every action taken by a computer, from opening a file to running a program, is broken down into instructions stored in memory. These instructions are processed by the CPU through this cycle.

Each instruction must be:

  • Fetched from memory

  • Decoded to understand what needs to be done

  • Executed by the processor

This cycle happens repeatedly and rapidly, often millions or billions of times per second, enabling the computer to run software efficiently and accurately.

Understanding this cycle is key to comprehending how computers carry out commands at the hardware level.

Stages of the cycle

The fetch-decode-execute cycle consists of three main stages:

  • Fetch – retrieve the instruction from memory

  • Decode – interpret the instruction

  • Execute – perform the instruction

Each stage involves specific components of the CPU and uses various registers to manage data and addresses.

Fetch stage

Take your grades to the next level!

UPGRADING TO PREMIUM UNLOCKS
AI Tutor
AI-powered study assistant
instant feedback and guidance
Predicted Papers
Examiner-style predicted papers
based on recent exam trends
Practice Questions
All exam practice questions
by topic for each subject
Study Notes
All detailed revision notes
written by expert teachers
Cheat Sheets
Quick revision summaries
perfect for last-minute review
Past Papers
Complete collection
of practice and past exam papers
Email
Password
Confirm Password
Already have an account?

Practice Questions

FAQ

The Current Instruction Register (CIR) is necessary because it allows the CPU to separate the temporary storage of incoming instructions from the active processing of instructions. While the Memory Buffer Register (MBR) briefly holds the instruction fetched from memory, it serves as a general-purpose buffer for all memory transfers, including data as well as instructions. The CIR provides a stable and dedicated location for the current instruction to reside during decoding and execution. Without the CIR, any new memory access could overwrite the instruction being executed. By isolating the instruction in the CIR, the Control Unit can decode and manage it without interference from subsequent memory operations. It also enables precise timing and coordination within the processor, as each stage of the cycle relies on fixed, known locations for data. This separation ensures reliable and efficient execution of instructions, particularly in modern CPUs where multiple instructions might be in various stages of processing simultaneously.

If the Program Counter (PC) fails to increment after an instruction is fetched, the CPU will continuously fetch the same instruction in a loop, causing the processor to become stuck. This error halts the progression of the program because the PC is responsible for pointing to the next instruction to be executed. Without the automatic or controlled update of the PC, the fetch-decode-execute cycle will not proceed through the instruction sequence stored in memory. This could lead to an infinite loop, where the same instruction is re-fetched, re-decoded, and re-executed repeatedly. In software, this might resemble a hang or crash, as no meaningful work can be carried out beyond that point. This issue is particularly problematic in systems that rely on precise control flow, such as real-time or safety-critical applications. Proper PC updates are therefore essential for maintaining correct execution order and enabling conditional branching, loops, subroutines, and program termination.

The Control Unit (CU) determines how the Program Counter (PC) is updated based on the instruction’s opcode during the decode stage. If the opcode indicates a standard operation (e.g. arithmetic or data transfer), the CU signals the PC to increment normally, typically by one instruction length. However, if the opcode represents a control instruction (e.g. jump, branch, or call), the CU interprets the operand as a new address and updates the PC accordingly. In such cases, the PC is loaded with a non-sequential value, redirecting the flow of execution. Conditional branches depend on flags in the Status Register, so the CU checks whether the condition is met before updating the PC. For example, a “jump if zero” instruction will only update the PC if the zero flag is set. This intelligent control of the PC allows the CPU to execute structured programs with loops, decisions, and function calls, enabling complex and efficient software behaviour.

General-purpose registers and dedicated registers serve different roles in the instruction cycle. Dedicated registers—such as the Program Counter (PC), Memory Address Register (MAR), Memory Buffer Register (MBR), Current Instruction Register (CIR), and Status Register—have fixed roles in managing control flow and instruction handling. These are critical to the operation of the fetch-decode-execute cycle and ensure that instructions are correctly retrieved, tracked, and executed. For example, the PC tracks which instruction comes next, while the MAR and MBR manage memory addresses and data transfers, respectively.

General-purpose registers, on the other hand, are used to hold data that is actively being processed by the Arithmetic Logic Unit (ALU) or being prepared for use. They store operands, intermediate results, and sometimes function return values. These registers are not tied to any specific function within the cycle, offering flexibility for different instructions. This distinction allows dedicated registers to manage control, while general-purpose registers handle the computational workload efficiently.

Modern CPUs use various techniques to optimise the fetch-decode-execute cycle while preserving its fundamental structure. One major method is instruction pipelining, where different stages of the cycle are overlapped. For example, while one instruction is being decoded, the next can be fetched simultaneously. This significantly improves throughput and CPU efficiency.

Another optimisation is speculative execution, where the processor guesses the path of a branch instruction and begins executing instructions ahead of time. If the guess is correct, time is saved; if not, changes are undone. Branch prediction supports this by estimating likely outcomes of conditional branches.

Instruction prefetching involves fetching future instructions into a small buffer before they are needed, reducing delays. Additionally, out-of-order execution allows the CPU to execute instructions as resources become available, rather than strictly in order.

These techniques do not replace the fetch-decode-execute cycle—they enhance it by enabling multiple instructions to be processed in different stages simultaneously, increasing overall performance.

Hire a tutor

Please fill out the form and we'll find a tutor for you.

1/2
Your details
Alternatively contact us via
WhatsApp, Phone Call, or Email