AS Level 9618 · Paper 1 · Chapter 3

Hardware

Every computer, from a phone to a server rack, is built from the same handful of ideas: something to get data in, something to get it out, somewhere to hold it while it works, somewhere to keep it once the power is off, and a layer of logic underneath that makes every decision a circuit ever makes. This chapter covers Cambridge 9618 syllabus sections 3.1 and 3.2, the physical devices, memory technologies and logic gates that everything else in the course is eventually built on top of.

12 sections Syllabus 3.1, 3.2 6 interactive tools

Software has nothing to run on without hardware, and hardware is useless without a way to get data in, hold it, and produce something out the other side. This chapter covers Cambridge 9618 syllabus section 3.1: the core components every computer needs, the principal hardware devices you must be able to describe, buffers, embedded systems, the memory technologies (RAM, ROM, SRAM, DRAM and the ROM family), and monitoring and control systems built from sensors and actuators. It then covers section 3.2: the six logic gates, their truth tables, and how to move between a problem statement, a logic expression, a truth table and a logic circuit, since exam questions can start from any one of those four and ask for any other.

3.1

Four Things Every Computer Needs

Computers and Their Components

Strip away the branding and the operating system, and every computer, from a smartwatch to a supercomputer, is solving the same four problems. It needs a way to get data and instructions in, a way to get results out, somewhere to hold the program and data it is actively working on, and somewhere to keep everything safely once the power is switched off. Miss any one of these and you do not have a working computer, you have a component.

Input
  • Gets data and instructions into the system from the outside world
  • Examples: keyboard, mouse, microphone, touchscreen, scanner
  • Without input, a computer has nothing new to process
Output
  • Presents the results of processing back to the world
  • Examples: monitor, speakers, printer, actuators in an embedded system
  • Without output, processing produces results nobody can see or use
Primary memory
  • Holds the program and data the processor is using right now
  • Fast, but volatile, its contents are lost when power is removed
  • RAM (working data) and ROM (fixed startup instructions)
Secondary storage
  • Holds programs and data permanently, even with the power off
  • Much slower than primary memory, but far higher capacity and non-volatile
  • Fixed (an internal hard disk) or removable (a USB flash drive, an SD card)
Why the distinction between memory and storage matters
Primary memory is directly addressable by the processor, the CPU can read from and write to it in a single operation, which is what makes it fast. Secondary storage is not directly addressable in the same way, data has to be transferred into primary memory before the processor can actually work on it. This is exactly why a program has to "load" before it runs, and why running out of RAM slows a computer down far more than running out of disk space.
3.1

Hardware Devices and Their Principal Operation

Computers and Their Components

The syllabus expects you to be able to describe, in your own words, how specific hardware devices actually work internally, not just name them. Examiners reward an explanation of the physical or electronic process happening inside the device, not a one-line definition.

DevicePrincipal operation
Laser printerA rotating drum is given an electrostatic charge in the pattern of the image, using a laser to selectively discharge parts of it. Positively charged toner powder sticks only to the discharged areas of the drum, the drum then rolls over the paper transferring the toner, and a fuser unit uses heat and pressure to melt the toner permanently onto the page.
3D printerBuilds a physical object layer by layer from a digital model, typically by extruding melted plastic filament (or curing resin/sintering powder) through a nozzle that moves precisely in the X, Y and Z axes, with each layer fusing to the one below it until the full object exists.
MicrophoneA diaphragm vibrates in response to incoming sound pressure waves. That physical vibration is converted into a varying analogue electrical voltage (commonly via a magnetic coil moving in a field, or a capacitor changing its charge), which is then sampled and digitised by an analogue-to-digital converter.
SpeakersThe reverse process: a varying electrical current is passed through a coil sitting inside a permanent magnetic field. The changing current makes the coil move, which physically pushes a cone back and forth, and that cone movement creates the sound pressure waves we hear.
Magnetic hard diskData is stored as tiny regions of magnetic polarity on one or more spinning platters. A read/write head, positioned on an arm that moves across the platter, either magnetises a region in one of two directions to write a bit, or detects the existing polarity to read one.
Solid state (flash) memoryData is stored electrically, not magnetically or mechanically. Each memory cell is a floating-gate transistor that traps or releases electrons to represent a 1 or 0, and that trapped charge is retained even with no power supplied, which is what makes flash memory non-volatile with no moving parts.
Optical disc reader/writerA laser is shone onto the spinning disc's reflective surface. A reader detects the pattern of pits and lands (or, for a writer, burns marks into a dye layer) as changes in the reflected light intensity, which are then interpreted as a stream of bits.
TouchscreenMost commonly capacitive: the screen holds a uniform electrostatic field, and a finger (which conducts electricity) touching the surface distorts that field locally. Sensors around the edge of the screen measure the change in capacitance to calculate the exact X, Y coordinates of the touch.
Virtual reality headsetTwo slightly offset screens (or one split screen) render separate images for each eye to create stereoscopic depth. Motion sensors (accelerometers and gyroscopes) continuously track the exact orientation and position of the user's head, and the rendered image is updated in real time to match, creating the illusion of looking around a 3D space.
Exam technique
When asked to "describe the principal operation" of a device, name the actual physical or electronic mechanism (magnetism, laser light, electrostatic charge, floating-gate transistors) rather than describing what the device is used for. "A hard disk stores files" earns no credit; "a read/write head magnetises regions of a spinning platter to represent bits" does.
3.1

