FutureLogic Lesson → Hardware → IGCSE Computer Science

Decode & Execute Explained

The instruction has reached the CIR. Now follow what happens next as the Control Unit works out what the instruction means and the CPU carries it out.

What Happens After Fetch?

Fetch has brought the instruction from RAM into the CPU. The instruction is now held in the CIR.

But simply having an instruction is not enough. Before the CPU can carry it out, the CPU must first work out what the instruction means.

That gives us the final two stages of the Fetch–Decode–Execute cycle:

Fetch → Decode → Execute → repeat
Decode means understand the instruction. Execute means carry out the instruction.

Keeping those two ideas separate is one of the most important things to understand in this lesson.

Check Your Understanding 1

After Fetch is complete, which register holds the current instruction?

Check the answer

The CIR — Current Instruction Register.


Decode — Understand the Instruction

During Decode, the instruction is held in the Current Instruction Register (CIR).

The Control Unit (CU) reads the instruction and works out what it means.

CIR → Control Unit → decoded instruction

The Control Unit does not need to guess. The CPU has an instruction set containing the machine-code commands that it understands.

The Control Unit uses this instruction set to identify the instruction and determine what needs to happen next.

Exam Tip: The Control Unit decodes the instruction. Do not say that the ALU decodes it.

Think of the Instruction Set as a Codebook

A useful mental model is to imagine that the CPU has been given a coded instruction.

The code is only useful if the CPU knows what that code means. The instruction set acts like the CPU's codebook: it defines the commands that the processor can understand.

Instruction
↓
Control Unit
↓
Instruction Set
↓
Meaning understood
Instruction set = the CPU's list of commands it can process.

Check Your Understanding 2

Which CPU component uses the instruction set during Decode?

Reveal the answer

The Control Unit.


Opcode and Operand

When an instruction is decoded, it can be understood in terms of two useful parts: the opcode and the operand.

Part Meaning
Opcode The operation or action that needs to be performed.
Operand The data, value or address involved in the instruction.
Opcode = what to do.
Operand = what to use.

For example, consider the simplified instruction:

ADD 25

In this example, ADD describes the operation. The other part identifies what is involved in that operation.

Opcode or Operand?

In the simplified instruction ADD 25, which part tells the CPU what action to perform?

Reveal the answer

ADD is the opcode because it identifies the operation to perform.


What Decode Does — and Does Not Do

Decode is about understanding the current instruction.

At this point, the CPU has not yet carried out the requested action.

Decode Execute
Works out what the instruction means. Carries out the instruction.
Uses the Control Unit and instruction set. Uses the appropriate CPU components for the action.
Identifies what needs to happen. Makes it happen.
✗ Common Mistake: saying that the ALU performs a calculation during Decode.
Decode is where the instruction is understood. If an arithmetic or logical operation is required, the ALU may perform it during Execute.

Check Your Understanding 3

Has the instruction been carried out when Decode finishes?

Reveal the answer

No. Decode determines what the instruction means. The action happens during Execute.

DECODE COMPLETE → EXECUTE BEGINS

The CPU now understands the instruction. The next job is to carry it out.


Execute — Carry Out the Instruction

The CPU now knows what the instruction means. During the Execute stage, that decoded instruction is finally carried out.

The Control Unit sends control signals to the appropriate components so that the required action can happen.

Decoded instruction
↓
Control Unit sends signals
↓
Required action happens
Decode decides what needs to happen. Execute makes it happen.

Check Your Understanding 4

Which CPU component sends the control signals needed to coordinate the Execute stage?

Reveal the answer

The Control Unit.


The ALU Performs Arithmetic and Logic

Some instructions require a calculation or a logical operation.

When this happens, the Arithmetic Logic Unit (ALU) performs the required arithmetic or logical operation.

Instruction requires arithmetic / logic
↓
ALU performs the operation

For example, if the decoded instruction requires two values to be added, the ALU performs the addition.

Exam Tip: ALU = performs arithmetic and logical operations.

The Accumulator Stores the Result

Once the ALU has performed an operation, the result can be stored in the Accumulator (ACC).

ALU performs operation
↓
Result
↓
ACC stores result

This distinction is extremely important because students often mix up the ALU and the accumulator.

Component Job
ALU Performs arithmetic and logical operations.
ACC Stores the result of those operations.
ALU does the work. ACC stores the result.

ALU or ACC?

A CPU instruction causes two values to be added. Which component performs the addition, and where can the result be stored?

Reveal the answer

The ALU performs the addition. The result can be stored in the ACC.


Execute Does Not Always Mean Calculate

Not every instruction requires the ALU to perform a calculation.

An instruction might instead require the CPU to load data, store data, compare values, or move information between different parts of the system.

The Control Unit sends the appropriate control signals so that the required action can take place.

Execute may involve:

calculate
compare
load data
store data
move data
Important: Do not write that every instruction is sent to the ALU. The component used depends on what the decoded instruction actually requires.

