GCSE Computer Science · public explanation

Decode and Execute

See how a CPU decodes an instruction and carries it out. Follow a worked example through the control unit, ALU and registers for GCSE Computer Science.

Read the explanation and worked examples, then choose your exam board to continue with activities and practice in your account.

OCR J277On the specificationOCR J277 1.1.1

Explain decode and execute alongside the roles of CPU components and named registers.

AQA 8525 (2027+)On the specificationAQA 8525 (2027+) 3.4.5

Explain that decode identifies the instruction and execute carries it out, which may include reading or writing main memory.

Give each CPU component its own job

The Control Unit (CU) decodes instructions and sends control signals to coordinate the components needed to carry them out. Coordination is not the same as doing every calculation itself. The Arithmetic Logic Unit (ALU) performs arithmetic, such as addition, and logical operations, such as comparisons.

A CPU register holds a small piece of currently needed state, such as an instruction or result. Main memory supplies instructions and data and can receive results. Cache holds copies of frequently or recently needed instructions and data in or close to the CPU; a cached copy can be accessed faster than a fresh main-memory read.

ComponentContribution
Control UnitInterpret the instruction and coordinate the action
ALUPerform the required arithmetic or logical operation
RegisterHold a currently needed value inside the CPU
Main memorySupply instructions or data; receive results
CacheProvide fast access to reusable copies

Decode identifies the action; it does not do it

Keep the same supplied example: the fetched instruction is ADD 100, main memory at address 100 holds 7, and the running total starts at 12. Here ADD is the operation, often called the opcode, and 100 is the operand address. The operand supplies information used by the operation; it is not always a literal number to add.

Decode identifies addition and the location of the needed data. At the end of decode, the running total is still 12. Only execute carries out the operation. If a different example supplies a literal operand instead of an address, use that example's stated meaning; do not silently switch between the two models.

Execute changes 12 to 19

Execution obtains the value 7 from location 100. The ALU adds that value to the running total: 12 + 7 = 19. The result is retained in the accumulator in this supplied model. The accumulator stores the result; it is not the unit performing the arithmetic.

The name accumulator is required register knowledge for OCR. For AQA, treat it as a named example of a CPU register holding a working value. The operation, data lookup and final result are fully supplied here, so this is interpretation of a model rather than recall of a register-transfer script.

Point in the modelRunning totalWhat has happened?
Before decode12Instruction has been fetched
After decode12Addition and address identified, not performed
After execute19ALU has added the retrieved 7

Continue with your exam board

The course combines lesson videos, interactive activities, topic questions and original exam mocks. Sign in to use the learning tools and save your progress; your account’s course access applies.

Independent learning resources. Not endorsed by AQA or OCR. These public introductions complement the full course and the official specification.