Syllabus coverage
- Understand the role of the central processing unit (CPU) in a computer and what is meant by a microprocessor
- Understand the purpose of the components in a CPU in a computer that has a Von Neumann architecture, including the ALU, the control unit, the PC, MAR, MDR, CIR and ACC registers, and the address, data and control buses
- Describe the process of the fetch-decode-execute (FDE) cycle, including the role of each component in the process
- Understand what is meant by a core, cache and clock in a CPU and explain how they can affect the performance of a CPU
- Understand the purpose and use of an instruction set for a CPU
- Describe the purpose and characteristics of an embedded system and identify devices in which they are commonly used
- Understand what is meant by an input device and why it is required, and what is meant by an output device and why it is required
- Understand what is meant by a sensor and the purposes of sensors, identify the type of data captured by each sensor and understand when each sensor would be used, including selecting the most suitable sensor for a given context
- Understand what is meant by primary storage, including the role of RAM and ROM and why a computer needs both
- Understand what is meant by secondary storage and describe the operation of magnetic, optical and solid-state (flash memory) storage, giving examples of each
- Describe what is meant by virtual memory, how it is created and used and why it is necessary
- Understand what is meant by cloud storage and explain the advantages and disadvantages of storing data on the cloud in comparison to storing it locally
- Understand that a computer needs a network interface card (NIC) to access a network
- Understand what is meant by, and the purpose of, a media access control (MAC) address, including its structure
- Understand what is meant by, and the purpose of, an internet protocol (IP) address and that there are different types of IP address, including the characteristics of, and differences between, IPv4 and IPv6
Part of the IGCSE Computer Science syllabus 0478.
The CPU, microprocessors and embedded systems
The central processing unit (CPU) is the part of a computer that processes the instructions and the data that are input into the computer so that the result can be output. It carries out every instruction in a program, one after another, and it is often called the brain of the computer. A microprocessor is a type of integrated circuit on a single chip, which is what makes it possible to build a complete CPU into a phone, a washing machine or a car.
A general purpose computer, such as a personal computer or a laptop, can run many different programs and be used for many different tasks. An embedded system is a computer built into a larger device to perform a dedicated function: one job, carried out over and over. Embedded systems are found in domestic appliances such as washing machines and microwaves, in cars (engine management and braking systems), in security systems, in lighting systems and in vending machines.
Embedded systems usually have limited processing power and memory, because they only have one job to do, and they often have no keyboard or screen, or only a very simple one. The program that runs the system is normally held in ROM so that it is still there when the power is switched off, and the system is expected to keep working reliably for years without being updated.
| General purpose computer | Embedded system | |
|---|---|---|
| Function | Can perform many different functions | Performs one dedicated function |
| Examples | Personal computer (PC), laptop | Washing machine, car braking system, security system, lighting system, vending machine |
| Hardware | Large amounts of memory and processing power, with a keyboard and a screen | Limited memory and processing power, often with no user interface |
| Where the program is kept | Loaded from secondary storage into RAM when it is needed | Usually held in ROM so that it is not lost when the power is switched off |
Von Neumann architecture: units, registers and buses
In a computer with a Von Neumann architecture, the instructions and the data are both held in the same memory (RAM) and are fetched and processed one at a time by the CPU. The CPU itself is made up of units, registers and buses.
The arithmetic logic unit (ALU) carries out the arithmetic operations, such as adding and subtracting, and the logical operations, such as comparing two values. The control unit (CU) controls the flow of data and the execution of instructions: it decodes each instruction and sends the control signals that tell the other components what to do.
The registers are tiny, very fast storage locations inside the CPU. The program counter (PC) holds the address of the next instruction to be fetched. The memory address register (MAR) holds the address of the memory location that is currently being read from or written to. The memory data register (MDR) holds the data or instruction that has just been fetched from memory, or that is about to be written to memory. The current instruction register (CIR) holds the instruction that is currently being decoded and executed. The accumulator (ACC) holds the result of the calculations carried out by the ALU.
The buses are the sets of wires that carry data, addresses and signals between the components. The address bus carries the address of a memory location from the CPU to memory, and it works in one direction only. The data bus carries the data and the instructions between the CPU and memory, in both directions. The control bus carries the control signals from the control unit to the other components, such as the signal to read from or to write to memory.
| Component | Type | Purpose |
|---|---|---|
| Arithmetic logic unit (ALU) | Unit | Carries out arithmetic operations and logical operations |
| Control unit (CU) | Unit | Decodes instructions and controls the flow of data by sending control signals |
| Program counter (PC) | Register | Holds the address of the next instruction to be fetched |
| Memory address register (MAR) | Register | Holds the address of the memory location that is currently being read from or written to |
| Memory data register (MDR) | Register | Holds the data or instruction just fetched from memory, or about to be written to memory |
| Current instruction register (CIR) | Register | Holds the instruction that is currently being decoded and executed |
| Accumulator (ACC) | Register | Holds the result of the calculations carried out by the ALU |
| Address bus | Bus | Carries memory addresses from the CPU to memory, in one direction |
| Data bus | Bus | Carries data and instructions between the CPU and memory, in both directions |
| Control bus | Bus | Carries control signals from the control unit to the other components |
The fetch-decode-execute cycle
The CPU works through a program by repeating the fetch-decode-execute (FDE) cycle. Every instruction goes through all three stages before the next instruction starts.
Fetch. The PC holds the address of the next instruction, and that address is copied into the MAR. The instruction stored at that address in RAM is fetched and placed in the MDR. The instruction is then copied from the MDR into the CIR, and the PC is incremented so that it now holds the address of the following instruction, ready for the next cycle.
Decode. The control unit decodes the instruction held in the CIR. The instruction is split into the operation that has to be carried out and the data or address it applies to, so the CU works out what has to happen and which components will be needed.
Execute. The instruction is carried out. The ALU may perform a calculation and store the result in the accumulator, data may be read from or written to memory, or the program may jump to a different instruction by loading a new address into the PC. When the instruction has been executed, the cycle begins again.
- Fetch: the address in the PC is copied to the MAR, the instruction is fetched from RAM into the MDR, it is copied into the CIR, and the PC is incremented.
- Decode: the control unit works out what the instruction in the CIR means and which components are needed to carry it out.
- Execute: the instruction is carried out, for example a calculation in the ALU with the result stored in the accumulator.
- The cycle then repeats for the next instruction, using the address now held in the PC.
Cores, cache, clock speed and the instruction set
Three things about the CPU itself affect how quickly it performs. The clock inside the CPU produces regular pulses that drive the FDE cycle, and the clock speed, measured in gigahertz (GHz), is the number of cycles the CPU can carry out each second. A higher clock speed means more instructions are processed every second, so the performance is better.
Cache is a small amount of very fast memory built into the CPU that stores the instructions and data that are used most often. When the CPU needs something, it looks in the cache first. A larger cache means more of what is needed is already close to hand, so there are fewer fetches from the much slower RAM, and the performance improves.
A core is a complete processing unit inside the CPU, so a multi-core processor can carry out several instructions at the same time. More cores mean more instructions can be processed simultaneously, which improves performance, provided the software has been written to make use of more than one core.
An instruction set is the list of all the commands that can be processed by a CPU. Each command in the set is written in machine code for that particular processor. Different processors have different instruction sets, which is why a program compiled for one type of CPU will not run on another type without being recompiled.
Input devices, output devices and sensors
An input device is hardware that is used to enter data or instructions into a computer system. Without an input device the computer would have nothing to process, because the program and the data both have to get into the system somehow. An output device is hardware that presents the result of the processing, whether as an image on a screen, as printed text, as sound or as a physical movement.
The input devices you need to know include the barcode scanner, which reads the bars and spaces using reflected light and converts them into a code that is looked up in a database, and the QR code scanner, which reads a two-dimensional code that can hold far more data than a barcode, such as a web address. A digital camera captures an image on a sensor and converts it into a digital file, a keyboard enters text and numbers, and a microphone converts sound waves into a signal that the computer samples and stores as binary. An optical mouse uses a light and a sensor to detect movement by comparing successive images of the surface underneath it. A 2D scanner scans a flat document and produces a digital image, while a 3D scanner scans an object and produces a digital 3D model that can then be printed.
Touch screens work in three different ways. A resistive touch screen has two conductive layers that touch when the screen is pressed, so it responds to a finger, a stylus or a gloved hand, but it is less sensitive and usually detects only one touch at a time. A capacitive touch screen detects the change in capacitance caused by a finger touching it; it is more sensitive and supports multi-touch, but it needs a bare finger and will not respond to a glove or a plastic stylus. An infra-red touch screen has a grid of infra-red beams across it, and a touch breaks the beams so that the position can be worked out; it works with any object.
The output devices you need to know include the inkjet printer, which sprays tiny droplets of ink onto the paper and is cheap to buy and good for colour photographs, but slow with expensive ink; the laser printer, which uses a laser to build up an image on a drum before toner is transferred to the paper and fused with heat, and is fast with a low cost per page in large volumes; and the 3D printer, which builds up a solid object layer by layer from a digital model and is used for prototyping. An LED screen uses light emitting diodes for each pixel, so it is bright and energy efficient, while an LCD screen uses pixels of liquid crystal that block or let through the light from a backlight, so it is thin, light and low power. A DLP projector uses a chip of thousands of tiny mirrors to switch light on and off, giving a smooth image with no visible pixel grid, and an LCD projector shines light through liquid crystal panels and a lens. A speaker converts an electrical signal into sound waves, and an actuator converts a signal from the computer into a physical movement, such as a motor turning a valve or a robotic arm moving.
A sensor is a device that automatically captures a physical quantity from its surroundings and converts it into a digital signal that a computer can process. Sensors are used so that a system can monitor its environment and react without a person having to take readings and type them in. Each sensor measures one thing, and the computer compares the value it receives with a set range and takes action, for example switching on a fan, opening a valve or sounding an alarm.
| Sensor | Type of data captured | When it would be used |
|---|---|---|
| Acoustic | Sound level | Monitoring noise levels in a street or detecting the sound of breaking glass in a security system |
| Accelerometer | Acceleration, movement and orientation | Detecting the tilt of a phone screen or counting steps |
| Flow | The rate at which a liquid or gas is flowing | Monitoring the flow of water in a pipe or gas in a supply line |
| Gas | The presence and concentration of a gas | Detecting a gas leak in a kitchen or monitoring air quality |
| Humidity | The amount of water vapour in the air | Controlling the conditions in a greenhouse or a museum |
| Infra-red | Infra-red radiation, which indicates heat or movement | Detecting movement in a burglar alarm or opening an automatic door |
| Level | The height of a liquid or solid in a container | Measuring the amount of water in a tank or the level in a silo |
| Light | Light intensity | Switching street lights on when it gets dark |
| Magnetic field | The strength and direction of a magnetic field | Detecting whether a door is closed or reading a compass |
| Moisture | The water content of soil or another material | Deciding when to water crops in an irrigation system |
| pH | The acidity or alkalinity of a substance | Monitoring the water in a swimming pool or the soil in a field |
| Pressure | The force per unit area of a gas or liquid | Checking the pressure in a car tyre or a boiler |
| Proximity | How close an object is | Warning a driver that the car is close to an obstacle in a car park |
| Temperature | How hot or cold something is | Controlling the temperature of an oven or switching on a fan in a greenhouse |
Primary storage, secondary storage and virtual memory
Primary storage is storage that is directly accessed by the CPU. It holds the instructions and the data that are being used at that moment. RAM (random access memory) is volatile: it can be read from and written to, it holds the programs and data currently in use, and its contents are lost when the power is turned off. A computer with more RAM can keep more programs and more data open at once without slowing down.
ROM (read only memory) is non-volatile: its contents are not lost when the power is turned off, and it can be read but not changed. It holds the start-up instructions, often called firmware, that the computer needs in order to boot up and check its hardware before the operating system can be loaded from secondary storage. A computer needs both: ROM holds the instructions that must be there every time the computer is switched on and must never be lost, while RAM is the fast, changeable workspace the CPU uses while the computer is running.
Secondary storage is not directly accessed by the CPU, and it is needed for more permanent storage of data. It keeps files, programs and documents when the computer is switched off, and it holds far more data than RAM for a much lower cost, although it is slower to access. There are three types you must know.
Magnetic storage uses platters that are divided into tracks and sectors, and data is read and written using electromagnets that magnetise small areas of the surface. A hard disk drive (HDD) is the main example. Magnetic storage gives a very large capacity at a low cost per gigabyte, but it has moving parts, so it is slower than solid-state storage and can be damaged if the drive is knocked while it is working.
Optical storage uses lasers to create and read pits and lands on the surface of the disc: the laser is reflected differently from a pit and from a land, and that difference is read as 1s and 0s. CD, DVD and Blu-ray discs are the examples. Optical media are cheap and portable and are good for distributing files, but they hold less than a hard disk drive, they are slower, and the surface can be scratched.
Solid-state (flash memory) storage uses NAND or NOR technology, in which transistors act as control gates and floating gates to trap charge and so store bits. A solid-state drive (SSD), an SD card and a USB drive all work in this way. Because there are no moving parts, solid-state storage is fast, silent, uses little power and is not damaged by being moved, which is why it is used in phones and tablets. It costs more per gigabyte than magnetic storage, and each cell can only be written to a limited number of times.
Virtual memory is a section of secondary storage, usually on the hard disk drive or the SSD, that the computer uses as an extension of RAM. When RAM is full, pages of data are transferred between RAM and virtual memory as they are needed, so the computer can keep more programs open than the RAM alone would allow. It is necessary because RAM is limited and the programs and data in use need more space than is available. The drawback is that reading from and writing to secondary storage is much slower than reading from RAM, so a computer that relies heavily on virtual memory slows down noticeably.
| Type of storage | How it works | Examples | Advantages and disadvantages |
|---|---|---|---|
| Magnetic | Platters divided into tracks and sectors, read and written using electromagnets | Hard disk drive (HDD) | Very large capacity and a low cost per gigabyte, but it has moving parts so it is slower and can be damaged by movement |
| Optical | Lasers create and read pits and lands | CD, DVD, Blu-ray | Cheap and portable and good for distributing files, but lower capacity, slower, and easily scratched |
| Solid-state (flash memory) | NAND or NOR technology, with transistors acting as control gates and floating gates | Solid-state drive (SSD), SD card, USB drive | Fast, silent, low power and no moving parts, but more expensive per gigabyte and each cell can only be written to a limited number of times |
Cloud storage and network hardware
Cloud storage means storing data on remote servers that are owned and managed by a cloud provider, rather than storing it locally on your own device. The data is uploaded over the internet and accessed over the internet, so physical servers and storage are still needed, they are simply not yours.
The advantages are that the data can be accessed from any device with an internet connection, so files can be shared between devices and with other people; the provider manages the hardware, the backups and the security updates, so there is no need to buy, replace or maintain storage hardware; the storage can be increased easily when it is needed; and the files are safe if your own device is lost, stolen or damaged. The disadvantages are that an internet connection is needed to reach the files at all, so they cannot be used offline; accessing a large file can be slower than reading it from a local drive; there is usually an ongoing subscription cost; and the data is held by a third party, so there are security and privacy risks and you lose direct control of it.
A computer needs a network interface card (NIC) to access a network. The NIC is the hardware that connects the device to the network and converts the data into a form that can be transmitted, and it is given a media access control (MAC) address at the point of manufacture. A MAC address is a unique identifier for that piece of hardware: it is 48 bits long and is usually written as hexadecimal in six pairs of digits, for example 00:1B:44:11:3A:B7. MAC addresses are created using the manufacturer code, which identifies the maker, and the serial code, which identifies the individual device. Because it is fixed at manufacture, a MAC address is used to identify a device on a network.
An IP address is allocated by the network rather than built into the hardware, and it is used to identify a device so that data can be routed to it. An IP address can be static, meaning it never changes, which is used for devices such as servers and printers that must always be found at the same address, or dynamic, meaning it is allocated each time the device connects, which allows addresses to be reused. There are two types in use. IPv4 addresses are 32 bits long and are written as four denary numbers separated by dots, such as 192.168.1.10; because there are only about 4.3 billion of them, the supply has run out. IPv6 addresses are 128 bits long and are written as eight groups of hexadecimal digits separated by colons, which provides vastly more addresses.
A router is the device that sends data to a specific destination on a network. It forwards packets along the best route towards their destination, it can assign IP addresses to the devices on the network, and it can connect a local network to the internet.
| MAC address | IP address | |
|---|---|---|
| What it identifies | The network interface card, which is the hardware itself | The device's connection to a network |
| When it is set | At the point of manufacture, and it cannot be changed | Allocated by the network, and it can be static or dynamic |
| Structure | 48 bits, usually written as hexadecimal in six pairs of digits, for example 00:1B:44:11:3A:B7 | IPv4: 32 bits, written as four denary numbers separated by dots. IPv6: 128 bits, written as eight groups of hexadecimal digits separated by colons |
Key terms you must be able to define
- Central processing unit (CPU)
- The part of a computer that processes the instructions and the data that are input into the computer so that the result can be output.
- Microprocessor
- A type of integrated circuit on a single chip, which is what allows a complete CPU to be built into a small device.
- Von Neumann architecture
- A design in which the instructions and the data are both held in the same memory and are fetched and processed one at a time by the CPU.
- Arithmetic logic unit (ALU)
- The unit inside the CPU that carries out arithmetic operations and logical operations.
- Control unit (CU)
- The unit inside the CPU that decodes instructions and controls the flow of data by sending control signals to the other components.
- Program counter (PC)
- The register that holds the address of the next instruction to be fetched.
- Memory address register (MAR)
- The register that holds the address of the memory location that is currently being read from or written to.
- Memory data register (MDR)
- The register that holds the data or instruction that has just been fetched from memory, or that is about to be written to memory.
- Current instruction register (CIR)
- The register that holds the instruction that is currently being decoded and executed.
- Accumulator (ACC)
- The register that holds the result of the calculations carried out by the ALU.
- Fetch-decode-execute cycle
- The cycle the CPU repeats to process each instruction: the instruction is fetched from memory into the CPU, decoded by the control unit, and then executed.
- Clock speed
- The number of cycles a CPU can carry out per second, measured in gigahertz. A higher clock speed means more instructions are processed each second.
- Cache
- A small amount of very fast memory inside the CPU that stores frequently used instructions and data, so that fewer fetches are needed from the slower RAM.
- Core
- A complete processing unit inside a CPU. A multi-core processor can process several instructions at the same time.
- Instruction set
- The list of all the commands that can be processed by a CPU. The commands are written in machine code.
- Embedded system
- A computer built into a larger device to perform one dedicated function, for example in a domestic appliance, a car, a security system, a lighting system or a vending machine. It is different from a general purpose computer, which performs many different functions.
- Input device
- Hardware used to enter data or instructions into a computer system, for example a keyboard, a barcode scanner or a microphone.
- Output device
- Hardware that presents the result of the processing carried out by the computer, for example a screen, a printer, a speaker or an actuator.
- Sensor
- A device that automatically captures a physical quantity from its surroundings and converts it into a digital signal that a computer can process.
- Primary storage
- Storage that is directly accessed by the CPU, holding the instructions and data currently in use. It includes RAM and ROM.
- RAM
- Random access memory: volatile primary storage that can be read from and written to, and that holds the programs and data currently in use. Its contents are lost when the power is turned off.
- ROM
- Read only memory: non-volatile primary storage that can be read but not changed. It holds the start-up instructions the computer needs to boot.
- Secondary storage
- Storage that is not directly accessed by the CPU and is necessary for more permanent storage of data, for example a hard disk drive, a DVD or an SSD.
- Virtual memory
- A section of secondary storage used as an extension of RAM. Pages of data are transferred between RAM and virtual memory when they are needed, so that more programs can be open than the RAM alone would allow.
- Cloud storage
- Storing data on remote servers owned by a cloud provider and accessing it over the internet, rather than storing it locally on your own device.
- Network interface card (NIC)
- The hardware that a computer needs in order to access a network. It converts the data into a form that can be transmitted and is given a MAC address at the point of manufacture.
- MAC address
- Media access control address: a unique identifier given to a network interface card at the point of manufacture. It is 48 bits long, usually written as hexadecimal in six pairs of digits, and is created from the manufacturer code and the serial code.
- IP address
- Internet protocol address: an address allocated by the network to identify a device so that data can be routed to it. It can be static, meaning it never changes, or dynamic, meaning it is allocated each time the device connects.
- IPv4
- A 32-bit IP address written as four denary numbers separated by dots, for example 192.168.1.10. There are only about 4.3 billion of them, so the supply has run out.
- IPv6
- A 128-bit IP address written as eight groups of hexadecimal digits separated by colons, which provides far more addresses than IPv4.
- Router
- The device that sends data to a specific destination on a network. It can assign IP addresses and can connect a local network to the internet.
Applied to real systems
Cambridge sets 0478 in systems you already use - a phone, a school network, a supermarket till, a website, a bank. Use these as models for how to apply the theory to a context you have not seen before, then write your own.
A washing machine contains an embedded system: a microprocessor running one dedicated program, with no keyboard and only a simple display. A temperature sensor reports how hot the water is, a level sensor reports how much water is in the drum, and the program compares those readings with the settings the user chose. When the reading is outside the range, the processor sends a signal to an actuator, which opens or closes the valve that lets the water in.
A self-service till uses several input and output devices at once. The barcode scanner reads the bars and spaces with reflected light and converts them into a product code, a resistive or capacitive touch screen takes the customer's selections, and a laser printer produces the receipt quickly and cheaply. Each device converts something in the real world into data the computer can process, or turns the processed data back into something the customer can see or hold.
A phone has a microprocessor with several cores, a small amount of RAM and flash storage for photos, apps and music. RAM holds the apps that are currently open and loses its contents when the battery runs flat, while the flash storage keeps them permanently. The phone also uses an accelerometer to work out when the screen has been turned, a light sensor to dim the display in a dark room, and proximity and touch sensors to know when it is being held to the ear or tapped.
A modern car contains many embedded systems rather than one general purpose computer. Each one performs a dedicated function: managing the engine, controlling the anti-lock braking, or setting off the airbags. They read pressure and accelerometer sensors many times a second, and because a delay could be dangerous the program is held in ROM so that it is ready the moment the car is started.
A school stores its files in cloud storage so that staff can reach them from any computer in the building, and the provider handles the backups. Each computer needs a network interface card to get onto the school network, and each one has a MAC address that is fixed in the hardware plus an IP address allocated by the network. Servers and printers are given static IP addresses so that they can always be found at the same address, while the computers in the classrooms are given dynamic addresses when they connect.
Flashcards
Click a card to flip it. Mark honestly — the tracker uses this.
Exam-style questions
8 questions, 24 marks. Write your answer, then reveal the mark scheme and tick each point you actually made. Answering honestly here is what makes the rest of the site useful.
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Mark scheme — tick each point you actually made
Exam technique for this topic
- In an FDE question, name the register each value moves into and keep them in order: PC, MAR, memory, MDR, CIR. Saying only that the instruction is fetched from memory will not score the marks that are awarded for the components.
- When a question asks how something affects the performance of a CPU, link the feature to the reason: more cores means more instructions processed at the same time, a larger cache means fewer fetches from the slower RAM, and a faster clock means more cycles per second.
- For a sensor question, name the sensor and state the data it captures, then say what the system does with that value. Naming the sensor alone is only worth one mark in a three-mark question.
- Compare storage media on named criteria: whether there are moving parts, speed of access, capacity, cost per gigabyte and how easily the medium is damaged. General statements such as 'it is better' never score.
- For cloud storage, give both sides of the argument. An explain question needs at least two advantages and two disadvantages, each with a reason, and remember to say what happens if the internet connection is lost.