Paper 1 · Chapter 3 of 6

Hardware

The physical machine: the CPU and Von Neumann architecture, the fetch-decode-execute cycle, what makes a processor fast, embedded systems, input and output devices, sensors, storage types, virtual memory and the cloud. Topic 3 of the 0478 / 2210 syllabus in full.

IGCSE / O-Level 0478 · 2210 Paper 1 · Computer Systems

Hardware is the physical part of a computer, the parts you can touch. At the centre of it all is the CPU, which processes every instruction. This chapter takes you inside the processor, then out to the devices that feed it data and the storage that keeps that data safe.

01

CPU and Von Neumann Architecture

The CPU (Central Processing Unit) processes all the instructions and data in a computer so that a result can be produced. A microprocessor is simply a CPU built onto a single integrated circuit chip.

Most computers follow the Von Neumann architecture. Its key idea is that both program instructions and the data they work on are stored together in the same memory. This is why a single computer can run any program: the program is just data loaded into memory.

The two units inside the CPU

ComponentShortRole
Arithmetic Logic UnitALUPerforms arithmetic (add, subtract, multiply, divide) and logical (AND, OR, NOT) operations
Control UnitCUDirects all operations: it fetches, decodes and coordinates the execution of instructions

02

Registers and Buses

A register is a very small, very fast store inside the CPU that holds one piece of data at a time. You must know the role of each of these five.

RegisterShortWhat it holds
Program CounterPCThe memory address of the next instruction to be fetched
Memory Address RegisterMARThe address currently being read from or written to
Memory Data RegisterMDRThe data or instruction just fetched from, or about to be written to, memory
Current Instruction RegisterCIRThe instruction currently being decoded and executed
AccumulatorACCThe result of the most recent ALU calculation

Buses

A bus is a set of parallel wires that carries data between components. There are three.

BusDirectionWhat it carries
Address busOne-way (CPU to memory)Memory addresses
Data busTwo-wayData and instructions
Control busTwo-wayControl signals such as read, write and clock
Why is the address bus one-way?
The CPU sends addresses to memory to say which location it wants, but memory never needs to send an address back to the CPU. Data, however, flows both to and from memory, so the data bus is two-way.

03

The Fetch-Decode-Execute Cycle

This is the cycle the CPU repeats for every single instruction, billions of times a second. It has three stages, and you need to know the role of each register at each stage.

Watch it The FDE cycle, register by register
Fetch Decode Execute
Follow the highlighted data as it moves between RAM and the registers at each stage.

Fetch

  • The address in the PC is copied to the MAR along the address bus
  • The instruction at that address is fetched from RAM into the MDR along the data bus
  • The PC is incremented so it points to the next instruction

Decode

  • The instruction is copied from the MDR to the CIR
  • The Control Unit decodes it, working out which operation and operand are needed

Execute

  • The Control Unit sends signals to carry out the instruction
  • If a calculation is needed, the ALU performs it and the result is stored in the ACC
Examiner favourites
Be precise about each register. The MAR always holds an address, the MDR always holds data. The PC is incremented during Fetch, not during Execute. Mixing these up is the most common way to lose marks here.

04

What Affects CPU Performance

Three factors change how fast a CPU works. Exam questions often ask you to explain the effect of changing one.

FactorEffect on performance
Clock speedA higher clock speed means more FDE cycles per second, so faster processing. Measured in gigahertz (GHz)
Number of coresEach core can process instructions independently. More cores means more instructions handled at the same time. A quad-core can handle four streams at once
Cache sizeCache is very fast memory inside the CPU. A larger cache stores more frequently used data close by, reducing slow trips to RAM
Cache levels
Cache is faster than RAM because it sits inside or very close to the CPU. There are levels: L1 is the fastest and smallest, then L2, then L3, which is the slowest cache but still much faster than RAM.

05

Instruction Sets

An instruction set is the complete list of machine-code commands that a particular CPU can carry out. Every CPU has its own instruction set, which is why a program must be compiled for the specific type of processor it will run on. A program built for one instruction set will not run on a CPU with a different one.


06

Embedded Systems

An embedded system is a dedicated computer built into a larger device to perform one specific task. It uses a microprocessor running a fixed program stored in ROM.

