Lesson 4 of 6
Series 7 - Lesson 4

Programming Languages: High vs Low Level

Every programming language sits somewhere between human English and binary machine code. Where it sits determines how easy it is to write, how fast it runs, and how much control the programmer has over the hardware.

40 minutes GCSE Programming Languages
The CPU speaks one language. Everything else is a translation.

When you write Python or Java or C++, the CPU cannot execute it. At all. The CPU only understands one thing: binary machine code instructions - 0s and 1s that directly correspond to operations like "move this value into this register" or "add these two numbers".

Every programming language above machine code is an abstraction - a more human-readable way of expressing instructions that must ultimately be translated back into binary before the CPU can run them.

Think: If you had to write a program to add two numbers together in pure binary, what would that look like? Why might that be a problem for writing complex software?
Three levels of programming language

Click each level to understand what it is, how it looks, and when it is used.

High-Level Languages (HLL) Python, Java, C++, JavaScript

High-level languages are designed to be read and written by humans. They use vocabulary close to English, have structures like loops, functions and classes, and abstract away hardware details completely. A programmer does not need to know whether the CPU has 4 or 8 registers - the language handles it.

Advantages: Easy to read, write and debug. Portable - the same Python code runs on Windows, Mac and Linux. Large standard libraries speed up development. Errors are usually caught with helpful messages.

Disadvantages: Requires translation (compiler or interpreter) before execution. Slower than low-level code. Less control over hardware - not suitable for device drivers or OS kernels where precise hardware access is needed.

Assembly Language (Low-Level) ARM, x86, MIPS assembly

Assembly language uses short text codes called mnemonics (e.g. MOV, ADD, CMP, JMP) to represent individual machine code instructions. Each assembly instruction maps directly to one machine code instruction. It is specific to a processor architecture - ARM assembly for a smartphone is completely different from x86 assembly for a desktop PC.

Advantages: Much easier to read than binary machine code. Direct control over hardware. Can be highly optimised for a specific processor. Used in embedded systems, real-time controllers, and performance-critical inner loops.

Disadvantages: Not portable - must be rewritten for different processor architectures. Extremely tedious for large programs. A single bug is hard to find. Requires detailed knowledge of the specific CPU.

Machine Code (Lowest Level) Binary instructions

Machine code is the only language a CPU can execute directly. It consists entirely of binary digits (0s and 1s) grouped into instructions. Each instruction specifies an operation code (opcode) and the data to operate on. Modern processors execute billions of these instructions every second.

Advantages: Executes directly on the CPU with no translation overhead. Maximum possible speed. Full hardware control.

Disadvantages: Practically impossible to write by hand for anything complex. Extremely difficult to read or debug. No portability whatsoever - every processor family has its own instruction set.

The same task: add two numbers and store the result

Here is the same operation - add 5 and 3, store the result - written in all three language levels. Notice how the level of human-readability inversely relates to hardware proximity.

Python (HLL)
x = 5
y = 3
result = x + y
print(result)
Assembly (ARM)
MOV R0, #5
MOV R1, #3
ADD R2, R0, R1
; result in R2
Machine Code
11100011 10100000
00000101 00000001
11100000 10000001
00000010 00000001
...

The Python version is immediately readable by anyone. The assembly version requires knowing ARM register names and mnemonics. The machine code version is binary that only the CPU can process directly.

Comparing language levels for the exam
Feature Machine Code Assembly High-Level
Ease of writing Very difficult Difficult Easy
Execution speed Fastest Very fast Slower
Hardware control Full control Full control Limited
Portability None Very limited High
Debugging Extremely hard Hard Easier
Translation needed None Assembler Compiler/Interpreter
Where it is used Rarely written by hand; output of compilers Device drivers, embedded systems, bootloaders Almost all commercial software development
Exam focus

A 4-mark question might ask: "Give two advantages of using a high-level language rather than assembly language." Good answers reference portability (runs on different hardware without rewriting), ease of development (faster to write and debug), and availability of libraries. Always link the advantage to a reason: "it is portable because it does not rely on specific hardware instructions".

Language level sorter

Drag each code snippet or description into the correct language level.

Language Level Sorter
Drag items into machine code, assembly or high-level
print("Hello")
MOV R0, #10
10110000 01100001
for i in range(10):
ADD R1, R0, R2
11000011 00000000
Portable across platforms
Uses mnemonics like CMP
Executed directly by CPU
Machine Code
Assembly
High-Level
Think deeper

Modern CPUs in smartphones use ARM architecture. Desktop CPUs typically use x86. A program compiled for x86 will not run on ARM. Yet apps like Chrome and Spotify run on both. How is that possible?

There are several approaches. Some apps are written in high-level languages that are re-compiled for each platform (producing different machine code for x86 vs ARM). Others use intermediate bytecode (like Java's JVM or .NET's CLR) which runs on a virtual machine that exists for each platform. Apple went further in 2020 with Rosetta 2 - a real-time translation layer that converts x86 machine code to ARM instructions on the fly when running older apps on M1 Macs. This translation happens so fast users rarely notice.
Lesson 4 - Software Series
Programming Languages: High vs Low Level
Starter activity
Show the same task (add two numbers and print the result) written in binary machine code, assembly language, and Python. Ask: which is easiest to read? Which runs without any translation? Which would work on a different processor?
Lesson objectives
1
Describe the characteristics of machine code and explain why programmers rarely write it directly.
2
Explain what assembly language is and identify a situation where it is preferred over a high-level language.
3
State three advantages of high-level languages over low-level languages.
4
Define portability and explain which types of language are portable and why.
Key vocabulary
Machine code
Binary instructions executed directly by the CPU. Specific to one processor architecture. No translation needed.
Assembly language
Low-level language using mnemonics such as MOV and ADD. One mnemonic maps to one machine code instruction.
Mnemonic
A short, human-readable code representing a machine instruction, e.g. MOV for move, ADD for addition.
High-level language
Language that abstracts away hardware detail. Python, Java, C# are examples. Portable and readable but needs translation.
Portability
Ability of code to run on different hardware or operating systems without modification. High-level languages are portable; machine code is not.
Discussion questions
If high-level languages are easier to write and are portable, why do some operating systems and game engines still contain sections of assembly language?
A game engine is written in C++ while a data analysis script uses Python. What does this tell us about how performance requirements influence language choice?
Does writing in a high-level language make a programmer less skilled because they no longer need to understand the hardware?
Exit tickets
State two differences between a high-level and a low-level programming language. [2 marks]
Explain what is meant by portability. Give one example of a portable language and explain why it is portable. [3 marks]
Describe one advantage and one disadvantage of using assembly language instead of a high-level language. [4 marks]
Homework suggestion
Find the same simple task (e.g. calculate a factorial) written in three different programming languages. Compare: number of lines, readability, and what hardware knowledge is needed to understand each version.