🎯 Syllabus & Goals 3 min
Cambridge 7.2 · Computer systems, sub-systems and decomposition Paper 2 · Algorithms, Programming and Logic
By the end of this lesson you can:
- Explain that every computer system is made of sub-systems, and describe top-down design.
- Decompose a problem into its inputs, processes, outputs and storage.
- Draw a structure diagram for a given system.
Textbook: Chapter 7, §7.2–7.2.3 (pp. 260–262)
Recap / Warm-Up 5 min
Last lesson: the life cycle is analysis → design → coding → testing, and decomposition happens in analysis. Today we decompose properly and draw the result.
Quick starter
Is "decomposition" the same as "abstraction"? Answer in one sentence.
Reveal the answer
No. Decomposition breaks a problem into smaller parts; abstraction removes details that are not needed.
🧠 Key Concept 14 min
1 · Systems inside systems
A computer system is made up of software, data, hardware, communications and people. Every computer system can be split into sub-systems. Each sub-system can be split again, until each one performs just a single action.
2 · Top-down design and stepwise refinement
The process of breaking down, level by level, is called stepwise refinement. Each final sub-system can be written as a sub-routine, and its steps shown as a flowchart or pseudocode.
Why developers use it
- each part is a smaller, more manageable problem
- several programmers can build and test different sub-systems at the same time
- this reduces development and testing time
Where it fits
- it is decomposition, so it starts in analysis
- the structure diagram it produces is a design tool
- works for small and very large systems
3 · The four component parts of any system
Any problem solved by a computer can be decomposed into four component parts:
4 · Structure diagrams
A structure diagram shows top-down design as a picture. It is hierarchical: the system is at the top and each level below gives a more detailed breakdown.
Worked Example 12 min
Worked example 1 · Decompose a smart thermostat
A smart thermostat keeps a home at the temperature the owner sets. The owner can set a schedule on a phone app. Decompose it into its four component parts.
- Inputs — what is entered while it runs? The target temperature, a schedule, a boost button press, and the room temperature read by a sensor.a sensor reading is also data entering the system while it is active.
- Processes — what has to be worked out? Compare room and target temperature; decide to switch heating on or off; check the time against the schedule.
- Outputs — what does the user or device receive? The display showing current and target temperature; the on/off signal to the boiler; a phone notification.
- Storage — what must be kept for later? The weekly schedule and the owner's preferred temperatures.the schedule must survive a power cut, so it is stored, not just input.
| Component | Smart thermostat |
|---|---|
| Inputs | target temperature, schedule, boost press, room temperature |
| Processes | compare temperatures, decide heating on/off, check schedule times |
| Outputs | temperatures on display, signal to boiler, phone alert |
| Storage | weekly schedule, preferred temperatures |
Worked example 2 · A structure diagram for a library loans system
A school library system must manage members, lend books and take books back. Build the diagram level by level.
- Level 0 — name the whole system in one box: Library loans.
- Level 1 — the main jobs. Manage members, Lend a book, Return a book.each is a separate job a different programmer could build.
- Level 2 — refine each job until each box is a single action. For example, Return a book → Scan book, Work out any fine, Update record.stop refining when a box does one thing — that box becomes one sub-routine.
Try It Yourself 12 min
Goal: For a supermarket self-checkout, label each item as input, process, output or storage: barcode scanned · price list · total calculated · receipt printed · item weight on the scale.
Goal: Draw a two-level structure diagram for a phone alarm app with three main sub-systems: set the alarm, check the time and sound the alarm. Give each at least two sub-systems.
Goal: Take the "Check the time" box from your alarm diagram and refine it one more level. Then explain why a team of three programmers would finish sooner using your diagram.
Hint
Checking the time needs: get the current time, compare it with each alarm set, and decide whether to wait again. For the team: think about who builds which box, and when.
📝 Exam Practice 10 min
A solution to a problem is decomposed into its component parts. Name and describe each of the four component parts.
Mark scheme
- Inputs (1) — the data entered into the system while it is active (1).
- Processes (1) — the tasks performed using the input data and any stored data (1).
- Outputs (1) — information displayed or printed for the users (1).
- Storage (1) — data stored in files on a suitable medium for future use (1).
Explain why top-down design is used when developing a large computer system.
Mark scheme
- The system is broken into smaller sub-systems / more manageable problems (1)…
- …each sub-system is easier to design, code and test (1).
- Several programmers can work on different sub-systems at the same time (1)…
- …so development and testing time is reduced (1).
- Max 3.
An online food-ordering system lets customers choose meals, pay, and track their delivery. Draw a structure diagram for this system with two levels below the top box.
Mark scheme
- Top box named for the whole system, e.g. Food ordering (1).
- Three level-1 sub-systems: choose meals, pay, track delivery (1).
- At least two sensible sub-systems under one level-1 box, e.g. Pay → enter card details, confirm payment (1).
- Correct hierarchical layout joined by lines, each level more detailed (1).
For a car-park barrier system, identify whether each is an input, process, output or storage: (a) the number plate read by a camera, (b) a list of season-ticket holders, (c) the barrier being raised.
Mark scheme
- (a) Input (1)
- (b) Storage (1)
- (c) Output (1)
🗝️ Recap & Key Terms 3 min
Every computer system is built from sub-systems. Top-down design breaks it down, level by level, until each part does one action. Any problem decomposes into inputs, processes, outputs and storage. A structure diagram shows the breakdown as a hierarchy.
- Sub-system
- A part of a computer system that can itself be divided into smaller sub-systems.
- Top-down design
- Breaking a system into sub-systems, then each of those into smaller ones, until each performs a single action.
- Inputs
- The data used by the system that is entered while the system is active.
- Processes
- The tasks performed using the input data and any previously stored data.
- Outputs
- Information displayed or printed for the users of the system.
- Storage
- Data stored in files on an appropriate medium for use in the future.
- Structure diagram
- A hierarchical diagram showing a system broken into sub-systems, each level giving more detail.
Homework 1 min
Task (≤ 15 min): A drinks vending machine takes coins, lets the user choose a drink, gives change and records how many of each drink are left. (a) Decompose it into inputs, processes, outputs and storage. [4] (b) Draw a structure diagram with at least two levels. [3]
Model answer
- Inputs: coins inserted, drink selection button.
- Processes: total the money, check it covers the price, work out change, reduce stock count.
- Outputs: the drink, the change, messages on the display.
- Storage: price list, number of each drink left.
- Structure diagram: Vending machine → Take payment (accept coins, total money) · Choose drink (read button, check stock) · Deliver (drop drink, give change, update stock).