Embedded systemGeneral purpose computer
Performs one dedicated functionPerforms many different functions
Program stored in ROM, cannot be changed by the userPrograms loaded from storage, can be changed
Examples: washing machine, microwave, car ABS, pacemaker, traffic lightsExamples: laptop, desktop PC, smartphone
Low power, reliable and fast for its taskHigher power, flexible and upgradeable

07

Input and Output Devices

An input device converts real-world data into a digital form the computer can process. An output device converts digital data back into a form humans can use. The exam expects you to describe not just what each device is, but how it works, so each one is explained below.

How input devices work

Keyboard Input

When a key is pressed it completes a circuit on a circuit board underneath the keys. The keyboard has a chip that detects which circuit was completed and looks up the matching character code in a character map. That code is sent to the computer, which converts it to the correct character.

Optical mouse Input

An LED shines light onto the surface beneath the mouse. A tiny camera takes thousands of photos of the surface every second. A processor compares each photo with the previous one to work out the direction and distance the mouse has moved, and sends those movement values to the computer.

Microphone Input

Sound waves cause a thin diaphragm inside the microphone to vibrate. These vibrations are converted into a varying electrical (analogue) signal. An analogue-to-digital converter then samples this signal and turns it into the binary numbers the computer stores.

Digital camera Input

Light enters through the lens and falls on an image sensor made of millions of tiny light-sensitive cells. Each cell measures the amount of light hitting it and converts it into an electrical signal, which is turned into binary. Together these values form the pixels of the digital image.

2D scanner Input

A bright light shines onto the document as a scan head moves slowly across it. The light reflected off the document is captured by sensors and converted into electrical signals. These are turned into binary to build up a digital image of the page. Optical character recognition (OCR) software can then convert a scanned image of text into editable text.

3D scanner Input

A 3D scanner measures the shape of a solid object, often using lasers or infra-red to record the distance to many points on its surface. These measurements build up a digital 3D model of the object, which can then be edited or sent to a 3D printer.

Barcode scanner Input

A barcode is a pattern of light and dark vertical lines of varying width. The scanner shines a light (often a laser) across the barcode. Dark lines reflect little light and light gaps reflect a lot. A sensor detects this pattern of reflection and converts it into a number that identifies the product.

QR code scanner Input

A QR code is a 2D pattern of black and white squares that can store much more data than a barcode. A camera captures an image of the code, and software reads the pattern of squares, decoding it into the data it represents, such as a web address.

Touch screen Input

A touch screen is both an input and output device. There are three types in the syllabus. Resistive screens have two flexible layers that touch when pressed, completing a circuit at that point. Capacitive screens have a coating that holds a small electrical charge, and a finger touching the screen changes the charge at that point. Infra-red screens have a grid of infra-red beams across the surface, and a touch breaks the beams at the touched point. In each case the position of the touch is calculated and sent to the computer.

How output devices work

LCD screen Output

An LCD (liquid crystal display) is made of a grid of liquid crystal pixels in front of a backlight. An electric current passing through each crystal twists it to control how much light passes through, and colour filters give each pixel its colour. Older LCD screens use a fluorescent backlight.

LED screen Output

An LED screen is an LCD screen that uses light-emitting diodes (LEDs) as the backlight instead of a fluorescent lamp. LEDs are brighter, more energy efficient, and allow a thinner screen, which is why most modern displays are LED-backlit.

Inkjet printer Output

An inkjet printer sprays tiny droplets of liquid ink onto the paper through nozzles in a print head that moves across the page. The paper feeds through a small amount at a time. It builds the image up line by line from thousands of tiny dots. Inkjets are cheap and good for photos but slower and use up ink quickly.

Laser printer Output

A laser printer uses a laser beam to draw the image as a pattern of electrical charge on a rotating drum. Powdered ink called toner sticks to the charged areas of the drum. The toner is then transferred onto the paper and fused on permanently using heat. Laser printers are fast and well suited to high-volume printing.

3D printer Output

A 3D printer builds a solid object one thin layer at a time, working from a digital 3D model. The most common type melts plastic filament and lays it down layer by layer, with each layer setting before the next is added, gradually building up the finished object. This is known as additive manufacturing.