Buffers

Computers and Their Components

Different hardware devices work at wildly different speeds. A processor can produce data for a printer far faster than the printer's mechanical parts can physically print it, and a network connection can deliver a video file faster than it can be displayed if the machine briefly stalls. A buffer is a small, temporary area of memory that absorbs that speed mismatch.

Interactive tool
Watch a buffer absorb a speed mismatch
A fast producer (the CPU) is filling a buffer while a slow consumer (a printer) drains it. Press Play and watch what happens to the buffer level, and what happens if the producer gets too far ahead.

Without a buffer, the faster device would either have to sit idle waiting for the slower one (wasting processing time) or data would simply be lost the moment the slow device could not keep up. The buffer decouples the two: the fast device writes into the buffer whenever it likes, and the slow device reads from it whenever it is ready, as long as the buffer never fully empties (starving the consumer) or fully fills (forcing the producer to pause, or worse, overflow and lose data).

Common exam example
Printing is the classic buffer example: the computer sends an entire document to the printer's buffer almost instantly, freeing the CPU to move on to other tasks immediately, while the printer physically prints from its own buffer at its own, much slower, mechanical pace.
3.1

Embedded Systems

Computers and Their Components

An embedded system is a computer system built into a larger device to perform one specific, dedicated function, rather than being a general-purpose computer the user can install arbitrary software on. It has its own processor and memory, but that processor typically runs one fixed program, usually stored permanently in ROM, for the entire life of the device.

Examples
  • The engine management system in a car
  • A washing machine's control board
  • A microwave oven's timer and power controller
  • A digital camera's image processor
  • A router or a smart thermostat
Benefits vs drawbacks
  • Benefit: cheaper to produce, since hardware and software are optimised for exactly one task
  • Benefit: more reliable, a fixed program has a far smaller attack surface and fewer failure modes than general-purpose software
  • Benefit: lower power consumption, no unnecessary general-purpose hardware to run
  • Drawback: inflexible, the device cannot be repurposed and firmware updates are often difficult or impossible
  • Drawback: can be expensive and slow to redesign if the underlying requirement changes
Exam technique
The key distinguishing feature to state is dedication to a single task. A general-purpose computer (like a laptop) can run any software the user chooses to install; an embedded system runs one program, permanently, for a single specific purpose, and the user typically cannot change what it does.
3.1

RAM vs ROM

Computers and Their Components

All primary memory is fast and directly addressable by the processor, but it splits into two categories based on one crucial question: can it be written to during normal operation, and does it survive when the power is cut?

RAM, Random Access Memory
  • Can be both read from and written to during normal operation
  • Volatile, its contents are lost the instant power is removed
  • Holds the operating system, running programs and their data while in use
  • More RAM lets more programs, or larger data sets, be held ready for the processor at once
ROM, Read Only Memory
  • Can only be read during normal operation, not written to
  • Non-volatile, its contents survive with the power off
  • Holds fixed startup instructions, most importantly the bootstrap/BIOS program
  • Contents are set at manufacture (or via a special write process), never changed by ordinary use
