📚 Knowledge Library — Topic 3.3 — Hardware

Decode Stage

Understand how the CPU works out what an instruction means before it can carry it out.

1. Invitation

The CPU has fetched an instruction. Now it must understand it.

In the fetch stage, the instruction was brought from RAM into the CPU.

The decode stage is where the CPU works out what that instruction means.

💡 Remember: decode means understand the instruction before doing it.
Figure 1.1
FDE Journey
Fetch

Decode

Execute
2. Big Idea

The Control Unit decodes the instruction.

The instruction is held in the CIR, which means Current Instruction Register.

The Control Unit reads the instruction and uses the instruction set to understand it.

💡 The Control Unit is the part of the CPU that decodes instructions.
Figure 2.1
Decode Location
CIR

Control Unit

Decoded instruction
CIR is part of the Control Unit.
3. FutureLogic Bridge

Think of reading a coded recipe note.

A chef might see a short note such as CH 3M.

They use a codebook to decode it: CH means chop, and 3M means three mushrooms.

💡 Bridge: the instruction set is like the CPU's codebook.
Figure 3.1
Codebook Model
CH 3M

codebook

chop 3 mushrooms
4. Worked Example

An instruction has two useful parts.

When an instruction is decoded, the CPU can identify what action is needed and what data or address is involved.

These parts are called the opcode and the operand.

Example instruction

Opcode
ADD
Operand
Number / address
Opcode = what to do. Operand = what to use.
Figure 4.1
Instruction Split
Instruction

Opcode + Operand

Do this + with this
5. Instruction Set

The CPU can only decode instructions it understands.

An instruction set is the list of machine code commands that a CPU can process.

During decode, the Control Unit checks the instruction against this list.

💡 Instruction set = the CPU's list of possible commands.
Figure 5.1
Instruction Set
LOAD
STORE
ADD
SUBTRACT
COMPARE
The CPU decodes by matching the command.
6. Exam Tip

Do not describe execute too early.

Decode is about understanding the instruction.

Execute is the next stage, where the instruction is actually carried out.

🎯 Exam Tip: Decode = Control Unit uses the instruction set. Execute = the action happens.
Figure 6.1
Decode vs Execute
Decode
= understand

Execute
= carry out
7. Common Mistake

Students often mix up decode and execute.

A common exam mistake is describing calculations or actions when the question asks about decode.

At decode, the Control Unit is still working out the meaning of the instruction.

⚠️ Common Mistake: writing that the ALU performs the calculation during decode. The ALU is used in execute.
Figure 7.1
Wrong Stage
Decode

ALU calculates

Execute

ALU may calculate
8. Summary

The decode stage in one screen.

The instruction is held in the CIR. The Control Unit decodes it using the instruction set.

The instruction can be separated into opcode and operand, so the CPU knows what to do next.

💡 Key idea: decode prepares the instruction for the execute stage.
Figure 8.1
Decode Summary
CIR

Control Unit

Instruction set

Opcode + Operand