← IGCSE Computer Science Paper 1

Machine code

The binary (0s and 1s) form of instructions that the CPU can run directly. Each instruction has an opcode and an operand. Programs must be translated into it to run.

Understanding Machine code in IGCSE Computer Science Paper 1

What it does: The first part of the instruction is the opcode that says what to do. The second part is the operand that says what to use it on. The CPU only understands binary, so a translator (compiler or interpreter) converts the program into machine code first. The operand is the data, or the address of the data, that the operation acts on. Computers use binary because their circuits have two states, on and off. Binary is hard for humans to read.

Common mistakes: Machine code is made only of 0s and 1s. The digit 2 is not allowed, so the line should be '10110001'. The opcode is the first part of the instruction, so it should be instruction[:4]. [4:] gives the operand, which is the data or address.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 240–251) and word search (Modules 240–261).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which form of instruction can the CPU run directly?
Machine codePython source code
Matches
The CPU can run Python code directly without any translation.
↓
The CPU can only run machine code. Python code must be translated into machine code first.
Applying
Meanings
Term
machine code
Meaning
The binary (0s and 1s) form of instructions that the CPU can run directly. Each instruction has an opcode and an operand. Programs must be translated into it to run.
Practice
opcode operand
Testing
Gaps
instruction ← + operand
Check Answer
Spots
1machine_code = '10110021'
2opcode = machine_code[:4]

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Cosmic Owl' badge — Comprehension Guru, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which form of instruction can the CPU run directly?
A. Machine code ✓
B. Python source code
The CPU only understands binary machine code. Programs written in languages like Python must be translated first.
2. Machine code is written using...
A. 0s and 1s (binary) ✓
B. English words and symbols
Machine code is made up of binary digits, 0s and 1s, which match the on/off states of the CPU's circuits.
3. In a machine code instruction, what does the opcode show?
A. The operation to carry out, such as add or load ✓
B. The data or address the instruction uses
The opcode says what to do. The operand is the data or address to do it with.
4. In a machine code instruction, what does the operand hold?
A. The name of the programming language
B. The data or address to be used ✓
The operand is the data, or the address of the data, that the operation acts on.
5. A program written in a high-level language must be...
A. Sent straight to the ALU as typed
B. Translated into machine code before the CPU can run it ✓
A translator, such as a compiler or interpreter, converts the program into machine code so the CPU can run it.

Match the Pairs

10110001 00000101 → A machine code instruction written as 0s and 1s, which the CPU can run directly
opcode → The part of a machine code instruction that tells the CPU which operation to perform
Each machine code instruction is split into an opcode (the operation) and an operand (the data or address) → opcode: 0001 operand: 0111
A program written in a high-level language must be translated into machine code before the CPU can run it → source code -> translator -> 01001101
The CPU can run Python code directly without any translation. → The CPU can only run machine code. Python code must be translated into machine code first.
In an instruction, the operand tells the CPU which operation to do. → The opcode tells the CPU which operation to do. The operand is the data or address the operation uses.

Key Term

machine code
The binary (0s and 1s) form of instructions that the CPU can run directly. Each instruction has an opcode and an operand. Programs must be translated into it to run.

Fill in the Blanks

1. instruction ← opcode + operand
Hint: Type the part of an instruction that says which operation the CPU should carry out.
2. instruction ← opcode + operand
Hint: Type the part of an instruction that holds the data or address to work on.
3. instruction ← 00010101 // 8 bits
Hint: Type the name for each single 0 or 1 in machine code.
4. 1010 0011 // opcode: 1010 operand: 0011
Hint: Type the binary pattern for the opcode, which is the first half of the instruction.
5. code ← TRANSLATE(source)
Hint: Type the name of the step that converts a program into machine code before the CPU can run it.

Spot the Error

Question 1
A machine_code = '10110021'
B opcode = machine_code[:4]
C operand = machine_code[4:]
D print(opcode, operand)
Line A — Machine code is made only of 0s and 1s. The digit 2 is not allowed, so the line should be '10110001'.
Question 2
A instruction = '00110010'
B opcode = instruction[4:]
C operand = instruction[4:]
Line B — The opcode is the first part of the instruction, so it should be instruction[:4]. [4:] gives the operand, which is the data or address.
Question 3
A source = 'ADD 5'
B translator = Assembler()
C machine_code = translator.run(source)
D cpu.run(source)
Line D — The CPU can only run machine code. The source code must be translated first, so it should be cpu.run(machine_code).
Question 4
A # 8-bit instruction
B opcode = 'ADD'
C operand = '1100'
D instr = opcode + operand
Line B — In machine code the opcode is written in binary, for example '0101'. The word ADD is assembly language, not machine code.
Question 5
A opcode = '0001'
B operand = '0101'
C instruction = opcode - operand
D print(instruction)
Line C — A machine code instruction is the opcode followed by the operand, joined together with +. The - operator cannot join the two binary strings.

Student with a class code? Join your class →