Why a computer needs both
The moment a computer is switched on, RAM is completely empty, there is no operating system loaded yet for the processor to run. ROM solves this "chicken and egg" problem: it holds a small, permanent bootstrap program that survives being switched off, and that program's entire job is to locate the operating system on secondary storage and load it into RAM, at which point RAM takes over as the working memory for everything else.
Worked example

Q: Explain why the BIOS is stored in ROM rather than RAM.

A: ROM is non-volatile, so the BIOS survives being switched off and is immediately available the instant power is applied, with no operating system yet loaded to retrieve it from anywhere else. If the BIOS were stored in RAM, it would be erased every time the computer was switched off, and there would be no program left to run on the next start-up, leaving the computer completely unable to boot.

3.1

SRAM vs DRAM

Computers and Their Components

RAM itself comes in two different technologies that trade off speed, cost and physical size against each other, which is why a real computer usually uses both at once for different jobs.

SRAM, Static RAM
  • Stores each bit using a small circuit of transistors (a flip-flop), no capacitor involved
  • Holds its data reliably as long as power is supplied, no refreshing needed
  • Very fast, but needs six or more transistors per bit, making it physically larger and expensive per byte
  • Used where speed matters more than capacity: cache memory inside or near the processor
DRAM, Dynamic RAM
  • Stores each bit as a tiny electrical charge in a single capacitor plus one transistor
  • That charge leaks away within milliseconds, so it must be constantly refreshed (rewritten) thousands of times a second
  • Simpler per-bit design means far higher density and much lower cost per byte, but slower than SRAM and it uses power just to refresh itself
  • Used where capacity matters more than raw speed: main system RAM
Exam technique: justifying the choice
Always connect the technology's physical property to the consequence asked about. Justify SRAM for cache by its speed, since the processor would otherwise stall waiting for data, cost and size being an acceptable trade-off because cache only needs to be small. Justify DRAM for main memory by its low cost and high density per byte, since several gigabytes of SRAM would be prohibitively expensive and physically far too large to fit.
3.1

PROM, EPROM and EEPROM

Computers and Their Components

Plain ROM is programmed permanently at the factory and can never be changed again. That is fine for some applications, but manufacturers, and sometimes end users, often need ROM that can be written to at least once outside the factory, or even rewritten many times. Three variants exist, each loosening that restriction a little further.

TypeCan be writtenHow it is erasedTypical use
PROM
Programmable ROM
Once, after manufacture, using a special PROM programmer deviceCannot be erased, once written the contents are permanentLow-volume custom firmware where mass-manufacturing a masked ROM is not cost effective
EPROM
Erasable Programmable ROM
Many times, using a PROM programmerThe entire chip is erased at once by exposing it to strong ultraviolet light through a small quartz windowDevelopment and prototyping, where firmware needs to be tested and revised before final production
EEPROM
Electrically Erasable Programmable ROM
Many times, in-circuit, without special equipmentErased electrically, and individual bytes (or blocks) can be erased and rewritten without erasing the whole chipFirmware and settings that need updating in the field, e.g. router firmware, BIOS updates; modern flash memory is a form of EEPROM
The pattern to remember
Each step trades away permanence for convenience: PROM can be written once outside the factory but never erased. EPROM can be rewritten, but only by physically removing the chip and shining UV light on it, an all-or-nothing bulk erase. EEPROM can be rewritten in place, electrically, byte by byte, which is exactly why it evolved into the flash memory used in USB drives and SSDs today.
3.1

Monitoring and Control Systems

Computers and Their Components

Sensors let a computer perceive the physical world, converting a real-world physical quantity into an electrical signal it can read. What the computer does with that reading is what separates a monitoring system from a control system.

Monitoring system
  • Sensor readings are recorded, displayed, or used to trigger an alarm
  • The computer does not alter the physical process being observed
  • Example: a weather station logging temperature and rainfall
Control system
  • Sensor readings are used to automatically adjust an actuator and change the physical process
  • The computer directly influences the real world based on what it senses
  • Example: a central heating system switching a boiler on and off to maintain temperature

Common sensor types you should recognise: temperature (thermistors, resistance changes with heat), pressure (used in touchpads, weather stations, alarm mats), infra-red (motion detection, proximity, remote controls), and sound (microphones detecting amplitude/frequency).