LCD and DLP projectors Output

A projector enlarges an image onto a large screen or wall. An LCD projector shines a strong light through a small liquid crystal display, projecting the image through a lens. A DLP (digital light processing) projector reflects light off millions of tiny mirrors on a chip, each mirror tilting to control the light for one pixel.

Speaker Output

The computer sends a digital sound signal to a digital-to-analogue converter, which turns it into a varying electrical signal. This signal passes through a coil in the speaker, creating a changing magnetic field that makes a cone vibrate. The vibrating cone moves the air, producing sound waves we can hear.

Actuator Output

An actuator converts an electrical signal from the computer into physical movement. Common actuators are motors (rotation), valves (controlling flow), and solenoids (pushing or pulling). Actuators are how a computer affects the physical world, and they are essential in the automated systems covered in Chapter 6.


08

Sensors

A sensor is an input device that measures a physical property and converts it into an electrical signal, which is then turned into digital data for the computer. Sensors are the eyes and ears of automated systems.

SensorMeasuresExample use
TemperatureHeat levelGreenhouse climate control, server rooms
HumidityMoisture in the airWeather stations, data centres
MoistureWater content in soilAutomated irrigation systems
LightLight intensityAutomatic street lighting, camera exposure
Infra-redHeat radiation or presenceMotion detectors, burglar alarms
PressureForce per unit areaIndustrial machinery, weather forecasting
ProximityDistance to a nearby objectAutomatic doors, parking sensors
AcousticSound levelNoise pollution monitoring
AccelerometerChange of velocity or orientationPhone screen rotation, fitness trackers
Gas / pHGas concentration or acidityCO detectors, swimming pools, agriculture
In the exam
You may be asked to choose the most suitable sensor for a given context. Read the scenario carefully: a greenhouse that must not get too hot needs a temperature sensor, while one that must not dry out needs a moisture sensor.

09

Primary and Secondary Storage

Primary storage

Directly accessed by the CPU. Fast but limited in size. Includes RAM and ROM.

Secondary storage

Not directly accessed by the CPU. Larger and non-volatile, used for long-term storage. Slower than RAM.

RAM and ROM

RAMROM
Volatile?Yes, loses contents when power is offNo, keeps contents without power
Read / writeRead and writeRead only
HoldsPrograms and data currently in useFirmware and the bootloader
Volatile means
Volatile storage loses its contents the moment power is removed. RAM is volatile, which is why unsaved work is lost in a power cut. ROM is non-volatile, which is why a computer can find its start-up instructions every time it powers on.

10

Storage Technologies

Secondary storage comes in three technologies. You must be able to describe how each one works, not just name an example. The table gives a one-line summary, then each is explained in full below.

TypeStores data usingExamples
MagneticMagnetised regions on spinning plattersHard disk drive (HDD), magnetic tape
OpticalPits and lands read by a laserCD, DVD, Blu-ray
Solid-stateElectrical charge trapped in flash memory cellsSSD, USB flash drive, SD card

How magnetic storage works

A magnetic hard disk drive contains one or more circular metal platters coated with a magnetic material. The surface of each platter is divided into concentric circles called tracks, and each track is divided into sectors, which is how the drive knows where each piece of data is located.

The platters spin at high speed, thousands of times per minute. A read/write head on a moving arm floats just above the surface. To write data, the head acts as an electromagnet: it magnetises a tiny region of the surface in one direction to represent a 1 or the opposite direction to represent a 0. To read data, the head detects the direction of magnetism of each region as it passes underneath and converts it back into 1s and 0s.

Because the platters spin and the head physically moves to the right track, magnetic drives have moving parts. This makes them cheaper per gigabyte and good for large capacities, but slower and more easily damaged by knocks than solid-state drives.

How optical storage works

Optical discs such as CDs, DVDs and Blu-rays store data on a spiral track running outward from the centre. Along this track the surface is burned into a pattern of pits (small dips) and lands (the flat areas between them).

To read the disc, a laser is shone onto the spinning surface. A land reflects the laser light strongly back to a sensor, while a pit scatters the light so less is reflected. The drive detects this change in reflection and converts the pattern into the binary 1s and 0s of the stored data. Writable discs work by using a stronger laser to burn the pits into a dye layer.

