GCSE Revision

Architecture of the CPU

What the CPU does

The CPU (central processing unit) is the part of a computer that processes data and instructions. Every program, from a game to a web browser, is a long list of instructions, and the CPU carries them out one after another, billions of times a second.

Most computers follow the Von Neumann architecture: the instructions and the data they work on are stored together in the same memory. The CPU fetches each instruction from memory, works out what it means, and carries it out.

CPUMain memoryAddressDataControlALUControl unitCachePCMARMDRAccumulator

The diagram shows the parts inside the CPU, and the memory it fetches from.

Key terms

The parts of the CPU

PartWhat it does
ALU (arithmetic logic unit)Does the calculations (such as adding) and the logic (comparing values, such as whether one is bigger)
CU (control unit)Decodes each instruction and sends signals that control the other parts, so the fetch–execute cycle runs in step
CacheA small amount of very fast memory inside the CPU. It holds instructions and data that are used often, so the CPU doesn't have to wait for slower RAM
RegistersTiny, super-fast stores inside the CPU, each holding one value the CPU is using right now

Key terms

The four registers

RegisterWhat it holdsData or address?
Program counter (PC)The address of the next instruction to fetchAddress
MAR (memory address register)The address in memory that is about to be read from or written toAddress
MDR (memory data register)The data or instruction just fetched from memory, or about to be written to itData
AccumulatorThe results of calculations done by the ALUData

Remember

An address says where something is stored in memory, like a house number. Data is what is stored there, like the people inside. The PC and MAR hold addresses; the MDR and accumulator hold data.

Key terms

The fetch–execute cycle

1. PC → MARcopy the address2. Fetchinstruction → MDR; PC + 13. Decodeby the control unit4. Executeresults in the accumulatorThe cycle repeats for each instruction

The CPU repeats these steps for every instruction:

Fetch

  1. The address in the program counter is copied into the MAR.
  2. The program counter goes up by 1, so it points to the next instruction.
  3. The instruction stored at the address in the MAR is fetched from memory into the MDR.

Decode

  1. The control unit decodes the instruction to work out what to do.

Execute

  1. The instruction is carried out. A calculation is done by the ALU, with the result held in the accumulator; or data is read from or written to memory, using the MAR and MDR.

Then the cycle repeats. You don't need to know exactly how data passes between the registers, but you do need what happens at each stage and what each register holds.

Common mistake

The program counter holds the address of the next instruction, not the instruction itself.

Take the quiz