Computer architecture

Computer Science · Hardware. The idea in plain words, the rules to remember, the mistake to avoid and a worked example, written and checked by Mega Lecture.

Test this topic freeAll Computer Science topics

The idea

The CPU processes the instructions and data in a computer. A microprocessor is a CPU built on a single integrated circuit (chip).

In the Von Neumann model, programs and data are stored together in memory. The CPU repeats one cycle again and again: fetch the next instruction from memory, decode it, then execute it. Small, very fast stores inside the CPU called registers hold the addresses and data needed during the cycle, and buses carry them between the CPU and memory.

How fast a CPU works depends on its clock speed, its number of cores and the size of its cache.

In simpler words

The CPU runs a computer's instructions. It repeats one cycle over and over: fetch an instruction from memory, decode it, then execute it. Small fast stores inside the CPU, called registers, hold the addresses and data it needs. Buses carry them between the CPU and memory. A faster clock, more cores and a bigger cache make the CPU faster.

An everyday comparison

The fetch-decode-execute cycle is like a cook following a recipe book. A bookmark shows the next step, like the PC; the cook reads the step at that page, like the MAR and MDR, works out what it means, then does it. The comparison stops working because the CPU repeats billions of cycles a second and uses several separate registers for jobs one cook does alone.

Rules to remember

Common mistake

Students confuse the PC and the MAR. The PC holds the address of the next instruction; the MAR holds the address in use right now.

In the exam

Describe the fetch stage register by register, in order: the address in the PC is copied to the MAR, the PC is incremented, the instruction is fetched along the data bus into the MDR, then copied to the CIR. Then the CU decodes it and it is executed. Name the buses with their direction. For performance, link each factor, clock speed, cores or cache, to why it makes processing faster.

Worked example

The PC holds 200. One instruction is fetched. What do the PC and the MAR hold after the fetch stage?

  1. The address in the PC, 200, is copied to the MAR.
  2. The PC is increased by 1, so it now holds 201, ready for the next instruction.
  3. The instruction stored at address 200 travels along the data bus to the MDR and is copied to the CIR. The MAR still holds 200.

Answer: The PC holds 201 and the MAR holds 200.

Ask about this

Type what you are stuck on. The helper finds the explanation, worked examples and the notes to read, free and instant.

Keep going

← EncryptionInput and output devices →Take a Computer Science test