Data Can Move During Execute

Some instructions involve transferring data rather than performing a calculation.

For example, data may need to move between RAM, the MDR and the CPU.

RAM ↔ MDR ↔ CPU

The Control Unit coordinates these movements by sending the appropriate control signals.

Check Your Understanding 5

Does every Execute stage require the ALU to perform a calculation?

Reveal the answer

No. Some instructions calculate or compare, while others load, store or move data.


Put Decode and Execute Together

We can now connect the two stages without mixing up their jobs.

CIR
↓
Control Unit decodes instruction
↓
Instruction set identifies meaning
↓
Opcode + Operand understood
↓
Control Unit sends control signals
↓
Instruction is executed
CIR → Decode → understand → control signals → Execute → action.

Try It Before You Reveal It

Retrieval practice is much more useful than simply reading the same explanation again.

Decode Challenge

Complete the sequence:

CIR → ? → Instruction Set → Meaning
Reveal the missing component
CIR → Control Unit → Instruction Set → Meaning

The missing component is the Control Unit.

Execute Challenge

Complete the statement:

ALU = ?
ACC = ?
Reveal the answer

ALU performs arithmetic and logical operations.

ACC stores the result.

Decode or Execute?

Decide which stage each statement belongs to:

  1. The Control Unit works out what the instruction means.
  2. The ALU performs an arithmetic operation.
  3. The instruction set is used to identify the command.
  4. The Control Unit sends signals so the required action happens.
Check your answers
  1. Decode
  2. Execute
  3. Decode
  4. Execute

The Full Fetch–Decode–Execute Story

We can now reconnect everything from all three lessons in the CPU mini-series.

Stage Big idea
Fetch Get the next instruction from memory.
Decode Work out what the instruction means.
Execute Carry out the instruction.
FETCH
PC → MAR → RAM → MDR → CIR

DECODE
CIR → Control Unit → Instruction Set

EXECUTE
Control signals → required action

After Execute, the CPU can continue with the next instruction and the Fetch–Decode–Execute cycle repeats.

Fetch gets it. Decode understands it. Execute does it. Then the cycle repeats.

Exam Focus — Keep the Stages Separate

One of the easiest ways to lose marks is to describe the correct CPU action in the wrong stage.

Keep these three ideas clear:

  1. Fetch: bring the instruction into the CPU.
  2. Decode: the Control Unit works out what the instruction means.
  3. Execute: the Control Unit coordinates the components needed to carry out the instruction.

If the question asks specifically about Decode, do not start describing ALU calculations. If it asks specifically about Execute, explain what happens when the decoded instruction is carried out.


Common Decode & Execute Mistakes

✗ Saying that the ALU decodes the instruction.
The Control Unit decodes the instruction.
✗ Saying that Decode carries out the instruction.
Decode works out what the instruction means. Execute carries it out.
✗ Mixing up opcode and operand.
Opcode identifies the operation. Operand identifies the data, value or address involved.
✗ Saying that the accumulator performs calculations.
The ALU performs arithmetic and logical operations. The ACC stores the result.
✗ Saying every instruction uses the ALU.
Some instructions involve calculations or logic, while others involve loading, storing or moving data.
✗ Forgetting the Control Unit during Execute.
The Control Unit sends control signals to coordinate the components required to carry out the instruction.

Quick Quiz

  1. Which register holds the current instruction after Fetch?
  2. Which CPU component decodes the instruction?
  3. What is an instruction set?
  4. What is the difference between an opcode and an operand?
  5. What is the main purpose of the Execute stage?
  6. Which component performs arithmetic and logical operations?
  7. What is the role of the accumulator?
  8. Does every instruction require an ALU calculation?
  9. What does the Control Unit do during Execute?
  10. Name the three stages of the FDE cycle in order.

Quick Quiz Answers

Reveal all answers
  1. The CIR.
  2. The Control Unit.
  3. The list of machine-code commands that the CPU can process.
  4. The opcode identifies the operation; the operand identifies the data, value or address involved.
  5. To carry out the decoded instruction.
  6. The ALU.
  7. The ACC stores the result of arithmetic or logical operations.
  8. No. Some instructions load, store or move data instead.
  9. It sends control signals to coordinate the components needed to carry out the instruction.
  10. Fetch → Decode → Execute.

Final Summary

CIR

Holds the current instruction after Fetch.

Control Unit

Decodes the instruction and sends control signals.

Instruction Set

Contains the commands that the CPU can process.

Opcode & Operand

Opcode = operation. Operand = data, value or address involved.

ALU

Performs arithmetic and logical operations when required.

ACC

Stores the result of ALU operations.

Fetch gets the instruction. Decode understands it. Execute carries it out.
FutureLogic Education

You have completed the CPU mini-series.

You have followed an instruction through Fetch, Decode and Execute. Continue into the Knowledge Library to explore CPU performance, or use the Learning Hub to continue your FutureLogic journey.