Computer Architecture · Cambridge syllabus 3.1 · Lesson 5 of 5
Instruction Sets
An instruction set defines the operations a processor recognises, such as load, store, add, compare and branch. Machine instructions encode an operation and any required operands or addresses. Software must target a compatible instruction set.
By the end, you can
- Understand what an instruction set is.
- Explain why CPUs require an instruction set.
- Recognise that instructions tell the CPU what operations to perform.
Instruction set
An instruction set is the complete list of instructions a particular CPU can carry out, in the binary form the hardware recognises. It is fixed when the processor is designed and built into its circuitry.
Each instruction is a binary pattern in two parts: the opcode, which says which operation, and the operand, which gives the data to act on or the address holding it. The decoder in the control unit recognises the opcode pattern and switches on the right circuits.
A CPU needs an instruction set because it can only do what it has circuits for. There is no general understanding of a program — only a finite set of patterns, each wired to an action. Everything a computer does is built from combinations of them.
Because the set is part of the hardware, machine code written for one family of processors will not run on another with a different set. That is why software is compiled for a particular architecture, and why a high-level language, which is translated separately for each, is portable when machine code is not.
Worth remembering
- The instruction set is every instruction a given CPU can execute, in binary.
- Each instruction is an opcode plus an operand.
- Machine code for one instruction set will not run on a different one.
Worked example
ADD 5 might instruct a simple teaching CPU to add the value at memory address 5 to the accumulator.
Practice
Warm-up · not marked
Check your understanding
Answer in your own words, then compare with the worked answer. Nothing here is saved or scored.
Worked answer
Different processors may recognise different instruction sets or instruction encodings.
Check your method, units and explanation against it.
Marked practice
Set 1 of 4 · easiest first · Checked as you go, with the worked answer. Sign in or create a free account to save your progress.