The CPU & Microprocessors
The CPU & Microprocessors
What is the purpose of the CPU?
• The purpose of the Central Processing Unit (CPU) is
to fetch, decode and execute instructions
Examiner Tips and Tricks
To earn marks, don’t just say “the CPU processes data.” You need to use keywords
like fetch, decode, and execute—these match the language in the mark scheme.
• The CPU is the brain of the computer and its job is to take an input, process
data and produce an output
• It is central to all devices including:
o Laptops
o Desktops
o Games-Consoles
o Mobile Devices
• Data and commands are inputted by the user using an input device, the
central processing unit (CPU) processes data by executing
instructions and the results are outputted to an output device
• Below is an example of data being inputted, processed and the results being
outputted
Step Example
Input A keyboard is used to input a number
If the instruction being executed is ADD, the inputted value is added to an existing
Process
value
Output The result of the calculation is outputted to the user via the monitor
A diagram showing the input, process, output sequence followed by computer
systems
Microprocessors
• A microprocessor is a type of integrated circuit that is contained on a single
chip
• It contains the CPU and sometimes other components such as:
o Memory controllers
o I/O interfaces
• It is a hardware chip that houses the CPU
Examiner Tips and Tricks
Examiners sometimes test the difference between a CPU and a microprocessor. The
CPU is a component. The microprocessor is the chip that may include the CPU and
other parts like memory and I/O controllers.
Von Neumann Architecture
Von Neumann Architecture
What is the Von Neumann architecture?
Examiner Tips and Tricks
Cambridge IGCSE 0478 regularly tests your ability to describe the purpose of CPU
components and registers in the Von Neumann architecture. Every explanation on
this page is written in the format examiners expect—no waffle, no brand names, just
mark-ready definitions.
• The Von Neumann Architecture is a design of the CPU which was proposed by
Mathematician John Von Neumann in the 1940s, which most general-purpose
computers are built upon
• The Von Neumann Architecture outlines how the computer memory,
input/output devices and processor all work together
The Von-Neumann architecture
• The Von Neumann architecture consists of:
o Control unit (CU)
o Arithmetic logic unit (ALU)
o Registers
o Buses
What is the function of each component?
Arithmetic logic unit (ALU)
• Performs arithmetic operations
• Performs logical decisions
o IF X > 5 THEN
DO ……….
Control unit (CU)
• Coordinates how data moves around the CPU by sending a signal to control
the movement of the data
• Decodes the instructions fetched from memory
Registers
• Extremely small, extremely fast memory located in the CPU
• Hold small amounts of data needed as part of the fetch-execute cycle
• Each register has its own specific purpose
• It consists of 5 main registers
o The Program Counter (PC)
o The Memory Address Register (MAR)
o The Memory Data Register (MDR)
o The Accumulator (ACC)
o Current Instruction Register (CIR)
• For each of the registers you must know
o The name of the register
o Its acronym
o The purpose of the register
Examiner Tips and Tricks
When describing registers like the PC, MAR, or MDR, don’t just name what they
“store”, you must also explain why they store it and how it’s used in the fetch-
execute cycle. The how is where marks are gained or lost.
Name Acronym Purpose
• Holds the memory address of the next
instructions to be executed
Program Counter PC • Increments by 1 as the fetch-decode-execute cycle
runs
• Holds the memory address of where data or
Memory
MAR instructions are to be fetched from memory
Address Register
• Stores the data or instruction which has been
Memory Data
MDR fetched from memory
Register
• Stores the instruction the CPU is currently
Current Instruction
CIR decoding or executing
Register
• Stores the results of any calculations that have taken
Accumulator ACC place in the Arithmetic Logic Unit (ALU)
Examiner Tips and Tricks
To earn both marks for a register question, use this structure:
“[Register] holds [what], which is used to [why/how it's used].”
Example: “The MAR holds the memory address of data to be fetched, which is sent
via the address bus.”
Buses
• Components within the CPU and wider computer system are connected by
buses
• A bus is a set of parallel wires through which data/signals are
transmitted from one component to another
• There are 3 types of bus:
o Address - unidirectional, carries location data (addresses), data is
written to/read from
o Data - bidirectional, carries data or instructions
o Control - bidirectional, carries commands and control signals to tell
components when they should be receiving reads or writes etc..
Examiner Tips and Tricks
Students often confuse the data and address bus. Remember: the address
bus only carries memory locations (it’s unidirectional), while the data bus carries
actual data or instructions (it’s bidirectional).
Worked Example
Describe the role of the control unit, the control bus, the data bus and the address
bus when fetching an instruction from memory [4]
Answer
• The address of memory (holding instruction) is placed on the address
bus (1)
• The control unit sends a signal (1) on the control bus (to start a read
operation) (1)
• The instruction is/the contents of the memory are placed on the data
bus (1)
The Fetch-Decode-Execute
Cycle
Fetch-Decode-Execute Cycle (FDE)
What is the purpose of the CPU?
• The purpose of the Central Processing Unit (CPU) is
to fetch, decode and execute instructions
• The CPU is the brain of the computer and its job is to take an input, process
data and produce an output
What is the Fetch-Decode-Execute cycle?
• The Fetch-Decode-Execute Cycle is the cycle that the central processing
unit (CPU) runs through billions of times per second to make a computer work
• A computer takes an input, processes the input and then delivers an output
for the user
o Input: Clicking a button on the gamepad
o Process: The CPU inside the console follows a set of instructions to
carry out the task
o Output: The player moving on screen
The Fetch-Decode-Execute cycle stages
Fetch stage
• During the fetch stage of the cycle, the program counter holds the address
of the next instruction to be fetched from memory
• The address of the next instruction or data to be fetched is copied
into the memory address register (MAR)
• The address of the instruction or data is then sent along the address
bus and awaits a signal from the control bus
• The signal sent along the control bus is sent from the control unit (CU) to
the main memory
• The data or instructions received from main memory is fetched to the
memory data register (MDR) via the data bus
• A copy of the instruction or data is stored in the current instruction
register (CIR)
• The program counter (PC) increments by 1 so it is pointing to the next
instruction to be executed
Decode stage
• During the decode stage of the cycle, the CPU needs to work out what is
required from the instruction
• This is done as the instruction is split into two parts:
o Opcode - what the instruction is
o Operand - what to do it to
▪ This could be either data or an address where the data is stored
Execute stage
• During the execute stage of the cycle, the CPU will carry out the instruction
that was fetched
• Some examples that would take place at this stage are
o Performing a calculation
o Storing a result or data back in main memory (RAM)
o Going to main memory to fetch data from a different location
The important things to remember are:
• An instruction or data is fetched from memory
• The instruction is decoded
• The instruction is executed
• The cycle repeats billions of times per second
Examiner Tips and Tricks
Make sure you read the question carefully and look at the number of marks allocated
to judge the level of detail required. Often questions on the fetch-decode-execute
cycle only require you to describe the steps rather than explain how the registers and
buses are used during each step
Worked Example
Explain how an instruction is fetched using Von Neumann architecture
[6]
Answer
• The Program Counter (PC) holds the address/location of the next
instruction to be fetched [1]
• The address held in the PC is sent to the Memory Address Register
(MAR) [1]
• The memory address is sent using the address bus [1]
• The Program Counter is incremented [1]
• The instruction is sent from the address in memory to the Memory Data
Register (MDR) [1]
• The instruction is transferred using the data bus [1]
• The instruction is sent to the Current Instruction Register (CIR) [1]
Characteristics of the CPU
Characteristics of the CPU
What are the common characteristics of the CPU?
• There are 3 common characteristics
o Clock Speed
o Cache Size
o Number of Cores
• Each of these characteristics has a significant impact on the performance of
the CPU
How do the characteristics of the CPU affect performance?
Clock speed
• The clock speed is measured in Hertz (Hz)
• The clock speed measures the number of fetch-decode-execute cycles that
can take place in 1 second
• The faster the clock speed, the more instructions can be fetched and
executed per second
• Modern computers have a clock speed in Gigahertz (GHz), meaning billion
• A clock speed of 3.5GHz can perform up to 3.5 billion instructions per
second
Cache size
• Cache is very small, very fast memory on or close to the CPU
• Cache is used as temporary storage to provide quick access to a copy
of frequently used instructions and data
• The larger the cache size, the more frequently used instructions or data can
be stored
• This results in the CPU having to complete fewer fetch cycles from memory
(RAM), speeding up the performance
• Cache also has a significantly faster read/write speed than RAM, making it
much quicker to retrieve instructions from there instead of from memory
(RAM)
Number of cores
• A core works like it is its own CPU
• Multiple core processors mean they have multiple separate processing units
that can fetch, decode and execute instructions at the same time
• For example, a dual-core processor would have 2 processing units, each with
their own
o Control Unit (CU)
o Arithmetic Logic Unit (ALU)
o Accumulator (ACC)
o Registers
• Multi-core processors can run more powerful programs with greater ease
• Multiple cores increase the performance of the CPU by working with the clock
speed
o Example: A quad-core CPU (4 cores), running at a clock speed of
3Ghz
▪ 4 cores x 3GHz
▪ 4 x 3 billion instructions
▪ 12 billion instructions per second
Worked Example
One computer has a single core processor and the other has a dual core processor.
Explain why having a dual core processor might improve the performance of the
computer
[2]
Answer
Any 2 from:
• The computer with the dual core processor has two cores/double the
amount of cores [1]
• Parallel processing can take place [1]
• Each core can execute a separate instruction at the same time [1]
• Each core can process instructions independently of each other [1]
CPU Instruction Sets
CPU Instruction Sets
What is an Instruction set?
• An instruction set is a list of all the commands that can be processed by a
CPU
• Each command has a binary code which is called machine code
Opcode and operand
• In IGCSE Computer Science, the opcode and operand make up the binary code
o The opcode (operation code) is the operation to be performed
o The operand is the location where the operation is to be performed in
• The table below shows an example instruction set
• Each instruction has a mnemonic that indicates what the instruction
does alongside an example binary code
• After an instruction is decoded into an opcode and an operand, the CPU finds
the opcode in the processor’s instruction set
• It then knows what operation to perform when executing the instruction
Binary
Instruction Mnemonic Command
code
Adds a value to the value currently stored in the accumulator
Add ADD 10100001
(ACC)
Subtract SUB 00100010 Subtract a value from the values stored in the accumulator
Load the value stored in a memory location into the
Load LDA 10111111
accumulator
Store the value in the accumulator in a specific location in
Store STA 01100000
memory
Stop HLT 00000000 Stop the program
• Instruction lists are machine-specific
o A program created using one computer’s instruction set would not run on
a computer containing a processor made by a different manufacturer
o For example, a computer program created using Intel’s instruction set
would not run on a device containing an ARM processor
Worked Example
Using the instruction set in the table above what would be the operation if the
instruction was 00100010 00000010?
[1]
Answer
Either of:
• The operation would be SUB [1]
• If the operand was raw data the complete instruction would be to subtract
2 from the value in the accumulator [1]
Embedded Systems
Embedded Systems
What is an embedded system?
• An embedded system is a computer system which is used to perform a
dedicated function, inside a larger mechanical unit
• Examples of embedded systems include
o Heating thermostats
o Hospital equipment
o Washing machines
o Dishwashers
o Coffee machines
o Satellite navigation systems
o Factory equipment
o Security systems
o Traffic lights
What are the properties of an embedded system?
• They are small in size
• They use less power than a general-purpose computer
• They have a lower cost
Examiner Tips and Tricks
Always use key examples from the list above and don’t try to use different examples
such as a fridge or kettle as these will not appear on mark schemes because
although they have a single purpose, most fridges and kettles do not have a CPU.
Worked Example
1) Tick two boxes below to show which are an example of an embedded system
[2]
Is it an example of an embedded system
Laptop
Washing Machine
Mobile Phone
Car Engine Management System
2) Justify your choice to question 1
[2]
Answers
1) Tick two boxes below to show which are an example of an embedded
system. [2]
Is it an example of an embedded system
Laptop
Washing Machine ✓
Mobile Phone
Car Engine Management System ✓
2) Justify your choice to question 1 [2]
Any two of:
• A washing machine and car engine management system are not
general-purpose computers [1]
• A washing machine and car engine management system have a single
purpose and are both housed inside a larger mechanical unit [1]
• A washing machine and car engine management system have a
microprocessor [1]