TopMyGrade

GCSE/Computer Science/OCR

2.5.1Languages: high-level vs low-level; characteristics and uses; need for translators

Notes

Programming languages: high-level vs low-level

OCR J277 Paper 2 tests language levels and translators — usually 4–6 mark questions. Know the characteristics, advantages and disadvantages of each level, and which translator is used for each.

Levels of programming language

Machine code (level 0 — lowest level)

  • Binary instructions that the CPU executes directly (no translation needed).
  • Specific to a particular CPU architecture (not portable).
  • Very difficult for humans to read and write.
  • Used in: no modern development — only generated by compilers/assemblers.

Assembly language (low-level)

  • Uses mnemonics (short abbreviations) to represent machine code instructions.
  • One-to-one correspondence with machine code: one assembly instruction = one machine code instruction.
  • Translated by an assembler.
  • Advantages: direct hardware control; very efficient; used for device drivers, embedded systems, real-time systems.
  • Disadvantages: complex; not portable (tied to CPU architecture); hard to debug.

High-level languages (e.g. Python, Java, C++, C#)

  • Written in a human-readable form with English-like syntax.
  • One statement can generate many machine code instructions.
  • Translated by a compiler or interpreter.
  • Advantages: easier to write, read and debug; portable (can run on different hardware); faster development.
  • Disadvantages: slightly less efficient than hand-written assembly; less direct hardware control.

Translators

TranslatorHow it worksAdvantageDisadvantage
AssemblerConverts assembly language into machine codeDirect one-to-one translationOnly for assembly language
CompilerTranslates the entire source code into machine code at once; produces an executableFast at run time (no translation needed during execution); source code protected (not distributed)Slow compilation; errors all reported together; not interactive
InterpreterTranslates and executes one line at a timeEasy to debug (stops at first error); cross-platformSlower at run time (translating each time it runs); source code must be distributed

When to use each translator

  • Compiler: production software where speed matters; distributing software without sharing source code (e.g. commercial apps).
  • Interpreter: development/testing (easier debugging); scripting languages; Python in interactive mode; web browsers executing JavaScript (JIT compilation is a mix).

Common OCR exam mistakes

  1. Saying machine code "needs to be translated" — it does NOT. It runs directly on the CPU.
  2. Saying compilers are "better" than interpreters — it depends on the use case. Interpreters are better for debugging; compilers are better for production performance.
  3. Confusing assembler with compiler — an assembler converts assembly language (mnemonics); a compiler converts high-level language code.
  4. Forgetting portability: high-level languages are generally portable (can run on different hardware if a compatible interpreter/compiler exists); machine code and assembly are not portable.

AI-generated · claude-opus-4-7 · v3-ocr-computer-science

Practice questions

Try each before peeking at the worked solution.

  1. Question 16 marks

    Compiler vs interpreter

    Compare compilers and interpreters. Your answer should include when each is appropriate. [6 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science

  2. Question 24 marks

    High-level vs low-level language

    Give two advantages of using a high-level language rather than assembly language for writing a software application. [4 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science

  3. Question 32 marks

    Why use assembly language?

    Give one situation where assembly language would be preferred over a high-level language. Explain why. [2 marks]

    Ask AI about this

    AI-generated · claude-opus-4-7 · v3-ocr-computer-science

Flashcards

2.5.1 — Languages: high-level vs low-level; characteristics and uses; need for translators

10-card SR deck for OCR Computer Science (J277) topic 2.5.1

10 cards · spaced repetition (SM-2)