Worth about 8 of the 75 marks on a typical Paper 1. Compilers vs interpreters and interrupts come up most.

1. System and application software

System softwareApplication software
PurposeProvides the services the computer needs to runProvides the services the user needs to do a task
ExamplesOperating system; utility software such as anti-virus, disk defragmenter, backup and compression toolsWord processor, spreadsheet, web browser, games, photo editor

2. The operating system

The operating system (OS) manages the hardware and lets the user and applications use it.

FunctionWhat it means
Managing filesCreating, naming, saving, moving and deleting files and folders
Handling interruptsResponding to signals from hardware and software that need the CPU’s attention
Providing an interfaceA GUI or command line so the user can interact with the computer
Managing peripherals and driversUsing drivers to communicate with devices such as printers and keyboards
Managing memoryDeciding which programs and data are held in RAM, and where
Managing multitaskingSharing CPU time so several programs appear to run at once
Providing a platform for applicationsApplications run on top of the OS and use its services
Providing system securityPasswords, firewalls and keeping the system updated
Managing user accountsSeparate logins, settings and access rights for each user

3. Hardware, firmware and the OS

Applications run on the operating system. The operating system runs on the firmware: the bootloader, stored in ROM, which loads the OS when the computer starts. The firmware runs on the hardware.

Applicationse.g. web browser, word processorOperating systemruns the applicationsFirmware (bootloader)starts the operating systemHardwareruns the firmwareeach layer runs on the one below
To run an application you need all four layers.

4. Interrupts

An interrupt is a signal from hardware or software asking the CPU for attention.

TypeExamples
Hardware interruptPressing a key, moving the mouse, a printer running out of paper
Software interruptDivision by zero; two processes trying to access the same memory location
  1. The device or program sends an interrupt signal to the CPU.
  2. At the end of each fetch–decode–execute cycle, the CPU checks for interrupts.
  3. If the interrupt has a higher priority than the current task, the CPU saves the state of the current task (its register values).
  4. The CPU runs the interrupt service routine (ISR) that deals with that interrupt.
  5. When the ISR finishes, the saved state is restored and the original task carries on.

5. High- and low-level languages

High-level languageLow-level language
ExamplesPython, Java, Visual BasicMachine code, assembly language
Reading and writingEasy: uses English-like wordsHard: uses binary or mnemonics
DebuggingEasier to find and fix errorsHarder to debug
Machine independenceRuns on different types of computer (once translated)Written for one type of CPU
Hardware controlCannot directly manipulate hardwareCan directly manipulate hardware and memory; efficient, fast code

6. Assembly language

Assembly language is a low-level language that uses short mnemonics instead of binary, for example LDA 5 (load), ADD 6 (add) and STO 7 (store). Each mnemonic matches one machine code instruction. An assembler translates assembly language into machine code.

7. Compilers and interpreters

CompilerInterpreter
How it translatesThe whole program at once, before it runsOne line at a time, running each line straight away
OutputAn executable file that runs without the compilerNo executable; the code is interpreted every time it runs
ErrorsAn error report for the whole program after translationStops at the first error it finds
Best forTranslating the finished program to give to usersDeveloping and testing, because errors are found line by line

Try it: compiler vs interpreter

This program has two errors. Translate it both ways and compare what happens.

Press a button to translate the program.

8. Integrated development environments (IDEs)

An IDE is software that provides the tools a programmer needs in one place.

FunctionHow it helps
Code editorWhere code is typed, often with colour-coded keywords
Run-time environmentLets the program be run and tested inside the IDE
TranslatorsA built-in compiler and/or interpreter
Error diagnosticsHighlights errors and explains them, e.g. the line number
Auto-completionSuggests the rest of a keyword or variable name as you type
Auto-correctionFixes common typing mistakes automatically
PrettyprintFormats code with consistent indentation and colours so it is easier to read

9. Examiner tips

  1. Describe how a compiler or interpreter works when asked about the operation, not its advantages.
  2. Don’t mix up high- and low-level languages. Assembly is low-level.
  3. An assembler translates assembly language; a compiler or interpreter translates high-level code.
  4. Don’t repeat the question. If it says “a translator is used”, answering “a translator” scores nothing.
  5. Interrupts are checked at the end of each FDE cycle, and the current state is saved before the ISR runs.
  6. System vs application: anti-virus is utility (system) software, not an application.
  7. Give OS functions in context: e.g. “manages memory by deciding which programs are held in RAM”.
  8. The bootloader is firmware stored in ROM; it loads the OS.

10. Practice questions

Practice: answer and check instantly

Type a short answer, then press Check or Enter.

Show answer

System software.

Show answer

An interrupt service routine (ISR).

Show answer

Division by zero (or two processes trying to access the same memory location).

Show answer

An assembler.

Show answer

An interpreter.

Show answer

A compiler.

Show answer

Auto-completion.

Show answer

The bootloader.

Exam-style questions

9. Describe how an interrupt is handled by the CPU. [4]

Show mark guide

Any four: an interrupt signal is sent to the CPU · the CPU checks for interrupts at the end of each FDE cycle · the interrupt’s priority is checked · the current task’s state/registers are saved · the interrupt service routine is run · the saved state is restored and the original task resumes.

10. A programmer is writing a new game. Explain why they would use an interpreter while writing it and a compiler for the final version. [4]

Show mark guide

Interpreter: translates line by line and stops at each error [1], so errors can be found and fixed as the code is developed [1]. Compiler: produces an executable file [1], so users can run the game without a translator, and the source code is not shared [1].

11. Topic test: predict your grade

Topic test: predict your grade

15 questions, about 10 minutes. Answer them all, then press Mark my test.

1. Which is application software?
2. Which is NOT a function of an operating system?
3. What does the bootloader do?
4. Which is a hardware interrupt?
5. When does the CPU check for interrupts?
6. What happens before an ISR runs?
7. Which is an advantage of a high-level language?
8. Which is an advantage of a low-level language?
9. Assembly language uses…
10. Which translator is needed for assembly language?
11. A compiler…
12. An interpreter…
13. Why is an interpreter useful while developing a program?
14. Which IDE feature formats code with indentation and colours?
15. Which is utility software?

Frequently asked questions

What is the difference between system software and application software?

System software, such as the operating system and utilities, runs and manages the computer. Application software, such as a word processor or web browser, lets users do specific tasks.

What is the difference between a compiler and an interpreter?

A compiler translates the whole program into machine code before it runs and reports all errors at the end. An interpreter translates and runs one line at a time and stops at the first error.

What is an interrupt?

An interrupt is a signal from hardware or software that tells the processor something needs attention, such as a key press. The processor saves its current task, runs an interrupt service routine, then carries on.