Blu-ray discs hold the most data because they use a blue laser with a shorter wavelength than the red laser used for DVDs and CDs, allowing the pits to be packed more closely together.

How solid-state storage works

Solid-state storage such as an SSD or USB flash drive uses flash memory and has no moving parts. Data is stored using special transistors arranged as control gates and floating gates. A floating gate can trap an electrical charge and hold it even when the power is switched off, which is what makes the storage non-volatile.

Whether a cell is holding a trapped charge or not represents a 1 or a 0. Because data is accessed electronically with no spinning disc or moving head, solid-state storage is much faster to read and write, uses less power, and is far more durable when knocked or dropped.

Summary: which and why
Magnetic drives give the most storage for the lowest cost but are slow and have moving parts. Optical discs are cheap and easily posted or distributed but hold the least and are easily scratched. Solid-state is the fastest and most durable but costs more per gigabyte.

11

Virtual Memory

Virtual memory is a section of secondary storage (the HDD or SSD) used as an extension of RAM when the physical RAM becomes full. Pages of data are swapped between RAM and virtual memory as needed.

  1. RAM becomes full, with no space for a new program or process
  2. The operating system identifies pages of data in RAM that have not been used recently
  3. Those pages are swapped out to the virtual memory space on the disk
  4. The new data is loaded into the freed RAM space
  5. If the swapped-out pages are needed again, they are swapped back into RAM
Thrashing
Virtual memory is much slower than RAM because disk access is far slower than memory access. If the computer spends too much time swapping pages back and forth, performance drops noticeably. This excessive swapping is called thrashing.

12

Cloud Storage

Cloud storage keeps data on remote servers accessed over the internet, rather than on local hardware. The data physically lives on servers in data centres run by a provider.

Cloud storageLocal storage
AccessFrom any device, anywhere with internetOnly from the device it is connected to
CapacityScalable, pay for more when neededFixed, must buy new hardware to expand
CostOngoing subscription or pay per useOne-time hardware cost
Security riskData held by a third party, risk of breachesDevice can be lost, damaged or stolen
DependenceNeeds a reliable internet connectionWorks offline
MaintenanceProvider handles hardware maintenanceUser responsible for backups and repairs

13

Exam Practice

3 marks
Q1. State the role of the program counter (PC), the memory address register (MAR) and the accumulator (ACC).
Answer

The PC holds the address of the next instruction to be fetched. The MAR holds the address currently being read from or written to. The ACC holds the result of the most recent calculation performed by the ALU.

4 marks
Q2. Describe what happens during the fetch stage of the fetch-decode-execute cycle.
Answer

The address held in the program counter is copied to the MAR along the address bus. The instruction at that address is fetched from RAM into the MDR along the data bus. The program counter is then incremented so it points to the next instruction.

4 marks
Q3. Explain how increasing the number of cores and the cache size can improve CPU performance.
Answer

More cores allow more instructions to be processed at the same time, since each core can handle its own stream of instructions independently. A larger cache stores more frequently used data and instructions close to the CPU, reducing the number of slower accesses to RAM, so the CPU spends less time waiting for data.

4 marks
Q4. Compare an embedded system with a general purpose computer.
Answer

An embedded system performs one dedicated function and runs a fixed program stored in ROM that the user cannot change, for example a washing machine. A general purpose computer performs many different functions and runs programs loaded from storage that can be changed or added to, for example a laptop.

4 marks
Q5. Describe how virtual memory is used when RAM becomes full.
Answer

When RAM is full, the operating system identifies pages of data in RAM that have not been used recently and swaps them out to a reserved area of secondary storage called virtual memory. The freed space in RAM is then used for the new data. If the swapped-out pages are needed again, they are swapped back into RAM.

3 marks
Q6. Describe how a solid-state drive stores data, and give one advantage over a magnetic hard disk.
Answer

A solid-state drive uses NAND or NOR flash memory, where transistors act as control gates and floating gates to hold data, with no moving parts. One advantage over a magnetic hard disk is that it is faster to access data, or alternatively that it is more durable because it has no moving parts to be damaged.

Scroll to Top