Feedback: why control systems need to keep sensing

A control system rarely acts just once. After an actuator changes the physical environment, that change itself needs to be measured again, so the system can check whether it has reached its target and correct further if not. This continuous loop, sense, decide, act, sense again, is called feedback, and it is what makes control systems self-correcting rather than a single blind command.

Interactive tool
A central heating feedback loop, step by step
Watch a thermostat sense, decide and act in a continuous loop until room temperature reaches its target.
SENSORReads current temperature
→
MICROPROCESSORCompares to target, decides
→
ACTUATORBoiler switches on/off
Target: 21°C. Current: 17°C. Press play to start the feedback loop.
Exam technique
When explaining "the importance of feedback", always describe the full loop and why a single action is not enough: the actuator changes the environment, the sensor detects the new state, and the microprocessor compares it against the target value again, repeating the cycle until the target is met, and continuing to monitor afterwards in case conditions drift again. A one-shot system with no feedback cannot correct for overshoot, undershoot, or later changes in the environment.
3.2

The Six Logic Gates

Logic Gates and Logic Circuits

Every decision a digital circuit makes, no matter how complex, is built from combinations of just six basic logic gates. Each gate takes one or two binary inputs and produces exactly one binary output, according to a fixed rule. The syllabus requires you to know the standard symbol, the function, and the complete truth table for all six.

Interactive tool
Toggle the inputs, watch the gate decide
Choose a gate, then click the input toggles to set A (and B) to 0 or 1. The output updates live, and the matching row in the truth table below is highlighted.
A
B
0
Output
Output = NOT A

Definitions worth learning exactly

Single input
  • NOT, output is the opposite (inverse) of the single input
Two inputs, "positive" logic
  • AND, output is 1 only if both A and B are 1
  • OR, output is 1 if A or B (or both) is 1
  • XOR, output is 1 if A and B are different (exclusive or)
Two inputs, inverted (NOT + basic gate)
  • NAND, the inverse of AND, output is 0 only when both inputs are 1
  • NOR, the inverse of OR, output is 1 only when both inputs are 0
Exam technique
The small bubble (a small circle) drawn on a gate's output line always means "invert this". Notice that NAND is exactly an AND gate with a bubble added, and NOR is exactly an OR gate with a bubble added, learning AND and OR properly means NAND and NOR follow automatically, just flip every output in the truth table.
3.2

Truth Tables for Combined Gates

Logic Gates and Logic Circuits

A truth table lists every possible combination of inputs, and the output produced for each one. With one input there are 2 possible combinations, with two inputs there are 4, and in general, n inputs produce 2n rows, since each input can independently be either 0 or 1.

2
rows for 1 input
4
rows for 2 inputs
8
rows for 3 inputs
16
rows for 4 inputs

When a logic expression combines several gates, build the truth table one gate at a time, left to right, adding one working column per gate, rather than trying to work out the final output directly. This is exactly how examiners expect method marks to be shown.

Worked example, step by step

Build the truth table for Q = (A AND B) OR NOT C, a three-input expression.

Interactive tool
Click through each step to reveal one working column at a time, exactly as you should show your working in an exam.
Press "Reveal next column" to begin with A, B and C.
Reading the table off correctly
Once the full table is built, the final column, the one for the overall expression, is the only one that answers the question. The intermediate columns (like "A AND B" above) exist purely to help you calculate it correctly and to show method, but examiners want the last column identified clearly as the answer.
3.2

Building Circuits from Expressions and Problems

Logic Gates and Logic Circuits

The syllabus asks you to move freely between four different representations of the same logic: a written problem statement, a logic expression, a truth table, and a logic circuit diagram. An exam question can start from any one of these and ask for any other, so the real skill is not memorising one direction, it is being comfortable converting between all four.

Problem statement → expression
  • Find the key words: "and", "or", "not", "unless", "only if"
  • Translate each condition into AND / OR / NOT directly
  • Watch for hidden negation: "unless the door is open" means NOT door_open
Expression → circuit
  • Work from the innermost brackets outward
  • Each bracketed sub-expression becomes one gate with its own labelled output wire
  • Feed those intermediate outputs into the next gate, exactly as brackets nest

