Ch 1 · 3.1 Computer Architecture · IGCSE Computer Science 0478
Topic 1 of 4 in Hardware — IGCSE Computer Science 0478 — 69 lessons.
Introduction
The central processing unit (CPU) is the part of a computer that runs programs. It repeats one simple cycle billions of times a second: fetch an instruction, work out what it means, do it. This lesson takes the CPU apart. (Syllabus section 3.1.)
Key ideas — The CPU and the microprocessor
The CPU processes instructions and data that are input into the computer so that the result can be output. A microprocessor is a type of integrated circuit on a single chip that contains a CPU.
🧑🏫 Teacher's explanation
Think of the CPU as the 'brain' of the computer, but specifically a brain that follows a very strict recipe. Imagine a chef in a kitchen: the chef (CU) reads a recipe (Instruction), grabs ingredients from the pantry (RAM) using a tray (Data Bus), and follows the steps to cook the meal. The ingredients are moved to the cutting board (MDR) before being chopped (ALU).
📖 Definitions
🔍 Worked example — Easy
A CPU has a clock speed of 2.5 GHz. How many clock cycles occur in 1 second?
🔍 Worked example — Standard
Identify the correct sequence of registers involved in the Fetch stage of the FDE cycle for an instruction located at memory address 0xAF32.
🔍 Worked example — Exam-style
A computer has two cores. Core A is running a task. If the task requires 4 × 10^9 operations and each core can perform 1 × 10^9 operations per second, how long will it take if the workload is split perfectly between cores?
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
Key ideas — Von Neumann architecture
In the Von Neumann architecture, instructions and data are stored together in the same main memory (RAM) and fetched by the CPU one at a time.
🧑🏫 Teacher's explanation
Imagine a busy restaurant kitchen. The Chef is the CPU. The recipe book and the ingredients are both kept on the same counter (this is the Von Neumann architecture, where data and instructions share the same memory). The Chef doesn't just grab things randomly; they follow a specific sequence: look at the next step in the recipe, get the ingredients, and then cook them.
📖 Definitions
🔍 Worked example — Easy
Identify the component: A component that holds the address of the next instruction to be fetched from memory.
🔍 Worked example — Standard
Trace the Fetch-Decode-Execute cycle: During the 'Fetch' stage, the address of the next instruction is moved from the PC to which register?
🔍 Worked example — Exam-style
Calculate the performance impact: A CPU has a clock speed of 2.5 ext GHz and a cache size of 2 ext MB. A second CPU has a clock speed of 3.0 ext GHz and a cache size of 4 ext MB. Which CPU is likely to perform faster and why?
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
Key ideas — The fetch–decode–execute (FDE) cycle
The cycle then repeats.
🧑🏫 Teacher's explanation
Think of the CPU as a very fast, very efficient chef in a kitchen. The chef doesn't just 'know' what to cook; they follow a recipe book (the RAM). To cook, the chef first looks at the recipe number (PC), finds that page in the book (MAR/Address Bus), reads the instruction (MDR/Data Bus), and holds it in their mind (CIR). Once they understand the instruction (Decode), they actually perform the cooking—like chopping vegetables or boiling water (Execute/ALU).
📖 Definitions
🔍 Worked example — Easy
A CPU is executing a program. The current instruction is at memory address 100. Describe the state of the Program Counter (PC) after the Fetch stage of this instruction is completed.
🔍 Worked example — Standard
A CPU has a clock speed of 3.0 GHz. How many cycles does it perform in 2 seconds?
🔍 Worked example — Exam-style
A CPU uses a 32-bit address bus. Calculate the maximum number of unique memory addresses the CPU can access.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
Key ideas — What affects CPU performance
(Doubling the cores does not always double the speed: some tasks cannot be split, and the cores must share data.)
🧑🏫 Teacher's explanation
Imagine a professional kitchen. The CPU is the chef. The 'clock speed' is how fast the chef can move their hands; a faster chef completes more tasks per minute. The 'cores' are the number of chefs working in the kitchen; more chefs can cook more dishes at once, but only if the recipes allow them to work on different parts of the meal without bumping into each other. The 'cache' is like a small cutting board right in front of the chef; it holds the ingredients they use most often. If the chef has to walk all the way to the pantry (RAM) for every single onion, they will be much slower than a chef with a large cutting board full of pre-cut vegetables.
📖 Definitions
🔍 Worked example — Easy
A CPU has a clock speed of 2.5 GHz. How many FDE cycles can it perform in 1 second?
🔍 Worked example — Standard
A computer has two cores. If a single-threaded task (a task that cannot be split) is running, and the clock speed is 3.0 GHz, what is the theoretical maximum speed of the CPU for this specific task compared to a single-core CPU of the same clock speed?
🔍 Worked example — Exam-style
An embedded system is used in a microwave. Compare the CPU requirements of this embedded system to a standard laptop.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
Key ideas — Instruction set
An instruction set is the list of all the commands that a CPU can process. The commands are machine code (binary). Different types of CPU have different instruction sets, so machine code written for one may not run on another.
🧑🏫 Teacher's explanation
Imagine you are a chef in a kitchen. The chef is the CPU. The chef doesn't just 'know' how to cook everything in the world; they follow a specific 'recipe book' that contains a limited list of commands like 'chop', 'boil', 'fry', or 'bake'. This recipe book is the instruction set. If you give a chef a recipe written in French, but their instruction set only understands English, they won't be able to cook the meal.
📖 Definitions
🔍 Worked example — Easy
A CPU has an instruction set where the first 4 bits represent the opcode (the command) and the remaining 4 bits represent the operand (the data/address). If the binary instruction is 0010\ 0101_2, identify the opcode and the operand.
🔍 Worked example — Standard
A CPU instruction set uses 8-bit machine code. A specific command is represented by 10110001_2. If the CPU is replaced with a different model that uses a different instruction set, can the original machine code be executed directly?
🔍 Worked example — Exam-style
A programmer wants to write a program for a specific microprocessor. The instruction set includes a 'LOAD' command represented by 0001_2. If the programmer writes the code using 0010_2 instead, what is the result?
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
(a) Define the term 'instruction set'. [1] (b) Explain why a program written for one type of CPU might not run on a different type of CPU. [2] [3 marks]
Key ideas — Embedded systems
An embedded system is a computer system built into a larger device to perform a dedicated function (one specific task).
🧑🏫 Teacher's explanation
Imagine you have a Swiss Army knife versus a specialized kitchen peeler. A Swiss Army knife is a general-purpose tool; it has a blade, scissors, and a screwdriver, allowing you to perform many different tasks. However, it might not be the best tool for peeling a potato. A vegetable peeler is an 'embedded system'. It is designed to do exactly one thing—peel—but it does it very efficiently, reliably, and it is built directly into the kitchen workflow.
📖 Definitions
🔍 Worked example — Easy
Identify whether the following is an embedded system or a general-purpose computer: A laptop used for programming, gaming, and watching videos.
🔍 Worked example — Standard
A microwave uses a small chip to control the timer and heat levels. List two characteristics of this system that distinguish it from a desktop PC.
🔍 Worked example — Exam-style
A smart thermostat is an embedded system. Explain why it is considered 'embedded' rather than 'general-purpose'.
⚠️ Common errors
🧠 Quick check 1
🧠 Quick check 2
🎯 Exam question
(a) Define the term 'embedded system'. [2] (b) State two characteristics of an embedded system. [2] [4 marks]
Worked example
The address of the instruction (from the PC) is placed in the MAR and sent along the address bus to memory. The instruction stored at that address is sent back along the data bus and placed in the MDR, from where it is copied to the CIR.
🔍 Worked example — Easy
A CPU is performing a fetch cycle. The Program Counter (PC) currently holds the value 0x004. Describe the sequence of events involving the MAR and MDR during the fetch stage.
🔍 Worked example — Standard
A CPU has a 16-bit address bus and an 8-bit data bus. If the CPU needs to fetch an instruction from memory address 1010, explain the role of the buses and registers.
🔍 Worked example — Exam-style
Compare a general-purpose computer and an embedded system in terms of their function and hardware complexity.
⚠️ Common errors
Common mistakes
Practice
Answers: (1) ALU: carries out arithmetic and logical operations; CU: controls the CPU's operation and decodes instructions. (2) The accumulator (ACC). (3) PC address → MAR → address bus to RAM; instruction → data bus → MDR → CIR; PC incremented. (4) A larger cache can hold more frequently used data and instructions, so the CPU needs to access slower RAM less often, so it processes faster. (5) The list of all the commands (machine code) a CPU can process. (6) Dedicated function, small, low power, low cost; e.g. a washing machine, a car's engine management system.