COMPUTER SCIENCE CAFÉ
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY

3.1.4 | THE INSTRUCTION SET

Topics from the Cambridge IGCSE (9-1) Computer Science 0984 syllabus 2023 - 2025.
OBJECTIVES
3.1.4 Understand the purpose and use of an instruction set for a CPU
An instruction set is a list of all the commands that can be processed by a CPU and the commands are machine code
ALSO IN THIS TOPIC
3.1.1 COMPUTER ARCHITECTURE 

3.1.2 COMPUTER ARCHITECTURE 
​3.1.3 COMPUTER ARCHITECTURE 
YOU ARE HERE | ​3.1.4 COMPUTER ARCHITECTURE(CIE) 
3.1.5 COMPUTER ARCHITECTURE 
3.2.1 INPUT AND OUTPUT DEVICES 
3.2.2 INPUT AND OUTPUT DEVICES 
3.2.3 INPUT AND OUTPUT DEVICES
3.3 DATA STORAGE 
3.4 NETWORK HARDWARE 
REVISION CARDS
TOPIC 3 KEY TERMINOLOGY
TOPIC 3 ANSWERS
TOPIC 3 TEACHER RESOURCES
TOPIC 1 TEACHER RESOURCES (CIE)

Picture
THE INSTRUCTION SET
An instruction set is a collection of basic commands and operations that a computer's CPU can understand and execute. The instruction set serves as an interface between software and hardware which allows the CPU to perform tasks such as calculations and data manipulation
Instruction sets encompass a variety of instruction types, such as:
  • Arithmetic operations: Execute fundamental arithmetic tasks like addition, subtraction, multiplication, and division.
  • Logical operations: Carry out bitwise logical functions like AND, OR, NOT, and XOR.
  • Data transfer instructions: Transfer data between a CPU's registers and memory.
  • Flow control instructions: Modify the execution path of a program, including jump, branch, and function call operations.
  • Comparison operations: Evaluate two values and establish a condition flag based on the outcome.
  • Bit manipulation instructions: Shift or rotate bits within a value, often employed for effective multiplication or division.
To further understand the instruction set it is useful to first understand the difference between high and low level languages.

The are many different programming language, such as Python, Java, C# and even scratch, these languages are known as High Level Languages, they are relatively easy from humans to understand, they follow a similar flow of loops and iterations, and just a small step from structured English to pseudocode to a high level language such as Python. On the opposite end of the scale are low level languages such as Machine code, this is the 1s and 0s as pass through the processor to represent circuit switches and logical operators, Machine code would be very time consuming for a human to interpret and extremely time consuming to program in binary. An intermediate stage is Assembly language , it is relatively easy to understand and whilst a little time consuming, writing a  program in assembly language is realistically possible.  Furthermore to have the ability to understand and program in assembly language can lead to very efficient programs, because maximum efficiency of the processor workings can be considered.

When ever you write a program in a high level language such as Python, the code will first be converted to a low level language before it can run.

Various makes and models of processors have their own instruction set, with instructions such as load data, store data, compare date and many more. The instruction set can be represented in machine code and in assembly code, below is a table showing frequently use instruction set instructions, shown in assembly language.
Picture
Instruction set from Cambridge International AS and A level Computer Science 9608, 2017, 2018, 2019 Syllabus
The instruction comprises of two parts, the opcode and operand.

Opcode (Operation Code): The opcode is the part of an instruction that represents the specific operation or action the CPU should perform. It tells the CPU what to do, such as add, subtract, load data, or jump to another instruction.

Operand: The operand is the part of an instruction that specifies the data or registers the CPU should use when performing the operation. Operands can be values, memory addresses, or registers.

The opcode tells the CPU which operation to perform, while the operand provides the necessary data or specifies the location of the data needed for that operation
PROCESSING THE INSTRUCTION

A CPU processes instructions in a series of steps that involve fetching the instruction from memory, decoding it, executing it, and storing the result. Let's consider the example of a Load (LDD) instruction, which loads data from memory into a register.

Example steps involved in processing the LDD instruction:
  • Fetch: The CPU fetches the LDD instruction from the memory location pointed to by the program counter (PC). The PC is then incremented to point to the next instruction in the sequence.
  • Decode: The CPU decodes the fetched instruction to determine the operation (in this case, LDD) and its operands. The operands typically include the register where the data will be loaded and the memory address of the data.
  • Execute: The CPU performs the LDD operation by reading the data from the specified memory address.

When the CPU processes a Load (LDD) instruction, it fetches the instruction from memory, decodes it to determine the operation and operands, reads the data from memory, and loads it into the specified register.
Picture
1: ​Which of the following statements best describes the difference between high and low-level languages?
A. High-level languages are machine-specific, while low-level languages are more human-readable.
B. High-level languages are closer to machine code, while low-level languages are easier for humans to understand.
C. High-level languages are easier for humans to understand, while low-level languages are closer to machine code.
D. High-level languages require more memory, while low-level languages require less memory.

2: What is the primary function of a compiler?
A. To execute high-level language code directly
B. To convert high-level language code into machine code
C. To interpret high-level language code line-by-line
D. To debug high-level language code

3: What is the primary function of an interpreter?
A. To execute high-level language code directly
B. To convert high-level language code into machine code
C. To interpret high-level language code line-by-line
D. To debug high-level language code

4: Which of the following best describes assembly language?
A. A human-readable representation of machine code
B. A high-level programming language
C. A language that is directly executable by the CPU
D. A language that requires an interpreter

5: Which of the following best describes machine code?
A. A high-level programming language
B. A human-readable representation of assembly language
C. Binary code that can be directly executed by a CPU
D. A language that requires a compiler

6: In a CPU instruction, what is the difference between an opcode and an operand?
A. An opcode specifies the data, while an operand represents the operation to be performed.
B. An opcode represents the operation to be performed, while an operand specifies the data.
C. An opcode and an operand both represent operations to be performed.
D. An opcode and an operand both specify the data.

7: What is the primary purpose of the Current Instruction Register (CIR)?
A. To hold the address of the next instruction to be executed
B. To store the currently executing instruction
C. To perform arithmetic and logic operations
D. To hold the result of arithmetic and logic operations

8: What is the primary reason for using low-level languages in certain situations?
A. They provide more abstraction and are easier to learn.
B. They allow for more efficient use of system resources and finer control over hardware.
C. They are platform-independent and widely supported.
D. They require less memory and processing power to run.
Picture
ALSO IN THIS TOPIC
3.1.1 COMPUTER ARCHITECTURE | The role of the CPU
3.1.2 COMPUTER ARCHITECTURE | Components of the CPU
3.1.3 COMPUTER ARCHITECTURE | Core's, Cache and Clock speed
3.1.4 COMPUTER ARCHITECTURE(CIE) | The Instruction Set
3.1.5 COMPUTER ARCHITECTURE | Embedded Systems
3.2.1 INPUT AND OUTPUT DEVICES | Input Devices
3.2.2 INPUT AND OUTPUT DEVICES | Output Devices
3.2.3 INPUT AND OUTPUT DEVICES | Sensors
3.3 DATA STORAGE | Primary, Secondary, Virtual and Cloud storage
3.4 NETWORK HARDWARE | Networks, Components and Protocols
REVISION CARDS | Flip cards to help test yourself
TOPIC 3 KEY TERMINOLOGY
TOPIC 3 ANSWERS
TOPIC 3 TEACHER RESOURCES
Picture
SUGGESTIONS
We would love to hear from you
SUBSCRIBE 
To enjoy more benefits
We hope you find this site useful. If you notice any errors or would like to contribute material then please contact us.