1 - Computer Systems (2023) / Instruction Sets
|
|
Instruction Sets
In a CPU, the instruction set refers to the different types of operations that a CPU is capable of performing.
When we talk about instruction sets we are referring to the low level machine code instructions that a CPU is built to handle.
Low level operations are split into an opcode and an operand.
Opcode - Represents the machine instruction i.e. what it has to do - ADD, LOAD, STORE or SUBTRACT
Operand - This is either the value to be operated on OR the address that holds the value to be operated on.
Each CPU only has a limited number of opcodes available to them and the available opcodes is what is referred to as the instruction set.
When we talk about instruction sets we are referring to the low level machine code instructions that a CPU is built to handle.
Low level operations are split into an opcode and an operand.
Opcode - Represents the machine instruction i.e. what it has to do - ADD, LOAD, STORE or SUBTRACT
Operand - This is either the value to be operated on OR the address that holds the value to be operated on.
Each CPU only has a limited number of opcodes available to them and the available opcodes is what is referred to as the instruction set.
Interesting Point
The available operations are hard coded into each CPU and the consist of electronic circuitry and transistors. Different instructions will allow the CPU to enable / switch on relevant transistors to perform the required tasks.
The available operations are hard coded into each CPU and the consist of electronic circuitry and transistors. Different instructions will allow the CPU to enable / switch on relevant transistors to perform the required tasks.
Instructions
ach CPU has a limited number of instructions that it is capable of performing. As the instructions are hard coded with transistors it is obviously not possible to add more with a software update. Some example instructions include:
Operation |
Purpose |
ADD |
Add two numbers |
IN |
Allow input from a device |
SUB |
Subtract one number from another |
DIV |
Divide one number by another |
STORE |
Store a value in a given location |
MUL |
Multiply 2 numbers |
HALT |
Stop operation |