Learn the idea. Follow the example. Then try it yourself.
Read each section before opening its workbook activity. The language is written for a reader around age 15, while keeping the computing words you need for Unit 2.
Section A1 · Before the workbook
Computer parts and choosing devices
Your goal: Follow data through a computer and explain why different jobs need different hardware.
Input, processing, storage and output
Hardware is the physical equipment in a computer system. Input devices collect data: a microphone collects sound, a scanner reads an image and a sensor measures a condition. The processor follows instructions to work on that data. Storage keeps it for later. Output devices present a result or cause an action, such as a screen showing a message or a motor opening a gate. One device can do more than one job: a touchscreen is both input and output.
A library kiosk data path. Follow the labels as you read.
What is inside?
The CPU carries out instructions. RAM holds programs and data currently being used; its contents are normally lost when power is removed. An SSD or hard drive holds files between uses. The motherboard connects components. A graphics processor helps with image-related work. A network interface connects the device to a network. These parts must work together: adding a fast CPU will not fix a slow network connection.
Choose for the job
A mobile device is portable and runs from a battery. A desktop can offer a larger screen and more upgrade options. A server supports services used by other computers. A multifunction printer combines printing and scanning. Compare user needs, accessibility, performance, compatibility, power, cost and security. Include time for testing, moving files and training people.
Shared storage and recovery
NAS is storage that users reach over a network. RAID arranges several disks to improve speed or availability, depending on the level. RAID 1 mirrors data onto another disk. It can help after one disk fails, but accidental deletion can affect both copies. A separate backup, with a tested restore process, is still needed.
Worked example
A school editing computer has plenty of storage but struggles when several large programs are open. More RAM may help because more working data can stay in fast memory. First check the actual memory use; do not choose a part just because its number is bigger.
Pause and think
Why would a library kiosk need a scanner and a network connection?
Check your thinking
The scanner reads the book code. The network lets the kiosk look up or update the library record. Each part supports a different step.
Go deeper · A1
A closer look inside three kinds of computer
Every computer has the same basic jobs (input, processing, storage, output), but designers package the parts very differently depending on the job. Compare the three diagrams below and look for what changes: how easy parts are to replace, how much power they use, and how much is duplicated.
A desktop motherboard (simplified). Parts plug into standard slots, which is why desktops are easy to upgrade and repair.
A desktop PC is built from separate parts joined by the motherboard. Because the RAM, storage and graphics card sit in standard slots, a technician can upgrade or replace one part without replacing the whole computer. Laptops use similar parts, but many are soldered to the board to save space, so they are harder to upgrade.
Inside a smartphone. A System on a Chip (SoC) puts the CPU, GPU and other processors on one chip to save space and battery.
A phone must be thin, light and last all day on a battery. Instead of many separate chips, it uses a System on a Chip (SoC) that combines the CPU cores, graphics, an AI engine and the mobile modem. Storage is NAND flash, which is non-volatile and has no moving parts. Sensors such as the accelerometer, gyroscope, GPS receiver and proximity sensor are inputs that most desktop PCs do not have.
A small server rack. Servers use redundant (duplicated) parts because many people depend on them at once.
A server provides a service to many client computers at once, so a failure affects everyone. That is why servers have lots of RAM, many CPU cores, and redundant parts: two power supplies, two network connections and drives in a RAID array, often all in a rack with an uninterruptible power supply (UPS).
Why speed depends on the slowest part
The memory hierarchy. Each level is slower but larger and cheaper than the one above, so computers copy the data they need upwards.
The CPU can only work on data that has been copied close to it. If data has to come from a slow hard disc or across a busy network, the fastest CPU still waits. This is called a bottleneck. When you recommend hardware, find the part that is holding the system back for that user, rather than simply choosing the biggest numbers.
An HDD has a seek time because the head and platter must move. An SSD reads flash memory electronically, so it is faster, quieter and shock-resistant.
Hardware performance factors to compare when choosing parts
Component
Performance factor
Unit
Better when…
CPU
Number of cores; clock speed; cache size
cores; GHz; MB
more cores help multitasking, higher GHz helps single tasks, bigger cache means fewer waits
RAM
Capacity; speed
GB; MT/s
enough GB to hold all open programs, otherwise the OS swaps to slow storage
HDD
Seek time; spindle speed; transfer rate
ms; rpm; MB/s
lower seek time, higher rpm and transfer rate
SSD
Read/write speed; interface (SATA or NVMe)
MB/s
NVMe SSDs can be several times faster than SATA ones
higher refresh and lower response time give smoother motion
Printer
Print speed; first page out; resolution; monthly duty cycle
ppm; s; dpi; pages
a higher duty cycle suits a busy office
Worked example: Does a faster drive matter?
A video editor copies a 30 GB project (30,000 MB) to their computer.
On a hard disc transferring at 150 MB/s: 30,000 ÷ 150 = 200 seconds (over 3 minutes).
On an NVMe SSD transferring at 3,000 MB/s: 30,000 ÷ 3,000 = 10 seconds.
For someone who opens large files many times a day, the SSD saves a lot of waiting. For someone who only writes documents, the difference is barely noticeable, so the money may be better spent elsewhere.
Always link the specification to what the user actually does.
Keeping data available: RAID and NAS
RAID levels. Orange blocks hold parity: extra data calculated from the other blocks, so a lost block can be rebuilt. RAID is not a backup.
A NAS (network attached storage) is a small computer whose only job is to share its drives over a network. It usually contains two or more drives in a RAID array, so that one drive failing does not lose the files. Remember the difference: RAID keeps a system running when a disc fails; a backup lets you recover from deletion, ransomware, theft or fire.
Key terms
Volatile
loses its contents when the power is switched off (RAM).
Non-volatile
keeps its contents without power (SSD, HDD, flash memory).
System on a Chip (SoC)
a single chip containing the CPU, graphics and other processors, used in phones and tablets.
Seek time
the time an HDD’s head takes to move to the right track.
Bottleneck
the slowest part of a system, which limits the speed of the whole system.
Redundancy
duplicate parts that take over when one fails.
UPS
uninterruptible power supply: a battery that keeps equipment running during a power cut.
Parity (RAID)
extra data calculated from other blocks, used to rebuild a failed drive’s data.
Think it through
Why does a tablet use flash storage rather than a hard disc?
Flash has no moving parts, so it survives being dropped, uses less battery, is silent and fits in a thin case. It is also faster to access.
A shop’s till server has one power supply and one disc. Name two single points of failure and a fix for each.
The power supply (fit two redundant PSUs, plus a UPS) and the disc (use RAID 1 or RAID 5, and keep a separate backup).
A gamer buys a very powerful graphics card but keeps an old 60 Hz monitor. What limits the experience?
The monitor. It can only show 60 frames per second, so frames the card draws above that are never seen. This is a bottleneck.
In the real world: a hospital
A hospital’s patient-record servers sit in a rack with redundant power, RAID storage and a UPS backed by a generator, because doctors need the records at any hour. Nurses on wards use cheaper thin clients or tablets, because the data and processing live on the servers.
When you can explain the main idea in your own words, complete the matching activity. You can return here whenever you need help.
From your lessons · A1
Extra detail from your teacher’s Unit 2 lessons. Practise it on the Diagram tasks page.
Ports and connectors
Common ports and connectors
Connector
Where
What it does
USB-A / USB-C
external port
data and power for keyboards, drives, phones; USB-C is reversible and can carry video and charging
HDMI / DisplayPort
external port
digital video and audio to a monitor or TV
VGA / DVI
external port (older)
video to monitors: VGA is analogue, DVI digital
RJ45
external port
wired Ethernet network cable
3.5 mm audio jack
external port
headphones, speakers, microphone
24-pin ATX
internal
main power from the power supply to the motherboard (older boards used 20-pin)
4/8-pin EPS (ATX12V)
internal
extra 12 V power for the CPU
6/8-pin PCIe power
internal
extra power for a graphics card
SATA data and SATA power
internal
connect hard drives, SSDs and optical drives
Molex and Berg
internal (legacy)
older drive power; Berg was for floppy drives
M.2 slot
internal
fast SSDs mounted straight onto the motherboard
Servers and their functions
A server provides services to many clients at the same time
Server
Function
File server
stores shared files and controls who can open them
Print server
queues print jobs and shares printers between users
Web server
stores web pages and sends them to browsers
Mail server
sends, receives and stores email
Database server
runs a database that many users query at once
Application server
runs shared software for clients
Authentication / directory server
checks usernames and passwords and holds user accounts
DHCP / DNS server
gives devices IP addresses / turns names into IP addresses
RAID, NAS and SAN compared (a NAS often uses RAID inside)
RAID
NAS
SAN
What it is
several disks combined inside one system
a storage device on the network
a separate high-speed network of storage
Used for
speed, capacity or fault tolerance (RAID 0, 1, 5)
shared files, backups and media in homes and small businesses
servers in data centres needing fast shared block storage
Accessed by
the one computer or server it is in
many devices using file protocols (SMB, NFS)
servers, as if the storage were their own disks
Factors affecting the choice of hardware
Use these factors to justify a recommendation in exam answers
Factor
Question to ask
User experience
is it easy to use, fast enough and reliable for this user?
Needs of the user
what tasks: office work, gaming, video editing, field work?
Performance
CPU, RAM, storage speed and graphics for the workload
Cost
purchase, running and maintenance costs against the budget
Compatibility
does it work with existing software, peripherals and the network?
Efficiency
power use, heat and battery life
Implementation
time, training and disruption to install it
Productivity
will it help people work faster or better?
Security
encryption, biometrics, ability to lock or wipe it
Portability and connectivity
size, weight, Wi-Fi, 4G/5G, ports
Characteristics of mobile devices
Mobile device
Typical features
Typical use
Smartphone
touchscreen, cellular data, GPS, cameras, many sensors
calls, apps, navigation, payments
Tablet
larger touchscreen, long battery, often Wi-Fi only
reading, media, sales demonstrations, note taking
Laptop
keyboard, more powerful CPU and storage, full OS
office work, programming, editing
Sat-nav
GPS receiver, maps stored, dashboard mount
route guidance in vehicles
Wearable
tiny screen, sensors (heart rate), Bluetooth to a phone
fitness tracking, notifications
Key terms
Connector
the physical plug or socket that joins a cable to a device.
Server
a computer that provides services to many clients.
NAS
network attached storage: a storage device shared over the network.
SAN
storage area network: a dedicated fast network of shared storage for servers.
Think it through
Why does a graphics card need its own PCIe power connector?
Powerful GPUs need more power than the PCIe slot can supply, so extra 12 V power comes directly from the power supply.
A small office wants shared storage for six staff and nightly backups. NAS or SAN?
NAS: it is cheaper, easy to set up and shares files over the existing network; a SAN is for data centres.
Watch
A short revision video from the MrBrownCS series (also in the department video folder).
Your goal: Explain how an operating system connects programs, users and hardware.
The operating system is the organiser
An operating system (OS) manages resources so programs can run. Its kernel is the central part that controls important operations. It gives programs CPU time, manages memory, handles interrupts and works with device drivers. Drivers translate requests into operations a device understands. File systems organise files on storage. Privileged kernel mode lets trusted OS code perform operations that ordinary programs cannot perform directly.
The OS connects applications and hardware. Follow the labels as you read.
Sharing and protecting resources
On a multitasking system, several tasks appear to run together because the processor switches between them or uses several cores. A multi-user OS also separates users and their permissions. A real-time OS must respond within a stated deadline; being fast on average is not enough. The OS also supports network connections and security, such as sign-in and file access rights.
Choose an interface
A graphical interface uses windows, icons and buttons. A command line uses typed instructions and can make repeated tasks easy to automate. A menu offers a limited set of choices. A ticket machine may use menus because people need a few clear options. An administrator might use commands to rename hundreds of files.
Different kinds of software
Applications help users do work, such as editing a video. Utilities maintain or protect the system, such as backup tools. Open-source licences allow access to source code under stated conditions. Open source does not automatically mean no cost, no security problems or free support. Choose software using compatibility, support, accessibility, performance and the needs of users.
Worked example
When you print a page, the application sends a request. The OS manages the print job, and a driver helps communicate with the printer. If the printer reports that it has no paper, the system must handle that event.
Pause and think
Why might a shop till use a menu instead of a full desktop?
Check your thinking
A menu can make common actions easier to find and limit mistakes. It must still support the tasks and accessibility needs of the staff.
Go deeper · A2
What the operating system is really doing
The operating system sits between programs and hardware. Programs ask the OS for resources rather than controlling the hardware directly.
The kernel is the part of the operating system that is always running. It decides which program uses the CPU next (scheduling), gives each program its own area of memory, reads and writes files through the file system, and talks to hardware through device drivers. Programs run in a restricted user mode; only the kernel runs in the privileged kernel mode, so a crashing app cannot take the whole computer down.
Multitasking: the scheduler gives each program a short time slice in turn, so fast that they all seem to run at once.
An interrupt is a signal that asks the CPU for attention: a key press, a network packet arriving, or a disc finishing a read. Instead of checking every device constantly, the CPU gets on with its work until an interrupt arrives. The kernel then runs the matching interrupt handler and returns to what it was doing.
Virtual memory lets programs use more memory than the RAM holds, by keeping less-used pages on storage.
Types of operating system
Type of OS
What it does
Example use
Real-time (RTOS)
Guarantees a response within a fixed time limit
car airbags, aircraft controls, factory robots
Single-user, single-task
One user runs one program at a time
a simple embedded controller or early handheld device
Single-user, multi-tasking
One user runs many programs at once
a laptop or phone
Multi-user
Many users share one computer’s resources at once, with separate accounts and permissions
a school file server or a web server
Choosing a user interface
Interface
Strengths
Weaknesses
Suits…
Graphical (GUI)
easy to learn; visual; mouse or touch
needs more memory and processing; slower for repetitive jobs
most everyday users
Command line (CLI)
fast for experts; scripts can automate jobs; uses few resources
commands must be remembered; easy to make serious mistakes
technicians and servers
Menu-based
limited choices, so few errors; quick to train
inflexible; deep menus can be slow
tills, ATMs, kiosks, TVs
Utility and application software
Utility software looks after the computer itself: antivirus and firewalls protect it, backup tools copy data, disc tools clean up and (for hard discs) defragment, compression tools make files smaller and encryption tools protect data. Application software helps a person do a task, such as writing, calculating, editing video or booking appointments.
Proprietary versus open-source software
Proprietary (closed source)
Open source
Cost
usually a licence fee
usually free to use
Source code
secret; only the company can change it
published; anyone can read, change and share it under its licence
Support
paid helpdesk and guaranteed updates
community forums, or paid support from a third party
Customising
only the settings the company allows
can be changed to fit exact needs, if you have the skills
Key terms
Kernel
the core of the OS that manages the CPU, memory, files and devices.
Device driver
software that lets the OS control a particular piece of hardware.
Interrupt
a signal that makes the CPU pause and deal with an event.
Scheduler
the part of the kernel that decides which program runs next.
Virtual memory
using storage as extra, slower memory when RAM is full.
File system
the method the OS uses to organise files on a drive (e.g. NTFS, ext4, APFS).
Think it through
Why can a single-user multitasking OS not be used to control a car’s airbag?
It shares the CPU between many tasks and cannot guarantee how quickly it will respond. An airbag needs a real-time OS that always reacts within milliseconds.
A laptop with 4 GB of RAM becomes very slow when 20 browser tabs are open. Explain why.
The tabs need more memory than the RAM holds, so the OS keeps swapping pages to the drive. Storage is far slower than RAM, so the computer spends its time moving pages instead of working.
Give one reason a technician might prefer a command line to a GUI.
They can write a script that repeats a job, such as creating 200 user accounts, automatically and exactly the same way each time.
When you can explain the main idea in your own words, complete the matching activity. You can return here whenever you need help.
From your lessons · A2
Extra detail from your teacher’s Unit 2 lessons. Practise it on the Diagram tasks page.
Programs never talk to hardware directly: requests pass through the shell and kernel, which decides how hardware is used.
The role of the kernel in controlling and managing system components and tasks
Kernel job
What it does
Program execution
loads programs and passes their requests to the CPU as system calls
Interrupt handling
decides which signals need immediate attention and makes the CPU deal with them first
Memory management
gives each program its own memory and stops programs overwriting each other
Process scheduling
shares CPU time between running programs
Device management
controls hardware through device drivers
File management
organises files and folders and controls access to them
The operating system’s role in networking and security
At home
In an organisation
Network type
usually peer-to-peer: no servers; share the internet and a printer
client–server: servers control resources and user accounts
How the OS manages security
power-on or login passwords, Wi-Fi (WPA2/WPA3) password, passwords on shared folders
users authenticate at login; access rights decide which files, printers and systems each user may reach; audit logs
Sharing resources
simple file and printer sharing
print queues, network storage shown as normal drives, managed LAN and WAN access
Factors affecting the choice of user interface: the user, the device, the task and the environment
Interface
Good for
Limitations
Graphical (GUI)
most users; touchscreens; visual tasks
uses more memory and processing power
Command line (CLI)
technicians, servers, automation with scripts
commands must be learned; easy to make mistakes
Menu-based
kiosks, ATMs, simple devices
only the choices on the menu
Natural language / voice
hands-free use, accessibility
can misunderstand; needs a quiet place
When choosing an operating system, consider: the hardware it must run on, the software and devices it must support, the users’ skills, cost and licensing, security and updates, and whether it needs to be a network, real-time or mobile OS.
Principles and implications of open source software
Open source
Proprietary (closed source)
Source code
published; anyone can study, change and share it
kept secret by the company
Cost
often free to use
licence fees
Support
community forums, or paid support from companies
official support from the vendor
Implications
can be customised; bugs can be found and fixed by many people; may need in-house skills
consistent, supported product; locked to the vendor’s decisions and prices
Examples
Linux, Android (base), LibreOffice, Firefox
Windows, macOS, Microsoft 365
Disk cache
A disk cache keeps recently and frequently used data from a drive in fast memory (part of RAM, or a chip on the drive). The next time that data is needed it is read from the cache instead of the slower drive. Writes can also be collected in the cache and written to the drive later, which is faster but risks losing data if the power fails before they are saved.
Key terms
Kernel
the core of the operating system that manages hardware, memory and CPU time.
Shell
the part of the OS the user interacts with: a GUI or command line.
Open source
software whose source code is published so others can study, change and share it.
Disk cache
fast memory holding recently used disk data to speed up access.
Think it through
Why does a server often use a command-line interface?
It needs fewer resources than a GUI, and administrators can automate tasks with scripts and manage it remotely.
Give one benefit and one drawback of open source for a school.
Benefit: free to install on every PC. Drawback: staff may need extra training, and support relies on the community or a paid partner.
Watch
A short revision video from the MrBrownCS series (also in the department video folder).
Your goal: Turn collected data into useful information and plan recovery.
Collect data carefully
Hardware collects data through sensors, scanners and keyboards. Software controls forms, records readings and applies checks. Validation checks whether an input follows rules. A range check might allow an age from 0 to 120. A type check might require a whole number. These checks can reject impossible values, but cannot prove that an accepted value is true.
Data becomes a report. Follow the labels as you read.
Six processing jobs
Sorting puts records into an order. Aggregation combines values, for example a daily total. Analysis looks for patterns or meaning. Conversion changes a representation or format. Reporting presents information for an audience. Validation checks rules. Several of these jobs may happen in one system: a shop can check prices, sort sales by date, total them and show a weekly report.
Share data between systems
Sharing can improve access and reduce repeated typing. It also creates problems: two sites may change the same record, a network may fail, or someone may receive more access than they need. Decide which system holds the main record, how updates are kept in step and who can read or change each field. Include training, cost and time when introducing the system.
Prepare for loss
A backup is a recoverable copy. An archive keeps records for longer-term reference. A recovery plan explains what to restore, where the copy is stored, who does the restore and how to check it. Test restoration: a message saying a backup finished does not prove that the files can be recovered.
Worked example
A club counts 12, 15 and 18 visitors. Aggregation gives 45 visits. Analysis could compare this with last week. A report could show a chart. A validation rule of 0–100 would accept all three counts, even if one had been typed incorrectly.
Pause and think
How would you test a backup without risking live files?
Check your thinking
Restore a sample into a separate test location, open it and compare it with the expected original. Record whether the restore worked.
Go deeper · A3
From raw data to useful information
A typical data processing pipeline. Each stage turns raw data into something more useful.
Data is collected by hardware such as sensors, barcode scanners, RFID readers, card readers, cameras and keyboards, and by software such as online forms, apps that log activity, and systems that import data from other systems. Automatic collection (a sensor or scanner) is fast and avoids typing errors; manual collection (a person typing) is flexible but slower and error-prone.
A control system. Sensors collect data, the program decides, actuators act, and feedback repeats the loop.
Common validation checks
Validation check
What it checks
Example
Presence
something has been entered
email cannot be left blank
Type
the right kind of data
age must be a whole number
Range
between set limits
year group from 7 to 13
Length
the right number of characters
UK mobile number has 11 digits
Format
matches a pattern
postcode like LS1 4AP
Lookup
is in a list of allowed values
course code exists in the course table
Check digit
a calculated digit matches
the last digit of a barcode or ISBN
Validation stops impossible data, but it cannot tell whether data is true. Verification checks that data was copied correctly, for example by typing a password twice or by a person comparing the screen with the paper form.
Worked example: Multi-level sort, then aggregation
A school has attendance records with a tutor group, a surname and minutes late.
Sort first by tutor group, then by surname within each group, so each tutor sees their own list in alphabetical order.
Aggregate: total the minutes late for each tutor group, and count the students late more than 3 times.
Analyse: compare this month’s totals with last month’s to spot a trend.
Report: a bar chart per tutor group, sent automatically to heads of year every Monday.
Sorting and aggregation turn thousands of rows into a few facts someone can act on.
Data stored across more than one system
Using and storing data across multiple computer systems
Impact
Benefits
Problems
Access
staff at every site see the same records
needs a working network; remote access must be secured
Cost
less duplicated hardware at each site
links, cloud fees, licences and support
Implementation
one agreed system and format
migrating and merging old data; training; downtime
Productivity
no phoning other sites or re-typing data
slow if the link is slow; version conflicts
Security
central backups and consistent access control
more ways in for attackers; one breach exposes more data
Backup strategies. The choice trades time and space for making backups against the time and effort to restore.
Key terms
Validation
an automatic check that data is reasonable and follows the rules.
Verification
a check that data has been entered or copied accurately.
Aggregation
combining many records into totals, counts or averages.
Actuator
a device that acts on the world, such as a motor, heater or valve.
ADC
analogue-to-digital converter: turns a sensor’s continuous signal into numbers.
Incremental backup
copies only the data changed since the last backup of any kind.
Think it through
Why is a range check on a date of birth not enough to stop mistakes?
A date can be inside the range but still wrong, e.g. 12/03 typed instead of 03/12. Verification (such as confirming with the person) is needed as well.
On Friday the server fails. Using incremental backups, which backups are needed to restore it?
Sunday’s full backup, then Monday’s, Tuesday’s, Wednesday’s and Thursday’s incrementals, applied in order.
Give one advantage of collecting data with a sensor instead of a person.
It can take readings continuously, day and night, at exact intervals, without typing errors or getting tired.
When you can explain the main idea in your own words, complete the matching activity. You can return here whenever you need help.
Watch
A short revision video from the MrBrownCS series (also in the department video folder).
Watch and think:
Why store data in a database instead of a spreadsheet?
Your goal: Compare architecture models and choose one for a situation.
Instructions are stored too
In a stored-program computer, instructions are kept in memory so the CPU can fetch them. In the simple Von Neumann model, instructions and data share memory and a transfer path. They can compete for that path. In the Harvard model, instruction and data storage have separate paths, allowing some transfers to happen at the same time. Real processors may combine ideas from both models.
Simplified memory reads in Von Neumann and Harvard models. Follow the labels as you read.
Several computers working together
A cluster is a group of computers working together. It may share a large task or keep a service available when one computer fails. The computers must exchange information, which adds delay and management work. A cluster helps only if the software and task can use it well.
Where memory is matters
UMA means uniform memory access: processors have broadly similar access times to shared memory. NUMA means non-uniform memory access: a processor can access some memory faster than memory connected farther away. A program that keeps its data near the processor using it can benefit from locality.
Running an older system
Emulation makes one system behave like another. A museum may use it to run an old game. The emulator has to reproduce the behaviour expected by the program, including relevant hardware. Compatibility and performance can limit success. Choose architecture using the workload, memory access, reliability, energy and cost.
Worked example
A ticket service may divide requests across a cluster. If the database is the slow part and every request waits for it, adding more web computers may not fix the problem. Identify the bottleneck first.
Pause and think
Does a cluster always make one program run faster?
Check your thinking
No. Work must be divided effectively, and communication or shared resources can become a limit.
Go deeper · B1
Two ways to connect the CPU to memory
Von Neumann (left) shares one memory and bus. Harvard (right) keeps instructions and data apart, each with its own bus.
In the stored program model, the program is held in memory just like data, so a computer can switch jobs simply by loading a different program. Early computers were rewired or re-switched for each new task. In a von Neumann machine, instructions and data share one memory and one bus, which is simple and flexible. In a Harvard machine they are separate, so the next instruction can be fetched while data is being read. Small controllers such as those in microwaves, washing machines and Arduino-style boards often use Harvard designs; modern PC processors mix both, with separate instruction and data caches in front of one main memory.
Many processors working together
A cluster: many ordinary computers (nodes) linked by a fast network act as one powerful system. If one node fails, the others continue.
A cluster links many computers, called nodes, with a fast network. Big jobs such as weather forecasting, film rendering or searching huge datasets are split into parts that run at the same time. Clusters can grow by adding nodes, and they keep working if one node fails. The cost is the network: sending data between nodes is far slower than inside one computer, so the job must split into parts that do not need to talk to each other often.
UMA: every processor has equal access to one memory. NUMA: each processor has fast local memory and slower access to the rest.
Emulation
Emulation makes one computer behave like another, so software written for a different instruction set can still run.
Factors affecting the choice of architecture
Architecture
Good choice when…
Watch out for…
Von Neumann with UMA
a general-purpose PC or laptop with a few cores
the shared bus limiting speed
Harvard
a fixed program in a small embedded controller that needs predictable speed
less flexible use of memory
NUMA server
one large machine with many processors, e.g. a big database
software must keep data near the processor using it
Cluster
a very large job that splits into independent parts, or a service that must stay up
network delay, cost, space, power and cooling
Key terms
Stored program
a design where the program is kept in memory and can be changed like data.
Bus
a set of parallel wires carrying addresses, data or control signals between parts.
Von Neumann bottleneck
the delay caused by instructions and data sharing one path to memory.
Node
one computer in a cluster.
NUMA
non-uniform memory access: memory near a processor is faster for it than distant memory.
Emulator
software that imitates a different computer, so its programs can run.
Think it through
Why do many microcontrollers use a Harvard architecture?
Their program is fixed in ROM/flash and never changes, and they need fast, predictable timing. Separate buses let an instruction and data be fetched at the same time.
A NUMA server runs slowly because one program’s data sits in another processor’s memory. Suggest a fix.
Have the operating system run the program on the processor next to its data, or move the data into that processor’s local memory.
Why is emulation usually slower than running on real hardware?
Every instruction written for the old processor has to be translated into instructions for the new one, which is extra work.
In the real world: weather forecasting
National weather services run their forecasts on supercomputers built as clusters of thousands of nodes. The atmosphere is divided into a 3D grid, and each node calculates its own region, exchanging only the edge values with its neighbours.
When you can explain the main idea in your own words, complete the matching activity. You can return here whenever you need help.
Watch
A short revision video from the MrBrownCS series (also in the department video folder).
Watch and think:
What is stored in memory in a Von Neumann computer?
Your goal: Trace instruction execution and explain real performance.
Fetch, decode, execute
The CPU fetches the next instruction, decodes the operation and executes it. Execution might add numbers, move data or change the next instruction address. An instruction set defines the operations the CPU understands. A program is built from these operations.
Two instructions overlap in a three-stage pipeline. Follow the labels as you read.
Overlap work with a pipeline
A pipeline lets different instructions occupy different stages at the same time. Instruction 2 may be fetched while instruction 1 is decoded. This can increase the number of completed instructions over time. It does not mean every instruction finishes instantly. A branch, a dependency or missing data can stall the pipeline.
Keep useful data nearby
Registers and cache provide fast storage close to the processor. A cache hit finds the requested data there. A miss requires a slower access elsewhere. Larger cache may help some workloads, but results depend on what the program accesses.
Measure the whole task
Clock speed measures cycles each second, not useful tasks finished. Instruction count, work per cycle, cache, memory and parallel software all affect speed. Multiprocessing uses several processing units. Multithreading provides several threads of execution. Mobile and embedded processors often prioritise low power, heat and predictable response. Desktop and server processors may prioritise throughput, capacity and reliability.
Worked example
With three stages and no stalls, instruction 1 uses cycles 1, 2 and 3. Instruction 2 uses cycles 2, 3 and 4. Two instructions finish after four cycles rather than six in this simplified model.
Pause and think
What happens if instruction 2 needs a result instruction 1 has not produced?
Check your thinking
It may need to wait. That dependency can cause a pipeline stall unless the processor has a way to handle it.
Go deeper · B2
The instruction cycle in more detail
The instruction cycle. The clock keeps every step in time; each tick moves the cycle on.
Every program, from a game to a spreadsheet, is turned into millions of simple machine instructions such as load a number, add, compare and jump. The list of instructions a processor understands is its instruction set. A 3 GHz clock ticks three billion times a second, so one tick lasts about 0.33 nanoseconds.
Two approaches to instruction sets
RISC (reduced instruction set)
CISC (complex instruction set)
Instructions
few, simple, mostly one clock cycle each
many, some doing several steps in one instruction
Programs
need more instructions
need fewer instructions
Chip
simpler, uses less power and heat
more complex, traditionally more power
Typical use
phones, tablets, many newer laptops (e.g. ARM)
most desktop PCs and many servers (x86)
Pipelining
Pipelining. While one instruction executes, the next is being decoded and the one after is being fetched.
Cores, threads and cache
A multi-core CPU. Each core runs its own instructions; small private caches are fastest, and a larger L3 cache is shared.
A multi-core processor has several complete processing units on one chip; multi-processing means using more than one of them at the same time. A program can be written as several threads, flows of work that the OS can run on different cores. Some cores can also run two threads at once, switching to the second thread whenever the first is waiting for memory. Cache keeps copies of recently used instructions and data close to the core: a cache hit is fast; a cache miss means a much slower trip to RAM.
CPU performance factors
Factor
Unit
Effect on speed
Clock speed
GHz
more cycles per second, but more heat and power
Number of cores
cores
more work at once, if the software uses threads
Cache size
MB
fewer slow trips to RAM
Manufacturing process
nm (nanometres)
smaller transistors: more of them per chip, less power, less heat
Core design / generation
product family
newer designs do more work per clock cycle
Worked example: Why 4 cores is not 4 times faster
A video export takes 12 seconds on one core. Three-quarters of the work (9 s) can be split between cores; one-quarter (3 s) must run in order.
On 4 cores, the parallel part takes 9 ÷ 4 = 2.25 s, but the sequential part still takes 3 s.
Total = 3 + 2.25 = 5.25 s. The speed-up is 12 ÷ 5.25 ≈ 2.3 times, not 4 times.
Adding even more cores gets closer and closer to 3 s but can never beat it, because the sequential part cannot be shared.
Extra cores only speed up the part of a job that can run in parallel.
Different CPU architectures for different jobs
CPU type
Designed for
Typical features
Embedded
one fixed job inside a device (washing machine, car engine)
low cost and power; often has its own memory and inputs/outputs on the chip
Mobile
phones, tablets, thin laptops
battery life first: a mix of fast and efficient cores in a SoC, slows down when hot
Microcomputer (PC)
general desktop and laptop use
high single-core speed, several cores, upgradable, fan cooling
Server
many users and requests, all day
many cores, huge caches, support for lots of RAM, error-correcting memory, reliability features
Key terms
Instruction set
all the machine instructions a processor can carry out.
Pipelining
overlapping the fetch, decode and execute stages of different instructions.
Cache hit / miss
whether the data needed was already in cache (hit) or had to come from RAM (miss).
Thread
a separate flow of instructions within a program that can run alongside others.
Clock speed
how many cycles the CPU completes each second, measured in GHz.
Think it through
Why might a phone run a demanding game more slowly after 10 minutes?
The chip heats up, so it lowers its clock speed (throttles) to protect itself and save battery.
Doubling the clock speed does not always halve the time a program takes. Why not?
The CPU may be waiting for memory, storage or the network. A faster clock does not make those parts faster.
Which would help a web server handling thousands of small requests more: a faster clock or more cores?
More cores, because each request is independent and can be handled in parallel.
When you can explain the main idea in your own words, complete the matching activity. You can return here whenever you need help.
Watch
A short revision video from the MrBrownCS series (also in the department video folder).
Your goal: Follow the roles of registers during fetch and interrupts.
Addresses and values are different
An address identifies a memory location. A value is the data stored there. The program counter (PC) holds the address of the next instruction. The memory address register (MAR) holds the location being accessed. The memory data register (MDR) holds data travelling to or from memory.
Addresses and instruction data follow different registers. Follow the labels as you read.
Follow a fetch
In a simplified fetch, the PC value is copied to MAR. The instruction at that address is read into MDR and then copied into the instruction register (IR). The PC is advanced to the next instruction address according to the architecture. The CPU decodes and executes the instruction. A branch can change the next address.
Other registers
An accumulator may hold arithmetic results. General-purpose registers hold temporary values such as operands and intermediate results. Registers are tiny and fast; they are not the same as RAM. Their exact names and use vary between processor designs.
Respond to an interrupt
A device or event can request attention through an interrupt. The CPU and OS preserve enough information about the current work, run the relevant interrupt handler, then resume when appropriate. Without correct state handling, the program could continue with the wrong values.
Worked example
If PC holds 204, MAR receives address 204. Memory returns the instruction stored there through MDR to IR. The number 204 is an address; the instruction read from that address is different information.
Pause and think
Which register holds the current instruction?
Check your thinking
The instruction register, often called IR or CIR. PC holds the next instruction address.
Go deeper · B3
Where the registers sit
The special registers. The MAR sends addresses out; the MDR holds whatever comes back from, or goes to, memory.
Registers are the fastest storage in the whole computer because they are part of the CPU itself, but there are only a few of them. General-purpose registers hold values a program is working on, such as a loop counter. Special registers have one fixed job in the instruction cycle. A 64-bit processor has 64-bit registers, so it can move or add 8 bytes in one step.
Worked example: Tracing the registers for a tiny program
devices get attention only when they need it, instead of the CPU checking them constantly
Timer
the OS clock ticks every few milliseconds
lets the scheduler swap between programs for multitasking
Software
a program asks the OS to open a file (a system call)
programs must ask the kernel to use hardware
Error
divide by zero, or an attempt to use protected memory
the OS can stop the faulty program safely
Key terms
Program counter (PC)
holds the address of the next instruction to fetch.
MAR
holds the address of the memory location being read or written.
MDR
holds the data or instruction just read from, or about to be written to, memory.
CIR
holds the instruction currently being decoded and executed.
Accumulator
holds the result of the last calculation by the ALU.
Interrupt service routine
the code that runs to deal with a particular interrupt.
Think it through
Why must the PC and registers be saved before an interrupt is handled?
The interrupt routine will use the registers too. Saving them means the original program can carry on exactly where it stopped, as if nothing happened.
In the trace, why does the MAR hold 20 during the first execute step?
LOAD 20 needs the value stored at address 20, so that address goes to the MAR to read it from memory.
What would happen if a JUMP 0 instruction was executed?
The PC would be set to 0, so the next fetch would start the program again from the beginning.
When you can explain the main idea in your own words, complete the matching activity. You can return here whenever you need help.
Watch
A short revision video from the MrBrownCS series (also in the department video folder).
Watch and think:
What is the difference between the MAR and the MDR?
Your goal: Convert and calculate with binary, BCD and fixed-width values.
Bits and place values
A bit is 0 or 1. Eight bits form a byte. Binary place values double as you move left: 1, 2, 4, 8, 16, 32 and so on. Add the places that contain 1. For 00101101, the total is 32+8+4+1=45. State the bit width. Use kB=1000 bytes or KiB=1024 bytes when the question specifies it.
Decimal 45 represented in binary and BCD. Follow the labels as you read.
Four arithmetic operations
Addition carries when a column reaches two: 1011+0110=10001. Subtraction borrows from the next place: 1010−0011=0111. Multiplication forms shifted partial products: 11×101=1111. Division can use repeated place-value steps: 1100÷11=100. Check each result in decimal while learning.
BCD codes each decimal digit
BCD uses four bits for each decimal digit. Decimal 45 becomes 0100 0101. In BCD addition, if a digit sum is above 9 or produces a carry, add 0110 to correct the digit. For 8+7, 1000+0111=1111; adding 0110 gives 1 0101, which becomes BCD 0001 0101. For other BCD operations, work with decimal digits and valid carries/borrows, then encode each resulting digit. For example 12−5=7 is BCD 0000 0111, not an invalid four-bit digit.
Negative values and fractions
In eight-bit two’s complement, invert the bits of +5 (00000101) and add 1 to get −5 (11111011). The range is −128 to 127. Overflow happens when a result does not fit. Floating point stores a scaled number: 6.5 can be written as 1.101₂ × 2². Real formats set the mantissa and exponent widths. Finite precision means some values round; always use the format given.
Worked example
Decimal 26 = 16+8+2, so eight-bit binary is 00011010. BCD is 0010 0110 because it encodes the digits 2 and 6 separately.
Pause and think
What is 0101 + 0011 in binary?
Check your thinking
1000. Decimal 5+3=8, which is a useful check.
Go deeper · C1
Units, and why 1,000 is not always 1,000
Units of data. Read the question carefully to see whether it means 1,000 or 1,024.
Hexadecimal: a short way to write binary
Each hexadecimal digit stands for exactly one nibble (4 bits), so a byte is always two hex digits: 00 to FF.
Programmers and technicians use hexadecimal (base 16) because it is much easier to read than long binary strings but converts to binary instantly. You will see it in colour codes such as #FF8000, network MAC addresses such as 3C:22:FB:19:A0:7E, and memory addresses in error messages.
The 16 nibbles
Denary
Binary
Hex
Denary
Binary
Hex
0
0000
0
8
1000
8
1
0001
1
9
1001
9
2
0010
2
10
1010
A
3
0011
3
11
1011
B
4
0100
4
12
1100
C
5
0101
5
13
1101
D
6
0110
6
14
1110
E
7
0111
7
15
1111
F
Binary arithmetic
Binary addition, worked from right to left. Check it: 92 + 58 = 150.
Worked example: Subtraction by adding a negative (35 − 12)
Write 12 in binary: 0000 1100.
Make it negative with two’s complement: flip every bit 1111 0011, then add 1 → 1111 0100 (−12).
Throw away the carry that falls off the left of the 8 bits: 0001 0111 = 16 + 4 + 2 + 1 = 23.
Computers subtract by adding a negative number, so the same adder circuit does both jobs.
Worked example: Multiplying and dividing with shifts
Shifting left one place doubles a number: 0000 0110 (6) becomes 0000 1100 (12).
To multiply 6 × 5, write 5 as 4 + 1: (6 shifted left twice) + 6 = 24 + 6 = 30, which is 0001 1110.
Shifting right one place halves a whole number: 0010 1100 (44) shifted right twice is 0000 1011 (11), so 44 ÷ 4 = 11.
Longer divisions use the same ‘bus stop’ method as denary, but each step only asks: does it go in once, or not at all?
Negative numbers and fractions
In two’s complement the leftmost bit is worth −128, so eight bits store −128 to +127.Floating point works like scientific notation in binary. Most fractions (such as 0.1) cannot be stored exactly, so they are rounded.
Binary coded decimal (BCD) stores each denary digit in its own nibble. It is less efficient than pure binary but converts easily to the digits on a display, which is why calculators, digital clocks and some financial systems use it. When a BCD digit adds up to more than 9, add 0110 (6) to correct it and carry into the next digit.
Key terms
Nibble
four bits; one hexadecimal digit.
Hexadecimal
base 16, using 0–9 and A–F.
Two’s complement
a way to store negative whole numbers where the leftmost bit has a negative place value.
Overflow
when a result is too big for the number of bits available.
Mantissa
the part of a floating point number that holds its digits.
Exponent
the part of a floating point number that says where the binary point goes.
Think it through
Convert 0100 1111 to hexadecimal and denary.
0100 = 4 and 1111 = F, so it is 4F. In denary, 64 + 8 + 4 + 2 + 1 = 79.
What is the largest number an unsigned byte can hold, and the largest in two’s complement?
Why can a bank not simply store £0.10 as a floating point number?
0.1 has no exact binary form, so it would be stored as a tiny bit more or less. Over millions of transactions those rounding errors add up, so money is stored as whole pence (or in BCD/decimal types).
When you can explain the main idea in your own words, complete the matching activity. You can return here whenever you need help.
From your lessons · C1
Extra detail from your teacher’s Unit 2 lessons. Practise it on the Diagram tasks page.
Recognising a number base from its digits
Base
Digits allowed
Example
Used for
Binary (base 2)
0 1
1011
how computers store everything
Octal (base 8)
0–7
17
older systems; Linux file permissions (chmod 755)
Denary / decimal (base 10)
0–9
985
everyday counting
Hexadecimal (base 16)
0–9, A–F
3F
colour codes, MAC addresses, memory addresses
A number can only belong to a base if every digit is smaller than the base. 1,0 could be any base; 7 could be octal, denary or hex but not binary; 8 rules out octal; any letter A–F means hexadecimal.
Worked example: octal to binary and denary
Each octal digit is exactly 3 bits: 7 = 111, 5 = 101.
So octal 75 = 111 101 in binary.
In denary: 7 × 8 + 5 = 61.
Octal 75 = binary 111101 = denary 61
Think it through
Which bases could the digits 1, 9, 8, 5 belong to?
Denary and hexadecimal only: 9 and 8 are too big for binary and octal.
Why is hex used for colour codes like #FF8800?
Each pair of hex digits is one byte (0–255) for red, green or blue, written in just two characters.
Watch
A short revision video from the MrBrownCS series (also in the department video folder).
Your goal: Explain character sets, code points and stored bytes.
Characters need codes
Computers store text using agreed number codes. A character set says which characters exist and how they are identified. ASCII is a limited set including Latin letters, digits and common punctuation. Seven-bit ASCII has 128 possible codes. It cannot represent every writing system.
From a character to stored bytes. Follow the labels as you read.
Unicode covers more languages
Unicode assigns code points to a wide range of characters. An encoding such as UTF-8 turns those code points into stored bytes. A code point is not the same thing as a byte. In UTF-8, A occupies one byte while many other characters require more. A visible symbol can sometimes involve more than one code point.
Why this matters
A school needs names to remain correct after saving, searching and transferring records. If one system expects a different encoding, text can become unreadable or lose characters. Test inputs from several languages and check round trips: type, save, reopen, export and import.
Plan storage carefully
Do not calculate byte size by counting visible letters unless the encoding and limits justify it. Field length rules may count characters or bytes differently. Use the convention stated in an exam question.
Worked example
The code point for A is U+0041. UTF-8 stores it as one byte, 01000001. UTF-8 stores é as two bytes. That difference affects byte-size calculations.
Pause and think
Does Unicode mean that every character takes two bytes?
Check your thinking
No. Unicode defines code points; the chosen encoding determines how they are stored.
Go deeper · C2
Inside the ASCII code
ASCII was designed so that simple bit masks change letter case or turn a digit character into its value.
ASCII uses 7 bits, giving 128 codes: control codes (such as new line), the space, digits, punctuation and the English upper and lower case letters. Many systems use an 8-bit extended ASCII with 256 codes, but different countries filled the extra 128 codes differently, so a file could show the wrong symbols on another computer.
Unicode gives every character a code point; UTF-8 stores common characters in 1 byte and others in 2–4 bytes.
Unicode solves this by giving one agreed number, a code point, to more than 150,000 characters from almost every writing system, plus symbols and emoji. UTF-8 is the most common way to store those code points as bytes. The first 128 Unicode code points are the same as ASCII, which made the change-over much easier.
ASCII and Unicode compared
ASCII
Unicode (UTF-8)
Characters
128 (7-bit)
over 150,000
Bytes per character
1
1 to 4
Languages
English only
almost every language, maths symbols and emoji
Implications
small files, very simple
names and text from any country display correctly; some characters take more space
Key terms
Character set
the list of characters a system can represent, and the code for each one.
Code point
the unique number Unicode gives to a character, written like U+0041.
UTF-8
a variable-length encoding that stores Unicode code points in 1–4 bytes.
Bit mask
a pattern used with AND, OR or XOR to change or test chosen bits.
Think it through
The ASCII code for ‘D’ is 68. What is the code for ‘d’?
Lower case letters are 32 more than upper case: 68 + 32 = 100.
Your goal: Calculate raw image size and choose suitable compression.
A raster image is a grid
A bitmap or raster picture is made of pixels. Width and height give the grid size. More pixels can show finer detail if the original image contains it. Enlarging a small image does not automatically create real detail.
Pixels form a raster image. Follow the labels as you read.
Bit depth describes each pixel
Bit depth is the number of bits used per pixel in the stated format. A simple 8-bit value has 256 possible patterns. A common 24-bit colour image allocates 8 bits each to red, green and blue. Resolution and bit depth affect both quality and storage.
Calculate in clear steps
Raw pixel-data bits = width × height × bit depth. Divide by 8 for bytes. This excludes headers, metadata, padding and compression. A real saved file can therefore have a different size.
Keep the right versions
Lossless compression allows exact reconstruction. Lossy compression removes some information to save space and may cause visible artefacts. A photographer may keep a high-quality master for editing and printing, plus smaller web copies for faster loading. A vector drawing stores shapes rather than a fixed pixel grid; it can be useful for scalable diagrams, although C3 focuses on raster data.
Worked example
A 200×100 image at 8 bits per pixel uses 20,000 pixels ×8 =160,000 bits. Divide by 8 to get 20,000 bytes of raw pixel data.
Pause and think
If both width and height double at the same bit depth, what happens to raw size?
Check your thinking
It becomes four times as large: there are twice as many rows and twice as many columns.
Go deeper · C3
From pixels to bits
A bitmap is a grid of pixels. Each pixel is stored as a number; the bit depth decides how many colours that number can describe.Higher resolution means more, smaller pixels: smoother edges and more detail, but a bigger file.
The real file is a little bigger, because a header stores the width, height and bit depth, plus metadata such as the date and camera.
File size = width × height × bit depth ÷ 8 bytes.
Vector graphics store instructions for shapes; bitmaps store every pixel.
Compression
Run-length encoding (RLE) is a simple lossless compression method.
Common image formats
Format
Compression
Best for
JPEG
lossy: removes detail the eye notices least
photographs on web pages and phones
PNG
lossless
screenshots, logos and images with sharp edges or transparency
GIF
lossless, but only 256 colours
simple animations and icons
RAW / TIFF
none or lossless
original photos that will be edited or printed
SVG
vector (not pixels)
logos, diagrams and icons that must scale
Screens make colours by adding red, green and blue light (RGB). Printers work the other way, mixing cyan, magenta, yellow and black ink (CMYK) that absorbs light. Images for print are therefore often converted, and a colour that looks bright on screen may print duller.
Key terms
Pixel
the smallest dot of colour in a bitmap image.
Resolution
the number of pixels in an image, given as width × height.
Bit depth (colour depth)
the number of bits used for each pixel; n bits give 2ⁿ colours.
Metadata
data about the image, such as its size, date and camera settings.
Lossless
compression that can rebuild the original exactly.
Lossy
compression that permanently removes some data to make a much smaller file.
Think it through
How many colours can a 4-bit image show?
2⁴ = 16 colours.
Why does a logo look blurry when a small JPEG of it is enlarged on a poster?
The JPEG is a bitmap with a fixed number of pixels. Enlarging it makes each pixel bigger, and JPEG compression has already removed sharp-edge detail. A vector (SVG) logo would stay sharp.
An image doubles its resolution in both directions. What happens to the uncompressed file size?
It becomes four times bigger, because there are twice as many pixels across and twice as many down.
When you can explain the main idea in your own words, complete the matching activity. You can return here whenever you need help.
Watch
A short revision video from the MrBrownCS series (also in the department video folder).
Your goal: Trace data structures and justify their use.
A stack reverses arrival order
A stack is last-in first-out (LIFO). Push adds to the top; pop removes from the top. A pile of trays is a useful analogy. Programs use call stacks to return from nested function calls. A full stack may overflow; trying to remove from an empty one is also an error to handle.
Stack and queue remove different items. Follow the labels as you read.
A queue keeps arrival order
A queue is first-in first-out (FIFO). Enqueue adds at the rear; dequeue removes from the front. Print jobs and hardware buffers often use queue behaviour. Real scheduling can add priorities, but that is an extra rule rather than ordinary FIFO.
Arrays and lists organise sequences
An array uses numbered positions, called indices. Many languages start with index 0. Arrays are useful when you need direct access by position. A list is an ordered collection; the costs of access, adding and removing depend on how the list is implemented. Do not assume all lists work the same way.
Choose by the required operations
Ask what arrives, which item must leave next, whether you need direct access and what happens when capacity is reached. The same idea may appear in software and hardware: a printer queue is managed in software, while a device buffer may also behave as a queue.
Worked example
Push A, push B, pop, push C leaves a stack with C at the top and A below. Enqueue A, enqueue B, dequeue, enqueue C leaves B at the front and C at the rear.
Pause and think
Why does FIFO suit ordinary print jobs?
Check your thinking
It keeps the order in which jobs were accepted, unless a separate priority rule changes that order.
Go deeper · D1
Seeing the structures
A stack adds and removes at the same end (the top). A queue adds at the rear and removes from the front.
Stacks and queues are defined by where items can be added and removed, not by how they are stored. Both can be built inside an array, using a variable (a pointer) to remember where the top, front or rear is. In a circular queue the rear wraps round to the start of the array when it reaches the end, so the free spaces at the front can be reused.
A linked list stores each item with a pointer to the next. Inserting ‘Cal’ in order only changes two pointers.A binary tree is a list where each item has a left and a right pointer. Searching halves the remaining items at each step.
Where the data structures are used
Structure
In software
In hardware
Stack
undo in an editor; the browser Back button; the call stack that remembers where each function should return
the CPU’s stack pointer register; saving registers when an interrupt arrives
Queue
print jobs; messages waiting to be processed; players waiting to join a game
the keyboard buffer; packets waiting in a router; tasks waiting for the CPU
Array
a list of scores; the pixels of an image; a game board
memory itself is one huge array of numbered locations
List
a music playlist; a to-do list that changes often; a sorted list of names
blocks of a file on a disc chained together
Data types
Common data types
Data type
Holds
Example
Typical size
Integer
whole numbers
age = 15
2–8 bytes
Real / float
numbers with a fractional part
price = 4.99
4 or 8 bytes
Character
one character
grade = 'B'
1–4 bytes
String
a sequence of characters
name = 'Priya'
1+ byte per character
Boolean
true or false
paid = true
1 bit (often stored in a byte)
Date/time
a moment in time
2026-09-28 14:05
usually 8 bytes
Choosing the right type matters: storing a phone number as an integer would lose the leading zero and allow nonsense such as adding two phone numbers together, so it should be a string. Storing money as a float can create rounding errors, so money is often held as a whole number of pence.
Worked example: Undo with a stack
A student types ‘cat’, then makes it bold, then changes the colour. Each action is pushed onto the undo stack: [type, bold, colour] with ‘colour’ on top.
Pressing Undo pops ‘colour’ and reverses it. Pressing Undo again pops ‘bold’.
The most recent action is always undone first, which is exactly the last-in, first-out behaviour of a stack.
Key terms
Pointer
a value that holds the position (address or index) of another item.
LIFO / FIFO
last in, first out (stack) / first in, first out (queue).
Linked list
a list where each item stores a pointer to the next item.
Binary tree
a structure where each item points to up to two others, left and right.
Index
the position number of an item in an array, usually starting at 0.
Think it through
Why is a queue used for print jobs rather than a stack?
It is fair: documents print in the order they were sent. With a stack, the newest job would print first and early jobs could wait forever.
Why is finding an item in a linked list slower than in an array?
An array can jump straight to position n using the index. A linked list must follow the pointers one by one from the start.
What data type should a postcode be, and why?
A string, because it mixes letters, digits and a space, and no calculations are done with it.
When you can explain the main idea in your own words, complete the matching activity. You can return here whenever you need help.
Watch
A short revision video from the MrBrownCS series (also in the department video folder).
Watch and think:
What is the difference between an array and a record?
Your goal: Use array indices, storage order and matrix operations.
Rows, columns and dimensions
A one-dimensional array is a sequence. A two-dimensional array is a grid. Three or more dimensions can represent extra categories, such as room, day and lesson. A matrix is a rectangular grid of numbers. A two-dimensional array can store a matrix, but an array can also hold other kinds of data.
Row-major offsets with zero-based indexing. Follow the labels as you read.
Store a grid in a line
Memory is addressed as a sequence. Row-major order stores one complete row before the next. Column-major order stores one complete column before the next. For a zero-based R×C grid, row-major offset = r×C+c. Column-major offset = c×R+r. To get a byte address, multiply the element offset by bytes per element, then add the base address.
Add and multiply matrices
To add matrices, add matching positions; their dimensions must match. Matrix multiplication takes a row from the first matrix and a column from the second, multiplies matching values and adds the products. The first matrix’s column count must match the second matrix’s row count. Swapping the order can change the result.
Transpose, transform and inverse
A transpose swaps rows and columns. Matrices can transform coordinates, such as doubling x and y. For a 2×2 matrix [[a,b],[c,d]], an inverse exists only when ad−bc is not zero. An inverse reverses the transformation; it is not generally the transpose.
Worked example
For [[1,2],[3,4]] × [[2,0],[1,2]], the top-left value is 1×2+2×1=4. The full result is [[4,4],[10,8]]. In a zero-based 3×4 array, [2,1] has row-major offset 9 and column-major offset 5.
Pause and think
What is the row-major offset of [1,2] in a zero-based 3×4 grid?
Check your thinking
1×4+2=6. Offset 0 is the first element.
Go deeper · D2
Arrays of any size
An array can have any number of dimensions. A matrix is a 2D array of numbers you can calculate with.Memory is one long line, so a grid must be flattened. Languages choose row-major or column-major order.
A program can calculate where any item is stored without searching. For a grid with R rows and C columns stored in row-major order, item [row][col] is at offset row × C + col. In column-major order it is at col × R + row. Multiplying the offset by the size of each item gives the byte position. Reading memory in the order it is stored is faster, because nearby items arrive in cache together.
Calculating with matrices
Matrix multiplication. The number of columns in A must equal the number of rows in B.
Matrix operations
Operation
Rule
Used for
Addition
add the matching positions (same size matrices only)
combining totals, e.g. two shops’ monthly sales
Scalar multiplication
multiply every item by one number
a 10% price rise (× 1.1)
Multiplication
row × column, multiplied in pairs and added
revenue from quantities × prices; transforming graphics
Transpose
swap rows and columns
making the sizes match before multiplying
Inverse
the matrix that ‘undoes’ another; exists only if the determinant is not 0
solving simultaneous equations
Graphics software moves, reflects, rotates and scales shapes by multiplying each corner’s coordinates by a matrix.
Worked example: Solving simultaneous equations with a matrix
Cinema tickets: 2 adults and 1 child cost £11; 1 adult and 3 children cost £13. Let a = adult price, c = child price.
Write it as a matrix equation: [2 1 / 1 3] × [a / c] = [11 / 13].
The determinant is 2 × 3 − 1 × 1 = 5, which is not 0, so an inverse exists: (1/5) × [3 −1 / −1 2].
Your goal: Describe how data travels and how it can be protected.
Describe the channel
Simplex sends one way. Half-duplex allows both ways but takes turns. Full-duplex permits both directions together. Point-to-point joins two endpoints; multi-drop shares a channel among several. Serial sends bits one after another; parallel uses several lines. Connection choices depend on distance, interference, speed, cost and mobility.
A simplified packet has different fields. Follow the labels as you read.
Timing and packets
Synchronous transmission coordinates timing; asynchronous transmission uses framing rather than a continuously shared clock. Packet switching divides a message into pieces. Packet information can include source, destination, sequence, payload and error-checking data. Exact fields depend on the protocol. Protocols are agreed rules for format and behaviour. A receiver may need to reorder packets and deal with missing ones.
Encryption and keys
A Caesar cipher uses a fixed alphabet shift; Vigenère uses changing shifts from a key. They teach the idea of encryption but should not protect modern sensitive records. Symmetric encryption uses a shared secret. Public-key methods use a related public/private key pair and can help establish keys or prove identity. Secure use also depends on key management, trusted endpoints and suitable protocols.
Compression is a different job
Compression reduces data size. Lossless compression preserves all the original information; lossy compression removes some. It does not make data confidential. A system may compress data and then encrypt it. Choose based on bandwidth and the cost of losing detail.
Worked example
Packets numbered 1, 3, 2 can be put back into order. A sequence number helps order them, but does not keep their contents secret. Encryption has that different role.
Pause and think
Why might a live video call and a medical image use different compression choices?
Check your thinking
Live video may trade some detail for smooth delivery. A diagnostic image may need exact detail, so losing information could be unacceptable.
Go deeper · E1
Channels and connections
Channel types describe the direction of travel and how many devices share one link.Parallel sends each bit on its own wire; serial sends the bits in sequence on one wire. USB, SATA and Ethernet are all serial.Asynchronous suits occasional data such as key presses; synchronous suits continuous, high-speed streams.
Selecting a connection method
Connection
Wired or wireless
Typical speed and range
Good for
Ethernet (copper)
wired
up to 1–10 Gbit/s, about 100 m
desktop PCs, servers, reliable office networks
Fibre optic
wired (light)
10+ Gbit/s over many km
links between buildings, internet backbones
USB
wired
hundreds of Mbit/s to tens of Gbit/s, a few metres
peripherals, storage, charging
Wi-Fi
wireless (radio)
hundreds of Mbit/s, tens of metres
laptops, phones and tablets moving around a building
Bluetooth
wireless (radio)
a few Mbit/s, about 10 m
headphones, keyboards, watches
4G / 5G
wireless (mobile network)
tens to hundreds of Mbit/s, kilometres
phones and devices on the move
NFC
wireless (radio)
slow, a few centimetres
contactless payment, door passes
Packets, frames and protocols
A frame is a packet on a local network. The preamble lets the receiver lock on; the FCS lets it detect damage.Packet switching. Each router sends each packet on the best route at that moment; the receiver uses sequence numbers to rebuild the message.
The TCP/IP protocol stack
TCP/IP layer
Job
Example protocols
Application
the service the user wants
HTTP/HTTPS (web), SMTP/IMAP (email), DNS (names to addresses)
Transport
splits data into segments, numbers them, checks they all arrive
TCP (reliable), UDP (fast, no resending)
Internet
addresses packets and routes them between networks
IP
Link
moves frames across one physical network
Ethernet, Wi-Fi
A protocol is a set of rules both sides agree to follow: the speed, the packet size and format, how the connection starts (a handshake), how errors are detected and corrected, and whether data is compressed or encrypted. Without shared protocols, devices from different makers could not understand each other.
Keeping data private: encryption
A Caesar cipher replaces each letter with the one 3 places later. It is easy to understand but far too weak for real use.Public (asymmetric) key encryption solves the problem of sharing a secret key over an open network.
Two kinds of encryption
Symmetric
Public key (asymmetric)
Keys
one secret key, used to lock and unlock
a public key to lock and a private key to unlock
Speed
fast
much slower
Problem
how to share the secret key safely
slow for large amounts of data
Used for
encrypting files, discs and the main part of a secure session
setting up a secure connection and digital signatures
Key terms
Protocol
an agreed set of rules for communication.
Frame / packet
a unit of data with a header, a payload and usually an error check.
MAC address
a hardware address that identifies a network interface on a local network.
Packet switching
sending packets independently, possibly by different routes, then reassembling them.
Handshake
an exchange of signals to set up a connection and agree its rules before data is sent.
Cipher
a method of encrypting data; ciphertext is the encrypted result.
Think it through
Why does a video call use UDP rather than TCP?
Speed matters more than perfection. Waiting for a lost packet to be re-sent would freeze the call, so it is better to skip it and carry on.
Decrypt ‘FDW’ with a Caesar shift of 3.
Move each letter back 3 places: F→C, D→A, W→T, so the word is CAT.
Why does a secure website use both public key and symmetric encryption?
Public key encryption safely shares a session key without it being intercepted; symmetric encryption is then used for the rest because it is much faster.
When you can explain the main idea in your own words, complete the matching activity. You can return here whenever you need help.
From your lessons · E1
Extra detail from your teacher’s Unit 2 lessons. Practise it on the Diagram tasks page.
The Vigenère cipher
Unlike a Caesar cipher, the shift changes with every letter, so letter-frequency analysis is much harder.
To decrypt, subtract the key shifts instead of adding them. The longer and more random the key, the harder it is to break; a key as long as the message that is never reused is called a one-time pad.
Voice over IP (VoIP)
How a VoIP call works
Step
What happens
1 Digitise
the caller’s voice is sampled and converted to digital data
2 Compress
a codec compresses the audio to reduce bandwidth (quality may drop slightly)
3 Packetise
the data is split into packets with headers and sent across the internet
4 Reassemble
the receiver puts packets in order and the codec turns them back into sound
VoIP for organisations
Benefits
Drawbacks
cheap or free calls, even internationally; use any internet-connected device; video and messaging in one app
needs a reliable connection; latency, jitter and packet loss cause echo or gaps; no service in a power or internet cut; calls can be intercepted unless encrypted
Key terms
Vigenère cipher
a substitution cipher using a keyword so each letter has a different shift.
Codec
hardware or software that compresses and decompresses audio or video.
Jitter
variation in the delay between packets, causing choppy sound.
VoIP
voice over internet protocol: phone calls sent as data packets.
Think it through
Encrypt CAT with the key BB.
Shift each letter by 1 (B = 1): C→D, A→B, T→U, giving DBU.
Why does VoIP use UDP-style delivery instead of re-sending lost packets?
A re-sent packet would arrive too late to be useful in a live conversation, so a small gap is better than a delay.
Watch
A short revision video from the MrBrownCS series (also in the department video folder).
Your goal: Explain what error checks can and cannot detect.
What can go wrong?
Noise or faults can change transmitted bits. Error detection adds information that lets the receiver check whether data is likely to have changed. Detection does not always locate the changed bit or repair it.
Even parity counts the number of ones. Follow the labels as you read.
Parity counts ones
With even parity, the total number of 1 bits, including the parity bit, must be even. The payload 1011001 has four ones, so add parity bit 0. One changed bit makes the count odd. Two changed bits can leave it even, so basic parity misses some error patterns.
Other checks
A checksum is a value calculated from the data and compared at the receiver. A CRC uses a polynomial-based calculation to produce a remainder and is effective against many common transmission errors. Repetition sends data again so copies can be compared. All require extra data or work, and no simple check should be described as detecting every possible error.
Respond to the result
If the check fails, the receiver needs a correction or recovery method. Depending on the system, it might request another copy or use extra information to repair the data. That is the next step, covered in E3.
Worked example
Payload 1010110 has four ones, so even parity is 0. Flip its first bit to get 0010110: now there are three ones and the check fails. Flip its second bit too to get 0110110: there are four ones and basic parity does not notice the two changes.
Pause and think
Is a checksum the same as encryption?
Check your thinking
No. A checksum helps detect change; encryption is used to protect confidentiality. They solve different problems.
Go deeper · E2
Why errors happen
Electrical interference, weak signals (attenuation) and crosstalk between wires can turn a 0 into a 1 or a 1 into a 0.
Errors are more likely over long cables, weak wireless signals, near electrical machinery, or when many wires run side by side. Error detection adds a little extra data calculated from the message. The receiver repeats the calculation: if its answer is different, something changed on the way.
Worked example: Even parity, and where it fails
Send the 7-bit code 1100101. It has four 1s, already even, so the parity bit is 0: 0110 0101.
One bit flips to give 0110 0111: now there are five 1s, odd, so the receiver knows it is wrong.
Two bits flip to give 0110 1001: four 1s, still even, so the error is not detected.
Parity also cannot say which bit is wrong, so the byte must be sent again.
Worked example: A simple checksum
Four bytes are sent: 45, 120, 200 and 16.
Add them: 45 + 120 + 200 + 16 = 381.
Keep only what fits in one byte: 381 − 256 = 125. The checksum 125 is sent after the data.
The receiver adds the four bytes it received. If it also gets 125 the data is accepted; if not, it asks for it again.
Weakness: if two bytes were swapped, the total would be the same and the error would be missed.
A cyclic redundancy check (CRC) is a more powerful checksum based on binary division.
Error detection methods compared
Method
How it works
Detects
Extra data
Parity bit
one bit makes the number of 1s even (or odd)
any odd number of flipped bits
1 bit per byte
Checksum
sum of the data, trimmed to a fixed size
most random errors, but not reordered data
1–4 bytes per block
CRC
remainder of a binary division
almost all errors, including bursts
2–4 bytes per block
Repetition
send everything two or three times and compare
differences between the copies
doubles or triples the data
Key terms
Attenuation
a signal getting weaker as it travels further.
Crosstalk
a signal in one wire interfering with a neighbouring wire.
Parity bit
an extra bit that makes the total number of 1s even or odd.
Checksum
a value calculated from a block of data and sent with it.
CRC
cyclic redundancy check: a checksum based on binary division.
Think it through
Using odd parity, what parity bit goes with 1100110?
It has four 1s (even), so the parity bit is 1 to make five, an odd number.
Why is a CRC better than a parity bit for a 1,500-byte packet?
A parity bit only catches an odd number of flipped bits. Noise often damages several bits in a row (a burst); a CRC detects almost all bursts.
When you can explain the main idea in your own words, complete the matching activity. You can return here whenever you need help.
Watch
A short revision video from the MrBrownCS series (also in the department video folder).
Your goal: Choose a correction method using delay and bandwidth.
Ask for another copy with ARQ
Automatic repeat request (ARQ) uses checks, acknowledgements and retransmission rules. If data is damaged or an acknowledgement does not arrive in time, a sender can resend. Sequence information helps avoid confusing repeated packets with new ones. ARQ needs a suitable return path and adds delay when retries occur.
ARQ asks again while FEC sends correction information. Follow the labels as you read.
Repair using extra data with FEC
Forward error correction (FEC) sends redundancy that allows the receiver to correct some errors. Exactly how many errors it can repair depends on the code. The receiver may not need to wait for another transmission. The extra data uses bandwidth, and decoding takes work.
Choose for the situation
A file download can often wait for a retry because an exact final file matters. A live feed over a long-delay link may benefit from FEC. The choice depends on delay, error rate, bandwidth and the importance of exact data. Some systems combine both approaches.
Avoid a common mix-up
Detection tells the system that data may be wrong. Correction or retransmission provides a way to obtain the right data. A parity check alone is not the same as a full FEC code.
Worked example
If a damaged packet needs a 600 ms round trip before a replacement arrives, a live display may show a gap. FEC might repair a small error sooner, at the cost of sending extra bits in every protected block.
Pause and think
When errors are rare and waiting is acceptable, why might ARQ be suitable?
Check your thinking
Most data arrives without extra retries, and the receiver can ask again when needed. The return delay is acceptable for that task.
Go deeper · E3
Asking again: ARQ
ARQ. The receiver acknowledges good packets; if no acknowledgement arrives in time, the sender sends the packet again.
Automatic repeat request needs error detection (such as a CRC), acknowledgements (ACKs) and a timer. It sends as little extra data as possible, but each error costs a round trip. That is fine on a fast local network, but painful on a satellite link where each round trip takes over half a second.
Fixing it at the receiver: FEC
A simple FEC code. The receiver repairs each bit by majority vote without asking for anything again, at the cost of sending three times as much.
Real systems use cleverer forward error correction codes than simple repetition. A Hamming code mixes a few parity bits into the data so that the pattern of failed parity checks points to the exact bit that flipped, which can then be flipped back. The same idea lets RAID rebuild a lost disc, lets a scratched CD still play, and lets a QR code be read even when part of it is covered.
Choosing an error correction method
ARQ
FEC
Needs a return channel?
yes, for ACKs and requests
no
Extra data sent
little, except when errors happen
always some extra redundancy
Delay
each error costs a round trip
no waiting
Best when
errors are rare and replies are quick (web pages, file downloads)
replies are slow or impossible (space probes, live broadcasts, satellite links, storage media)
the time a sender waits for an ACK before sending again.
Redundancy
extra data added so errors can be detected or corrected.
Hamming code
an FEC code that uses several parity bits to locate and fix a single wrong bit.
Think it through
Why is FEC used for live TV broadcasts?
A broadcast is one-way (simplex), so viewers’ TVs cannot ask for anything to be sent again. The TV must fix errors itself.
A download over a very noisy link keeps timing out. What is happening?
Many packets are damaged, so the sender keeps waiting for ACKs and re-sending. Adding some FEC, or fixing the cause of the noise, would reduce the repeats.
When you can explain the main idea in your own words, complete the matching activity. You can return here whenever you need help.
Watch
How forward error correction repairs data.
Watch and think:
How can a receiver fix an error without asking again?
Your goal: Build truth tables and connect logic gates.
Four useful operations
AND gives 1 only when both inputs are 1. OR gives 1 when at least one input is 1. NOT reverses a value. XOR gives 1 when two inputs differ. In some notation, a dot means AND and a plus means OR. Confirm the notation and follow brackets.
Truth table for A AND NOT B. Follow the labels as you read.
Test every input combination
Two inputs have four combinations: 00, 01, 10, 11. Three inputs have eight. Add an intermediate column for each part of a longer expression. This makes errors easier to spot. For A AND NOT B, first find NOT B, then apply AND with A.
Build a circuit from an expression
For (A AND B) OR (B AND C), make two AND results and feed them into OR. B connects to both AND operations. The output is 1 for 011, 110 and 111 in A,B,C order. A wire crossing is not necessarily a connection, so show connections clearly.
Add bits with logic
A half adder adds two bits: sum = A XOR B and carry = A AND B. A full adder also accepts carry-in. Its sum is A XOR B XOR Cin. Carry-out is (A AND B) OR (Cin AND (A XOR B)). Trace all eight input combinations to check it.
Worked example
For A=1 and B=0, NOT B=1, so A AND NOT B=1. For A=1 and B=1, NOT B=0, so the result is 0.
Pause and think
What are the half-adder sum and carry for 1+1?
Check your thinking
Sum 0, carry 1. Together they represent binary 10, which is decimal 2.
Go deeper · F1
Every gate at a glance
The logic gates. A bubble on the output means NOT. NAND and NOR are ‘universal’: any circuit can be built from just one of them.
Written Boolean expressions use a dot for AND (A.B), a plus for OR (A + B), a bar over a letter for NOT (Ā) and ⊕ for XOR. You may also see ∧ for AND, ∨ for OR and ¬ for NOT. Just like in maths, brackets are worked out first, then NOT, then AND, then OR.
How a computer adds
Adders are how the ALU does arithmetic. A half adder adds two bits; a full adder also adds the carry from the column before.
Worked example: From a problem to a circuit
An alarm (Q) should sound if the door is open (D) AND the system is armed (A), OR if the panic button (P) is pressed.
Write the expression: Q = D.A + P.
Circuit: D and A go into an AND gate; its output and P go into an OR gate; the OR output drives the alarm.
Test some rows: D=1, A=0, P=0 gives 0 (door open, not armed: silent). D=1, A=1, P=0 gives 1. D=0, A=0, P=1 gives 1 (panic always works).
Turn each ‘and’ and ‘or’ in the description into a gate, then check the rows of a truth table.
Boolean laws that simplify expressions
Law
AND form
OR form
Identity
A.1 = A
A + 0 = A
Null
A.0 = 0
A + 1 = 1
Same input
A.A = A
A + A = A
Inverse
A.Ā = 0
A + Ā = 1
De Morgan
NOT(A.B) = Ā + B̄
NOT(A + B) = Ā.B̄
Simplifying with a Karnaugh map
A Karnaugh map puts neighbouring input patterns next to each other (00, 01, 11, 10), so groups of 1s show which inputs can be removed.
Key terms
Truth table
a table showing the output for every possible combination of inputs.
Universal gate
NAND or NOR: either can be combined to make every other gate.
Half adder
adds two bits: Sum = A XOR B, Carry = A AND B.
Full adder
adds two bits plus a carry in; built from two half adders and an OR gate.
Karnaugh map
a grid used to spot and remove unnecessary terms in a Boolean expression.
Think it through
How many rows does a truth table with 4 inputs have?
2⁴ = 16 rows.
Show how a NAND gate can act as a NOT gate.
Join both inputs together. If the input is 0, NAND(0, 0) = 1; if it is 1, NAND(1, 1) = 0, so the output is always the opposite of the input.
Simplify A.B + A.B̄.
Factor out A: A.(B + B̄) = A.1 = A. Whatever B is, the output equals A.
When you can explain the main idea in your own words, complete the matching activity. You can return here whenever you need help.
From your lessons · F1
Extra detail from your teacher’s Unit 2 lessons. Practise it on the Diagram tasks page.
More gates from your logic booklet
Gate
Output is 1 when…
Notes
NAND
NOT both inputs are 1
a universal gate: any circuit can be built from NAND gates alone
NOR
both inputs are 0
also universal
XOR
the inputs are different
used in half adders (sum bit) and parity checking
XNOR
the inputs are the same
equality checking
Three-state (tri-state) logic adds a third output state, high impedance, where the output is effectively disconnected. It lets many devices share one bus wire: only the device that is enabled drives the bus, and the others ‘let go’.
Think it through
Why can a NAND gate be used to make a NOT gate?
Join both inputs together: if the input is 1, NAND gives 0; if it is 0, NAND gives 1, which is NOT.
Why is XOR used for the sum bit in a half adder?
1 + 0 and 0 + 1 give sum 1, while 0 + 0 and 1 + 1 give sum 0 (with a carry), which is exactly XOR.
Watch
A short revision video from the MrBrownCS series (also in the department video folder).
Your goal: Draw and test clear flow charts and system diagrams.
Show the order of steps
A flow chart represents a process. Use a start/end symbol, a process box for an action, an input/output symbol for reading or showing data, and a decision diamond for a question. Label the decision’s outgoing arrows, normally Yes and No. Every path should end or deliberately loop back.
Validate before choosing pass or retake. Follow the labels as you read.
Show how parts connect
A system diagram has a different focus: it shows components and the movement of data between them. A library diagram might show scanner, kiosk, network and database. Label what moves along each arrow. A box named Database alone does not explain what is read or written.
Check normal and edge cases
Walk through the diagram using sample inputs. Test values on either side of a boundary, invalid values and failures where relevant. If a score must be from 0 to 100, check validity before deciding pass or retake. State what happens next after an error.
Explain a diagram in words
Describe the order and the reason for each decision. Clear labels make the diagram easier to mark and easier for another developer to use. Do not add a branch simply to fill space: every branch must represent a rule.
Worked example
For a pass mark of 50, score 49 gives RETAKE and 50 gives PASS. Score 101 is invalid, even though it is greater than 50. That is why the range check comes first.
Pause and think
Where should an invalid score go in the flow chart?
Check your thinking
To a clearly labelled error output, followed by an explicit end or a deliberate loop back for a new input.
Go deeper · F2
The symbols
Flowchart symbols. Using the standard shapes means anyone can read the chart.
A complete flowchart
A complete flowchart: one start, one end, a labelled decision and a loop that repeats until the input is valid.
Test plan for the top-up flowchart
Test type
Example value
Expected result
Normal
20
accepted; balance goes up by £20
Boundary (on the limit)
5 and 50
accepted
Boundary (just outside)
4 and 51
rejected with the message, then asked again
Erroneous
“ten” or blank
rejected with the message, then asked again
Seeing the whole system
A system (data flow) diagram shows who uses the system, what it does, where data is stored, and exactly which data moves where.
A flowchart shows the steps of one process in order. A system diagram shows the big picture: the people and other systems involved, the processes, the stored data and the data flowing between them. Label every arrow with the data it carries. If a process has data going in but nothing coming out, something is missing.
Key terms
Terminator
the rounded symbol marking the start or end of a flowchart.
Decision
a diamond with one question and labelled exits (usually Yes and No).
Iteration
a loop: steps that repeat until a condition is met.
Data store
somewhere data is kept in a system, such as a file or database table.
Boundary data
values at the edge of what is allowed, used to test the limits.
Think it through
What is wrong with a decision diamond that has three arrows coming out, none labelled?
A decision should ask one yes/no question with exactly two exits, and each exit must be labelled so the reader knows which way to go.
In the top-up flowchart, why is 50.01 a useful test value?
It is just above the upper limit, so it checks the program uses ‘50 or less’ correctly rather than accepting anything that starts with 50.
In the system diagram, what data flows would you add for a refund?
A refund request from the student or parent into a process, the refunded amount updating D1 Accounts, and a confirmation back to the person.
When you can explain the main idea in your own words, complete the matching activity. You can return here whenever you need help.
Watch
A short revision video from the MrBrownCS series (also in the department video folder).