Skip to content

1.1.1 Architecture of the CPU

GCSE · Paper 1 · Computer systems · Section 1.1 · 16 flashcards · 10 practice questions

Questions

1.1.1 Architecture of the CPU

Every computer has a central processing unit (CPU). It is often called the "brain" of the computer, but it does not think. It follows instructions, one after another, very quickly.

Definition
The CPU processes data and instructions. Its job is to fetch each instruction of a program from memory, work out what it means and carry it out.

A program is a list of instructions stored in main memory (RAM). The CPU cannot run them where they are. It must bring them into the CPU one at a time. It does this over and over, millions or billions of times a second, using the fetch-execute cycle.

The fetch-execute cycle

The fetch-execute cycle is the process the CPU repeats for every instruction. It has three stages.

  • 1.
    Fetch. The CPU gets the next instruction from main memory. The Program Counter tells it where that instruction is.
  • 2.
    Decode. The control unit works out what the instruction means and what has to be done.
  • 3.
    Execute. The instruction is carried out. For example, the ALU adds two numbers, or a value is stored in memory.
When the instruction has been executed, the cycle starts again with the next instruction. It keeps going until the program ends.
Key Point
The CPU repeats fetch, decode, execute for every instruction in a program. This is the fetch-execute cycle.
Remember
You do not need to describe how data moves between the parts of the CPU at each stage. You need to know what happens at each stage and what each part is for.

Main components of the CPU

Arithmetic logic unit (ALU)

Definition
The ALU carries out calculations (such as add and subtract) and logical operations (such as comparing two values to see if they are equal).

When a program adds two numbers or checks whether one number is bigger than another, the ALU does the work.

Control unit (CU)

Definition
The control unit controls and coordinates the CPU. It decodes each instruction and tells the other parts what to do, so that the instructions are carried out in the right order.

Cache

Definition
Cache is a small amount of very fast memory in or next to the CPU. It stores the data and instructions the CPU uses most often.

Getting something from RAM is slower than getting it from cache. If the CPU finds what it needs in the cache, it does not have to wait for RAM. This makes the computer faster.

Registers

Definition
A register is a tiny, extremely fast storage location inside the CPU. It holds one piece of data or one address for a short time while the CPU is working on it.

Registers are faster than cache, and cache is faster than RAM. You must know four registers.

Von Neumann architecture

Definition
In Von Neumann architecture, the instructions of a program and the data it uses are stored together in the same main memory. The CPU fetches both from there.

Almost all modern general-purpose computers are built this way. It means a computer can run any program that is loaded into memory, not just one fixed program.

The Von Neumann design uses four registers. Each has one job.

RegisterWhat it is forHolds
Program Counter (PC)Keeps track of where the next instruction is in memoryAn address
Memory Address Register (MAR)Holds the address of the memory location that is about to be read from or written toAn address
Memory Data Register (MDR)Holds the data (or instruction) that has just been fetched from memory, or is about to be written to memoryData
Accumulator (ACC)Holds the result of calculations done by the ALUData

Data and addresses

Memory is like a long row of numbered boxes. Each box is a memory location. Each location has two things.

  • •
    An address: the number of the box. It says *where* the box is.
  • •
    The data inside it: the value stored in the box. It says *what* is stored.
Worked Example
Memory location 40 contains the value 17.

- The address is 40.
- The data is 17.

To read the value, the MAR holds the address 40. The MDR then holds the data 17 that was fetched from that address.

Do not mix these up. The number 40 and the number 17 might both be stored in registers, but they mean different things. One says where to look. The other is what was found.

Warning
A register that holds an address does not hold the data at that address. The MAR holds *where* to look. The MDR holds *what was found*.

Putting it together

A program has the instruction "add 5 to the running total".

  • •
    The Program Counter points to where this instruction is stored.
  • •
    The instruction is fetched from memory and decoded by the control unit.
  • •
    It is executed: the ALU does the addition.
  • •
    The result is held in the accumulator.
  • •
    Data that is used often may be found in the cache, which saves a trip to RAM.

Exam technique

  • •
    State and give: one short fact per mark. "State the purpose of the ALU."
  • •
    Describe: say what happens at each stage, in order. For the fetch-execute cycle, name all three stages and say what happens in each.
  • •
    Explain: give a reason. "Cache makes the CPU faster because it stores frequently used data close to the CPU, so the CPU does not wait for RAM."
  • •
    For registers, always say what it holds and whether that is an address or data.
  • •
    Use the exact name: "fetch-execute cycle". Do not write about wires or buses between the parts. It is not needed.