Study Guide

The CPU and Von Neumann Architecture

What the central processing unit does, why a computer keeps its instructions and its data in the same memory, and what each part inside the CPU (the ALU, the control unit, five registers and three buses) is for, discovered through a school kitchen that cooks from numbered recipe cards.

Lesson 3.1 Computer Systems

For: Cambridge IGCSE Computer Science learners, and anyone starting to learn how a computer works inside (Key Stage 3 and above)

Stage: Think

A cook and a folder of cards

In a school kitchen (a made-up one), the cook prepares every lunch from a folder of numbered recipe cards. The folder is kept in a cupboard. The cook works at the counter, with a calculator and a notepad, and an assistant who fetches whatever the cook asks for from the cupboard. The cook never reads the whole folder at once: they take one card, do what it says, then take the next.

Think it through

To follow card after card without losing their place, what does the cook need to keep track of? And what do they do between taking one card and taking the next?

Show what happens

The cook needs to know the number of the next card. Between cards they fetch the card, work out what it says, and then do it. A computer’s processor follows its program in a very similar way, and this lesson looks at the parts it uses to do so.

Stage: Discover

The part that follows the instructions

Almost everything a computer does has the same shape: something goes in, something happens to it, and something comes out.

Think it through

You open a calculator app, tap 7, +, 5 and =, and 12 appears on the screen. Which part of this is the input, which is the processing and which is the output?

Show what happens

The taps are the input, adding 7 and 5 is the processing, and the 12 on the screen is the output.

The part of a computer that does the processing is the central processing unit, or CPU. It carries out the instructions of a program, working on the data that has been input, so that the result can be output. In the kitchen, the cook is the CPU.

In most computers today the CPU is a microprocessor: a CPU built as a single integrated circuit. An integrated circuit holds a huge number of tiny electronic components, all made together on one small chip.

Check your understanding

Which sentence describes the role of the CPU?
Show the answer

Answer: B. It carries out the instructions of programs, processing the data that comes in so a result can go out.

The CPU processes instructions and data so that results can be output.

People often say “the CPU” when they mean the whole computer, or the tower under the desk. The CPU is only one small chip inside the computer, usually with a heat sink and a fan on top to keep it cool. A laptop, a tablet and a phone each have a CPU too, but none of them is a CPU.

Stage: Predict

Instructions and data in the same place

In the kitchen, the school changes its menu next term. The cards in the folder are replaced with new ones.

Think it through

When the menu changes, what needs to change in the kitchen: the cook, the cooker and the counter, or just the cards in the folder? What does that tell you about how a computer can run many different programs?

Show what happens

Only the cards change. The same cook and the same equipment can follow any menu, because what they do is set by the cards they are given. A computer works the same way: the CPU stays the same, and what it does is decided by the program it is given.

A program’s instructions, and the data they work on (numbers, text, pictures), are all stored as binary in one memory: the computer’s main working memory, called RAM (random access memory), which a later lesson explains. The CPU fetches the instructions from it, one at a time. To run a different program, a different set of instructions is put into RAM; the CPU itself does not change.

This design is called the Von Neumann architecture, after the mathematician John von Neumann, who described it in the 1940s. It is also known as the stored-program design. Every location in memory has an address, a number that says exactly which location it is, like the number on a recipe card.

Check your understanding

Which statement describes a computer with a Von Neumann architecture?
Show the answer

Answer: C. Instructions and the data they use share one memory, and the CPU fetches the instructions one at a time.

In a Von Neumann computer the program and its data share one memory.

Stage: Discover

Two jobs inside the CPU

A cook following cards does two different kinds of thing. Some cards need a calculation. Others are about organising what happens next.

Think it through

Sort these actions into two groups, and give each group a name: (1) adding the weights of two ingredients, (2) working out which card to take next, (3) checking whether the oven temperature is above 180 degrees, (4) telling the assistant to fetch an item from the cupboard.

Show what happens

Actions 1 and 3 are calculating and comparing: they use the calculator. Actions 2 and 4 are directing: they decide what happens, and when, and tell others to do it. The CPU has a separate part for each job.

The arithmetic logic unit (ALU) does the calculating. It does arithmetic (adding, subtracting and so on) and logic: comparing two values, and applying AND, OR and NOT, as in the logic gates lessons.

