Session XP: 0
Topic 3BComponent 1

Programming Languages & Translators

High-level vs low-level, assembly language, machine code, compilers vs interpreters. Jun 2022 Q2(a) and Jun 2023 Q1(b) both tested this topic.

Best score
Last attempt
Best attempt progress
0
XP earned
Watch first — Craig 'n' Dave
Craig 'n' Dave · Edexcel 1CP2Programming Languages and Translators
Key facts

High-level vs low-level languages

  • High-level: English-like keywords (if, while, print), portable (runs on different hardware), abstracted from hardware, one line = many machine code instructions. Examples: Python, Java, C#.
  • Low-level: specific to one CPU/architecture, direct hardware control, very efficient (fast, small), harder to write. Two types: assembly language and machine code.
  • Assembly language: uses mnemonics (MOV, ADD, LDR). One instruction = one machine code instruction. Assembled by an assembler.
  • Machine code: binary (0s and 1s). Directly executed by CPU. No translation needed.

Translators

  • Compiler: translates entire program at once → produces executable file. Errors reported at end. Executable is architecture-specific. Program runs faster after compilation.
  • Interpreter: translates and executes one line at a time. Errors reported immediately. No executable produced — must re-translate every time. Easier for debugging.
  • Assembler: translates assembly language → machine code.
  • Key exam point: "machine code is the only language the CPU can execute directly" — everything else must be translated.

Why low-level languages are used

Exam questions — 4 questions · 11 marks · from real 1CP2 past papers
1 markCompiler vs interpreter1CP2 Jun 2024 Q4(a) style

Which statement correctly describes a compiler?

A It translates one line at a time and reports errors immediately
B It translates the whole program at once, reporting errors at the end, and produces an executable file
C It translates assembly language into machine code one instruction at a time
D It executes programs without any translation
1 markMachine code1CP2 Jun 2023 Q1(b)(i) style

What language does a CPU execute directly without translation?

A Assembly language
B Python
C Machine code
D High-level language
2 marksWhy low-level language1CP2 Jun 2022 Q2(a)(iii) style

Explain two reasons why a programmer might choose to write code in a low-level language rather than a high-level language. (2 marks)

Hint: Name the reason AND explain why it makes low-level preferable. Cover hardware access OR speed/efficiency.
+20 XP
4 marksHigh-level vs low-level extended1CP2 Jun 2024 Q4(f) style — 6-mark levelled

A team is building a smartphone. Discuss whether they should use a high-level or low-level language to write (a) the device drivers for the built-in camera and (b) the email application. (4 marks)

Hint: Cover BOTH parts: device driver (low-level — hardware access, speed, memory) AND email app (high-level — portability, libraries, readability). This is a linked discussion — points should connect.
+40 XP

Module complete! 🎉

Score loading...

+10 XP