← IGCSE Computer Science Paper 1

Machine independence

A language whose code can run on different types of computer. High-level languages are machine independent (portable); low-level languages are machine dependent.

Understanding Machine independence in IGCSE Computer Science Paper 1

What it does: High-level code like this is not tied to any CPU, so one program can be translated for each machine. Assembly mnemonics match one CPU's instruction set, so this code will not run on a different type of CPU. Machine code is made of the instructions of one CPU type, so it only works on that type of processor. Machine independent (portable) means the same source code can be used on many types of computer.

Common mistakes: Python is a high-level language, so level should be "high". High-level languages are the portable, machine independent ones. Assembly is a low-level language, so it is machine dependent. Python is high-level and portable, so the language on line 1 should be "Assembly".

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 419–429) and word search (Modules 419–439).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which type of language is machine independent?
High-level languageLow-level language
Matches
"Assembly code written for one CPU will run on any computer."
↓
Low-level code is machine dependent. It uses the instruction set of one CPU type, so it will not run on a different type of CPU without being rewritten.
Applying
Meanings
Term
machine independent
Meaning
A language whose code can run on different types of computer. High-level languages are machine independent (portable); low-level languages are machine dependent.
Practice
level = "high-level"
Testing
Gaps
highLevelPortable ←
Check Answer
Spots
1language = "Python"
2level = "low"

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

The 'Arctic Fox' badge — Tundra Tracker, 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 type of language is machine independent?
A. Low-level language
B. High-level language ✓
High-level languages are not tied to one CPU, so the same program can run on different types of computer.
2. Low-level code written for one type of CPU will usually run on a different type of CPU.
A. True
B. False ✓
Low-level code is machine dependent. It uses the instruction set of one CPU type, so it will not usually work on another.
3. Why is assembly code machine dependent?
A. Each CPU type has its own instruction set ✓
B. All CPUs share the same instruction set
Assembly instructions match the instruction set of one CPU type, so code for one CPU does not fit another.
4. A student writes one Python program and runs it on a Windows laptop and on a Mac. What does this show?
A. High-level code is portable ✓
B. High-level code is machine dependent
The same high-level program can run on different computers because a translator on each machine converts it for that machine.
5. How can the same high-level program run on two different types of computer?
A. It is translated separately for each machine ✓
B. It is rewritten in assembly for both machines at once
Each machine uses a translator that produces code for its own CPU. The programmer does not need to rewrite the program.

Match the Pairs

machine independent → Code written in this kind of language can run on different types of computer, as long as each one has a translator. High-level languages are like this.
machine dependent → Code written in this kind of language only works on one type of CPU because it uses that CPU's own instruction set. Low-level languages are like this.
A high-level program is portable: the same source code can be translated separately for a PC and a phone → print("Hello") # same code on PC and phone
Assembly code is machine dependent because each CPU type has its own instruction set → MOV AX, 5 ; works on one CPU type only
"Assembly code written for one CPU will run on any computer." → Low-level code is machine dependent. It uses the instruction set of one CPU type, so it will not run on a different type of CPU without being rewritten.
"A high-level program can run on any computer without being translated." → A high-level program is portable, but each type of computer still needs a translator (compiler or interpreter) to turn it into its own machine code.

Key Term

machine independent
A language whose code can run on different types of computer. High-level languages are machine independent (portable); low-level languages are machine dependent.

Fill in the Blanks

1. highLevelPortable ← TRUE
Hint: Type the Boolean value that shows a high-level language is machine independent (portable).
2. lowLevelPortable ← FALSE
Hint: Type the Boolean value that shows low-level code is machine dependent, so it is not portable.
3. FOR i ← 1 TO numMachines TRANSLATE(program, i) NEXT i
Hint: Type the keyword that sets the end of the loop range, because a high-level program is translated separately for each machine.
4. differentSets ← intelSet ≠ armSet
Hint: Type the comparison operator meaning 'not equal', because each CPU type has its own instruction set.
5. IF machineDependent = TRUE THEN OUTPUT "New code needed per CPU" ENDIF
Hint: Type the comparison operator that checks whether the code is machine dependent.

Spot the Error

Question 1
A language = "Python"
B level = "low"
C portable = True
D print(portable)
Line B — Python is a high-level language, so level should be "high". High-level languages are the portable, machine independent ones.
Question 2
A language = "Python"
B machine_independent = False
C print(machine_independent)
Line A — Assembly is a low-level language, so it is machine dependent. Python is high-level and portable, so the language on line 1 should be "Assembly".
Question 3
A def is_portable(level)
B return level == "high"
C print(is_portable("high"))
Line A — A function definition must end with a colon. The line should be def is_portable(level): so the function can run and check that high-level code is portable.
Question 4
A cpu_a = "x86"
B cpu_b = "ARM"
C print("Each has its own set")
D same_set = True
Line D — Each type of CPU has its own instruction set, so x86 and ARM do not share one. same_set should be False, which is why low-level code is machine dependent.
Question 5
A code = "assembly"
B machine_dependent = True
C if not machine_dependent:
D print("Rewrite code")
Line C — Machine dependent code must be rewritten for a different CPU. The condition should be if machine_dependent:, not its opposite.

Student with a class code? Join your class →