The control unit (CU) does the directing. It decodes each instruction, which means working out what it asks for, and sends control signals to the other parts so that the instruction is carried out in the right order. The control unit does not do the sums, and the ALU does not decide what happens next.

Together, the ALU and the CU are the two units of the CPU.

Which unit does each job? Type ALU or CU.
What is happeningUnit (ALU or CU)
Working out what an instruction asks for
Adding 7 and 5
Sending a signal that tells memory to read
Checking whether one value is greater than another
Applying NOT to a value

    Show the completed table
    What is happeningUnit (ALU or CU)
    Working out what an instruction asks forCU
    Adding 7 and 5ALU
    Sending a signal that tells memory to readCU
    Checking whether one value is greater than anotherALU
    Applying NOT to a valueALU

    Stage: Think

    Notes kept inside the CPU

    The cook keeps the number of the next card on a notepad at the counter, and does not walk to the cupboard to look it up each time.

    Think it through

    Why is a notepad at the counter a better place for “the number of the next card” than a note pinned inside the cupboard?

    Show what happens

    The notepad is right where the cook is, so it can be read instantly. A note in the cupboard would mean a trip every time. The CPU keeps what it needs at once in the same way.

    A register is a very small, very fast storage location inside the CPU, each with one particular job. Two of them are:

    • The program counter (PC) holds the address of the next instruction to be fetched. It is the notepad’s “number of the next card”. The CPU adds one to it after each fetch, so it points to the next instruction in the program.
    • The memory address register (MAR) holds the address of the memory location that the CPU is about to read from or write to. It is the number the cook is about to give to the assistant.

    Registers are not part of RAM. RAM is a separate memory, connected to the CPU by wires. Registers are inside the CPU itself, which is why they are so much faster, and why there are only a handful of them.

    Check your understanding

    Which statement about the program counter is correct?
    Show the answer

    Answer: A. It holds the address of the next instruction to be fetched.

    The program counter points to the next instruction by holding its address.

    Stage: Discover

    Where things wait inside the CPU

    When the assistant brings card 12 back from the cupboard, the cook puts it down on the counter to read it. The cook also keeps a running total on the notepad while adding several amounts together.

    Think it through

    So the cook needs a place for what the assistant brings back, a place for the card being followed right now, and a place for the running total. In a CPU, what would you expect those three to be used for?

    Show what happens

    One place for whatever has just arrived from memory (or is about to be sent to it), one for the instruction being followed, and one for the running total of calculations. These are the three registers below.

    • The memory data register (MDR) holds the data or instruction that has just been read from memory, or that is about to be written to it. Anything travelling between the CPU and memory waits here.
    • The current instruction register (CIR) holds the instruction that is being decoded and executed at the moment.
    • The accumulator (ACC) holds the data the ALU is working on, and the results of its calculations.
    Which register holds each of these? Type its short name: PC, MAR, MDR, CIR or ACC.
    What it holdsRegister
    The address of the next instruction to be fetched
    The result of the ALU’s latest calculation
    The instruction being decoded and executed
    The address of the location about to be read or written
    The data or instruction just read from memory

      Show the completed table
      What it holdsRegister
      The address of the next instruction to be fetchedPC
      The result of the ALU’s latest calculationACC
      The instruction being decoded and executedCIR
      The address of the location about to be read or writtenMAR
      The data or instruction just read from memoryMDR

      Check your understanding

      The ALU works out 7 + 5. In which register is the answer, 12, held straight afterwards?
      Show the answer

      Answer: D. The accumulator, because it holds the results of the ALU’s calculations.

      The ALU’s results are kept in the accumulator.

      Stage: Think

      Three roads between the CPU and memory

      When the cook asks the assistant for something from the cupboard, three things have to pass between them: where to look, what was found, and what to do with it.

      Think it through

      When the CPU asks memory for something, what three different kinds of information need to travel between the CPU and memory?

      Show what happens

      Where to look (an address), what is there (the data or instruction, coming back), and what to do (a command, such as read or write). A computer keeps these on three separate sets of wires.

      A bus is a set of wires that carries bits between parts of a computer. There are three of them between the CPU and memory:

      • The address bus carries the address of a memory location, from the CPU to memory. It carries addresses only, and in one direction.
      • The data bus carries data and instructions between the CPU and memory, in both directions.
      • The control bus carries control signals, such as “read” and “write”, from the control unit to memory and to the other parts of the computer.

      Do not confuse: Three buses, three kinds of message

      Where?Address bus
      Carries an address from the CPU to memory, in one direction.Location 520.
      What?Data bus
      Carries data and instructions, in both directions.The number 12, or an instruction.
      Do what?Control bus
      Carries control signals from the control unit.A “write” signal.

      Check your understanding

      The CPU is going to store the number 12 at memory location 520. What travels on the address bus and what on the data bus?
      Show the answer

      Answer: C. Address bus: the address 520. Data bus: the number 12.

      Address: where. Data: what. Control: do what.

      Stage: Apply

      Using what you know

      Apply it

      Sam says: “The MDR holds the address of the next instruction, because it is the register that deals with memory.” What is wrong with Sam’s reasoning?
      Show the answer

      Answer: B. The MDR holds the contents moving to or from memory; the address of the next instruction is in the PC.

      Sam has mixed up the registers that hold addresses (PC, MAR) with the one that holds contents (MDR).

      Apply it

      A school computer runs a spelling game in the morning and a maths quiz in the afternoon. In a Von Neumann computer, what is different inside the machine when the maths quiz is running?
      Show the answer

      Answer: A. The instructions and data held in RAM are different; the CPU and its parts are the same.

      The CPU is general: the program in memory decides what it does.

      Apply it

      The control unit has just sent a signal telling memory to read. Which part of the computer carried that signal?
      Show the answer

      Answer: D. The control bus

      Commands from the control unit travel on the control bus.

      Stage: Consolidate

      Show what you know

      Think it through

      In your own words, explain to a friend what the CPU does and why one computer can be a games machine at lunchtime and a spreadsheet at home time. Use the words instruction, memory and program.

      Show a model answer

      A good answer says that the CPU follows instructions one at a time, fetching them from memory and carrying them out. The instructions are stored in memory with the data, so loading a different program gives the same CPU different instructions to follow. For example: “The CPU fetches the instructions of whatever program is in memory and does what they say. At lunchtime the instructions are for a game; later a spreadsheet’s instructions are loaded, and the same CPU follows those instead.”

      Apply it

      A programmer looks inside a CPU and sees that the program counter holds 105. What does this tell her?
      Show the answer

      Answer: C. The next instruction to be fetched is stored at address 105.

      A value in the PC is an address, and it points to the next instruction.

      • The CPU carries out instructions, processing data that is input so that the result can be output. A microprocessor is a CPU built on a single chip.
      • In a Von Neumann architecture, a program’s instructions and its data are stored together in the same memory (RAM), and the CPU fetches the instructions one at a time.
      • The ALU does arithmetic and logic. The control unit decodes instructions and directs the other parts.
      • Registers are tiny, fast storage inside the CPU: the PC holds the address of the next instruction, the MAR the address in use, the MDR the data or instruction just read or about to be written, the CIR the instruction being carried out, and the ACC the ALU’s results.
      • The address bus carries addresses (one direction), the data bus carries data and instructions (both directions), and the control bus carries control signals.
      • The next lesson follows one instruction through all of these parts: the fetch-decode-execute cycle.

      Sources and scope

      • What this lesson is. The first lesson of the Computer Systems module, written for this site. It teaches the role of the CPU, the stored-program (Von Neumann) idea and the purpose of the CPU’s units, registers and buses, as set out in Cambridge IGCSE Computer Science (0478) section 3.1 (2026 to 2028, version 6) points 3.1.1 and 3.1.2(a). Its curriculum links are provisional and imply no endorsement by any examination board. It has not been approved by the site owner.
      • Original material. The school kitchen, its cook and assistant, and the calculator-app example are fictional and were written for this lesson.
      • Simplified on purpose. The kitchen is an analogy and has limits: a real CPU does not read cards but binary patterns, and it has many more registers than the five named here. The buses are described by what they carry for the IGCSE course; real computers add details such as the width of a bus and signals that travel back to the CPU. Real memory addresses are binary numbers. The fetch-decode-execute cycle, performance, and the other kinds of memory are left to later lessons.