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.
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.
Four Things Every Computer Needs
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.
- 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
- 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
- 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)
- 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)
Hardware Devices and Their Principal Operation
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.
| Device | Principal operation |
|---|---|
| Laser printer | A 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 printer | Builds 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. |
| Microphone | A 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. |
| Speakers | The 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 disk | Data 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) memory | Data 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/writer | A 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. |
| Touchscreen | Most 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 headset | Two 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. |
Buffers
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.
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).
Embedded Systems
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.
- 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
- 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
RAM vs ROM
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?
- 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
- 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
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.
SRAM vs DRAM
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.
- 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
- 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
PROM, EPROM and EEPROM
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.
| Type | Can be written | How it is erased | Typical use |
|---|---|---|---|
| PROM Programmable ROM | Once, after manufacture, using a special PROM programmer device | Cannot be erased, once written the contents are permanent | Low-volume custom firmware where mass-manufacturing a masked ROM is not cost effective |
| EPROM Erasable Programmable ROM | Many times, using a PROM programmer | The entire chip is erased at once by exposing it to strong ultraviolet light through a small quartz window | Development and prototyping, where firmware needs to be tested and revised before final production |
| EEPROM Electrically Erasable Programmable ROM | Many times, in-circuit, without special equipment | Erased electrically, and individual bytes (or blocks) can be erased and rewritten without erasing the whole chip | Firmware and settings that need updating in the field, e.g. router firmware, BIOS updates; modern flash memory is a form of EEPROM |
Monitoring and Control Systems
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.
- 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
- 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.
The Six Logic Gates
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.
Definitions worth learning exactly
- NOT, output is the opposite (inverse) of the single input
- 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)
- 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
Truth Tables for Combined Gates
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.
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.
Build the truth table for Q = (A AND B) OR NOT C, a three-input expression.
Building Circuits from Expressions and Problems
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.
- 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
- 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.
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.
Practice Questions
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.
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.
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.
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.
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.
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.
