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.
↓
Decode
↓
Execute
Understand how the CPU works out what an instruction means before it can carry it out.
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.
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.
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.
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.
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.
Decode is about understanding the instruction.
Execute is the next stage, where the instruction is actually carried out.
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.
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.
Now that the CPU understands the instruction, the next lesson shows how it carries the instruction out.