The worked example below builds the full picture for Q = (A AND B) OR NOT C, the same expression from the truth table above, so you can see the expression, the circuit and the truth table all agree with each other.

Interactive tool
Trace the signal through a two-gate circuit
Toggle A, B and C, then press Play to watch the signal propagate through the AND gate and the NOT gate into the final OR gate.
Worked example: problem statement to expression

Problem: A warning light should turn on if the engine is running and the oil pressure sensor reads low, or if the temperature sensor is not reporting a safe value.

Step 1, identify the variables: let R = engine running, P = oil pressure low, S = temperature safe.

Step 2, translate the key words directly: "engine running and oil pressure low" becomes (R AND P). "not reporting a safe value" becomes NOT S. The word "or" joins the two conditions.

Step 3, combine: Warning = (R AND P) OR NOT S, the exact same shape of expression as the circuit above.

Exam technique: constructing circuit diagrams
Always label every intermediate output wire (for example, call the AND gate's output "p" and the NOT gate's output "q") rather than leaving wires unlabelled. This lets the examiner follow your logic even if the final gate is slightly wrong, and it makes your own checking far easier, since you can verify each gate's output against the truth table one column at a time.
3.1, 3.2

Practice Questions

Hardware
2 marks
Q1. State two differences between primary memory and secondary storage.
Answer

Primary memory is directly addressable by the processor and much faster; secondary storage is not directly addressable and is much slower. Primary memory (RAM) is typically volatile and loses its contents when powered off; secondary storage is non-volatile and retains data with the power off. Primary memory has far lower capacity than typical secondary storage devices.

3 marks
Q2. Explain why a computer's main memory typically uses DRAM rather than SRAM, even though SRAM is faster.
Answer

DRAM stores each bit using a single transistor and capacitor, making it far cheaper and denser per byte than SRAM, which needs several transistors per bit. Main memory needs a large capacity, several gigabytes, which would be prohibitively expensive and physically too large to build from SRAM. SRAM's extra speed is instead reserved for cache, which only needs to be small.

2 marks
Q3. Explain the purpose of a buffer when a computer sends a document to a printer.
Answer

A buffer is an area of temporary memory that holds the document while the much slower printer prints it. This lets the CPU send the whole document almost instantly and move on to other tasks, instead of sitting idle waiting for the mechanically slow printer to keep pace.

4 marks
Q4. A greenhouse uses a computer system to keep its temperature within a safe range for the plants inside by automatically opening and closing a roof vent. Explain, using the idea of feedback, how this control system works.
Answer

A temperature sensor continuously measures the current temperature inside the greenhouse and sends the reading to the microprocessor. The microprocessor compares this reading against the target temperature range and decides whether to open or close the vent (the actuator) to bring the temperature back within range. Once the actuator has acted, the sensor takes a new reading and the cycle repeats, this continuous loop of sensing, deciding and acting is the feedback that lets the system keep correcting itself as conditions change, rather than acting only once.

3 marks
Q5. Draw the truth table for the NAND gate, and explain how it relates to the AND gate.
Answer

A=0,B=0: output 1. A=0,B=1: output 1. A=1,B=0: output 1. A=1,B=1: output 0. NAND is the AND gate with its output inverted, its output is 0 only in the one case (both inputs 1) where AND would output 1, and 1 in every case where AND would output 0.

4 marks
Q6. A system should output 1 only when exactly one of two switches, A and B, is pressed (not both, and not neither). Write the logic expression for this system, name the gate that implements it directly, and explain why AND and OR alone cannot do this.
Answer

The expression is Q = A XOR B, implemented directly by a single XOR gate. AND alone cannot do this because it only outputs 1 when both A and B are 1, missing the case where only one is pressed. OR alone cannot do this because it outputs 1 when both are pressed as well as when only one is, it does not exclude the "both" case the way XOR does.

Stop wrestling with confusion.
Join thousands of students mastering Computer Science without the academic jargon.
Explore all AS Level notes

Stop wrestling with confusion.

Join thousands of students mastering Computer Science without the academic jargon.

From syntax to systems. We break down the hardest ideas in computer science so you can actually build things.

© 2026 Painless Programming. Built for students.
Scroll to Top
Enable Notifications OK No thanks