Skip to main content
ScotlandComputer ScienceSyllabus dot point

What are the main parts of a processor and how do they work together to run a program?

The structure of a computer: the processor (ALU, control unit and registers), the buses (data and address) used to read from and write to memory, and the difference between an interpreter and a compiler.

An SQA Higher Computing Science answer on computer structure, covering the processor (ALU, control unit and registers), the data and address buses used to access memory, and the difference between an interpreter and a compiler.

Generated by Claude Opus 4.811 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this key area is asking
  2. The processor
  3. Memory and the buses
  4. Interpreters and compilers
  5. Examples in context
  6. Try this

What this key area is asking

The SQA wants you to know the structure of a computer: the processor and its parts (the ALU, the control unit and registers), the buses (data and address) used to read from and write to memory, and the difference between an interpreter and a compiler.

The processor

  • The ALU does the actual work: arithmetic (add, subtract) and logic (compare, AND/OR), producing results from the values it is given.
  • The control unit runs the fetch-decode-execute cycle: it fetches the next instruction from memory, decodes it (works out what it means), and signals the other parts to carry it out, keeping everything in step.
  • Registers are the fastest storage in the machine, inside the processor, holding the current instruction, the data being operated on and intermediate results. They are tiny but immediate, far faster than main memory.

Memory and the buses

Programs and data live in main memory (RAM), outside the processor. The processor accesses memory over two buses, sets of parallel wires that carry signals.

So a memory read works like this: the control unit puts the address on the address bus, sends a "read" signal, and the value comes back on the data bus into a register. A write puts both the address and the value out, with a "write" signal, and memory stores it.

Interpreters and compilers

High-level code (the kind you write) must be translated into the binary machine code the processor runs. There are two kinds of translator.

  • A compiler gives a program that runs faster (already machine code, no translation at run time) and can be shared without the source or the translator. Its downside is that you must recompile after every change, and errors are reported only when you compile.
  • An interpreter reports errors line by line as the program runs, which makes debugging easier, and the same source runs on any machine that has the interpreter. Its downside is slower execution, because each line is translated every time it runs.

Examples in context

This structure is the von Neumann model behind almost every computer, from a phone to a supercomputer. The address bus width explains a famous limit: a 32-bit address bus can address only about 4 GB of memory, which is why 64-bit systems were needed for more RAM. The compiler/interpreter split is visible day to day: C and Swift are typically compiled for speed, while Python is typically interpreted for quick development and portability, and many languages now do a bit of both (just-in-time compilation).

Try this

Q1. Name the part of the processor that performs calculations and logical comparisons. [1 mark]

  • Cue. The arithmetic logic unit (ALU).

Q2. State which bus carries the value being read from memory and whether it is one- or two-directional. [2 marks]

  • Cue. The data bus; it is bidirectional.

Q3. State one advantage of a compiler over an interpreter. [1 mark]

  • Cue. The compiled program runs faster at run time (and can be distributed without the source or translator).

Exam-style practice questions

Practice questions written in the style of SQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

SQA Higher (style)4 marksDescribe the role of the data bus and the address bus when the processor reads a value from memory.
Show worked answer →

To read a value from memory, the processor uses both buses together.

The address bus carries the address (the location) of the memory cell the processor wants to access. It is one-directional, from the processor to memory, and its width sets how many locations can be addressed.

The data bus then carries the actual value stored at that location back from memory to the processor. The data bus is bidirectional, because the same bus carries data to memory on a write and from memory on a read.

So for a read: the address bus selects the location, a read control signal is sent, and the data bus brings the value back to the processor.

Markers reward the address bus carrying the location (processor to memory) and the data bus carrying the value (bidirectional, here memory to processor), used together for the read.

SQA Higher (style)4 marksExplain the difference between a compiler and an interpreter, and give one advantage of each.
Show worked answer →

A compiler translates the whole high-level program into machine code in one go, producing a separate executable file that is then run. An interpreter translates and executes the program one instruction (or line) at a time, every time the program runs, without producing a separate executable.

Advantage of a compiler: the compiled program runs faster (it is already in machine code, with no translation needed at run time) and can be distributed without the source code or the translator.

Advantage of an interpreter: errors are reported as each line runs, which makes development and debugging easier, and the same code can run on any machine that has the interpreter.

Markers reward compiler = translates all at once into a separate executable, interpreter = translates and runs line by line each time, plus a valid advantage of each (compiler faster at run time; interpreter easier to debug or more portable).

Related dot points

Sources & how we know this