← O Level

CS · Topic 3

Section 1 · Chapter 3 · IGCSE & O Level Computer Science

Hardware 🖥️

Crack the case open. Spin a motherboard in 3D, watch a program run through the CPU one register at a time, and see how drives, screens, printers and sensors actually work.

🕶️ with Guru Jazzy

🎯 What you'll unlock this chapter

  • 🧠 CPU · von Neumann architecture, registers, buses, fetch–decode–execute
  • ⚡ Performance · clock speed, cache, cores, bus width · instruction sets · embedded systems
  • ⌨️ Input, output and sensors · how each device works · monitoring vs control
  • 💾 Storage · RAM and ROM · magnetic, optical, solid-state · virtual memory · cloud
  • 🌐 Network hardware · NICs, MAC and IP addresses, routers
  • 🧊 4 interactive 3D models · all 8 activities · every worked example · 72 book figures (tap to enlarge)

🧊 3D · Inside the computer

Drag to spin, scroll or pinch to zoom. Tap any part (or use the buttons) to find out what it does. The glowing dots are data travelling along the buses.

Tap a part to learn about it.

🧠 The CPU 3.1.1

  • 📛 Also called the processor or microprocessor
  • ⚙️ Executes every instruction and processes all data — in PCs, tablets and phones
  • 🔲 Usually one integrated circuit on a single chip
  • 🧩 Made of: control unit (CU) · ALU · registers · buses

🏛️ Von Neumann architecture 3.1.2

Stored program computer — described by John von Neumann in the mid-1940s. Every modern computer is based on it. Key ideas:

  • 🧠 A CPU that accesses memory directly
  • 💾 Memory stores programs and data together
  • 📜 Instructions are executed in sequence
Fig 3.1 Von Neumann architecture

ALU vs control unit

ALUControl unit (CU)
JobArithmetic (+, −, shifts) and logic (AND, OR)Reads each instruction; runs the fetch–decode–execute cycle
Key detail× and ÷ done with additions, subtractions and shiftsSends signals on the control bus; timed by the system clock
How manyA computer can have more than oneOne per core
RAM = immediate access store (IAS) — holds the programs and data the CPU needs right now, copied in from backing store because RAM is far faster.

Special-purpose registers

RegisterWhat it holds
PC · program counterAddress of the next instruction to fetch
MAR · memory address registerAddress being read from or written to
MDR · memory data registerData just read from, or about to be written to, memory
CIR · current instruction registerInstruction being decoded and executed
ACC · accumulatorTemporary data during ALU calculations

Reading vs writing memory

Step📖 Read✍️ Write
1Address → MARData → MDR
2Read signal sent to memoryAddress → MAR
3Contents of that address → MDRWrite signal sent; data stored at that address

🚌 System buses 3.1.2

  • 🧵 Buses are parallel — one wire per bit
  • 🔗 Three buses link the CPU, memory and I/O devices
Fig 3.2 System buses and memory
BusCarriesDirection
Address busMemory addressesUnidirectional (CPU → memory)
Data busData — an instruction, an address or a valueBidirectional
Control busControl and timing signals from the CU (usually 8 bits)Bidirectional

Why bus width matters

BusWider means…Example
Address busMore memory locations can be addressed16 bits → 2¹⁶ = 65 536 · 32 bits → 4 294 967 296
Data busA longer word moves in one go → better performance16, 32 or 64-bit words

🔄 The fetch–decode–execute cycle 3.1.2

  1. Fetch · PC → MAR (address bus)
  2. Instruction at that address → MDR (data bus)
  3. MDR → CIR
  4. PC + 1 — now points at the next instruction
  5. Decode · CU decodes the instruction in the CIR
  6. Execute · signals on the control bus to the right components · repeat
Fig 3.3 Fetch–decode–execute cycle flowchart

🧊 3D · Watch a program run

Memory holds a tiny program: LDA 5 (load), ADD 6, STO 7 (store), END. Step through it and watch every value fly between the registers and RAM — yellow on the address bus, green on the data bus, pink on the control bus.

FetchDecodeExecute

Ready

⚡ Cores, cache and the clock 3.1.3

FactorWhat it isEffect on performance
⏱️ Clock speedClock cycles per second that sync every operation (3.5 GHz = 3.5 billion/s)Faster → more instructions/s, but not a guarantee of better overall performance
🚌 Bus widthNumber of wires in the address and data busesWider → more memory, bigger words per transfer
⚡ CacheVery fast memory inside the CPU for frequently used data and instructionsChecked before RAM · bigger cache → faster
🧩 CoresEach core = own ALU, CU and registers (dual = 2, quad = 4)More cores help, but 2× cores ≠ 2× speed
🔥 Overclocking (changing the clock in the BIOS)
  • • Instructions can run out of sync → crashes, instability
  • • The CPU overheats

Why doubling cores doesn't double speed

  • 🔗 Cores must communicate with each other and the CPU
  • 📈 Channels grow fast: 2 cores → 1 channel · 4 cores → 6 channels
Fig 3.4 Dual core — 1 channel between 2 cores
Fig 3.5 Quad core — 6 channels between 4 cores

📖 Instruction sets 3.1.4

Part of an instructionMeaning
OpcodeWhat operation to do (e.g. ADD, JMP, LDA)
OperandThe data to act on — or an address / register
  • 📚 Instruction set = the limited list of opcodes a CPU understands
  • 💻 X86 — common set; Intel and AMD chips differ inside but share almost the same X86 set
⚠️ Don't mix them up — an instruction set isn't program code. High-level programs need a compiler or interpreter to become CPU instructions.

🔌 Embedded systems 3.1.5

  • 🎯 Hardware + software built for a specific set of tasks
  • 📥 Inputs: an operator (keypad, dial) or sensors
  • 📤 Outputs: actuators and other components
  • 🔄 Updates: plug into a computer (e.g. car GPS maps) or automatically over Wi-Fi, satellite or mobile
Fig 3.6 Embedded systems

What it's built on

MicrocontrollerMicroprocessorSystem on chip (SoC)
CPU + RAM + ROM + peripherals on one chipOnly a CPU — RAM, ROM, peripherals added separatelyCPU, memory, I/O ports and storage on one chip (may include a microcontroller)

Benefits vs drawbacks

✅ Benefits⚠️ Drawbacks
Small — fit easily into devicesHard to upgrade
Cheap to make; mass production → reliableTroubleshooting needs a specialist
One task → simple interface, often no OS"Simple" interfaces can still confuse (cooker clocks!)
Can be controlled remotely (e.g. from a phone)Internet-connected → open to hackers and viruses
React fast to changing inputs (real time)Often thrown away, not repaired — "throw-away society"

Examples

  • 🚗 Cars — engine management, ABS, airbags, GPS, security
  • 📺 Set-top boxes · security alarms · smart lighting
  • 🥤 Vending machines — in: keypad, coin, temperature and tilt sensors · out: motors, cooling, LCD
  • 🧺 White goods — washing machines, fridges, cookers
  • 🚫 A general-purpose computer is not embedded — it's multi-functional
Fig 3.7 Embedded systems in a car
Fig 3.8 Embedded system in a set-top box
Fig 3.9 Embedded system in a security system
Fig 3.10 Smart LED light bulb
Fig 3.11 Embedded system in a vending machine
Fig 3.12 Helix in a vending machine

▮▯▮ Barcodes 3.2.1

  • ▮ A series of dark and light bars
  • 7️⃣ Each digit = 7 modules wide · 2 dark + 2 light bars
  • 🚧 Guard bars mark the start, middle and end
Left-hand digitsRight-hand digits
Starts withLight barDark bar
Dark modulesOdd numberEven number
WhyThe scanner can tell left from right → barcode reads either way round
Fig 3.13 Guard bars
Fig 3.14 Sample barcode

How it's read

  1. A red laser or LED shines on the barcode
  2. Dark bars reflect little light, light bars reflect a lot
  3. Photoelectric cells read the reflected light
  4. Pattern → binary · left-hand "3" = L D D D D L D → 0111101 (L = 0, D = 1)
Fig 3.15 Barcode digit patterns
Fig 3.16 Barcode section for 5 4 3 0 5 2

At the supermarket checkout

  1. Barcode number = key field in the stock database
  2. Price sent to the till
  3. Stock count − 1
  4. At the re-order level → new stock ordered automatically
  5. A flag is set so it isn't re-ordered on every scan

🎮 Barcode Builder

Type an even number of digits (up to 12). The first half uses left-hand patterns, the second half right-hand patterns.

🔳 QR codes 3.2.1

  • 🔳 Quick response code — a grid of dark and light squares (pixels)
  • 📐 3 large corner squares = alignment · small square = checks size and angle
  • 📱 Scan with a phone camera + app → opens the website, phone number or boarding pass
  • 🖼️ Frame QR codes add a "canvas" for logos — software usually isn't free
Fig 3.17 Sample QR code
Fig 3.18 QR code on a boarding pass
Fig 3.19 Frame QR code

QR code vs barcode

QR codeBarcode
CapacityUp to 4296 characters (7089 digits), incl. URLsAbout 30 digits
ErrorsFewer — built-in error checkingMore
ReaderAny phone cameraLaser / LED scanner
SharingEasy to send as text or image; can be encryptedPrinted labels
⚠️ RisksSeveral formats · can carry malicious code (attagging) → fake sites, malware—

📷 Digital cameras 3.2.1

  • 🤖 An embedded system controls shutter speed, focus, flash, aperture, image size, red-eye removal
  1. Light through the lens hits a CCD — millions of photodiodes, one per pixel
  2. Each photodiode turns light into electric charge
  3. An ADC converts charge → brightness level (8 bits → 256 levels)
  4. Colour stored too — usually 24-bit RGB
More pixels → more detail → bigger file.
Fig 3.20 Digital camera
Fig 3.21 Pixel brightness and colour values
Fig 3.22 How a digital camera works

⌨️ Keyboards, microphones and mice 3.2.1

Keyboard

  1. Key press completes a circuit in the membrane
  2. CPU works out which key, looks it up in an index file
  3. Gets its ASCII value
  • ⚠️ Slow and error-prone · heavy use → RSI · ergonomic keyboards help
Fig 3.23 Keyboard
Fig 3.24 Ergonomic keyboard
Fig 3.25 How a keyboard works

Microphone

  1. Sound vibrates the diaphragm
  2. Attached copper coil moves in a magnetic field
  3. → an analogue electric current is induced
  4. Sound card's ADC → digital values
Fig 3.26 How a microphone works
Fig 3.27 Analogue to digital conversion

Optical mouse

  1. Red LED bounces light off the surface
  2. CMOS sensor takes ~1500 images a second
  3. Digital signal processor compares images → movement
  4. Coordinates sent to the computer
  • ✅ No moving parts → more reliable · dirt can't get in · no special surface
  • 🔌 Wired mice: no signal loss, no batteries
Fig 3.28 Optical mouse

2D vs 3D scanners

2D scanner3D scanner
CapturesA flat image of a pagex, y and z coordinates of a solid object
HowBright light → moving scan head → mirrors + lens → CCDLasers, light or X-rays; CT scanners stack thin 2D "slices" (tomography)
Used forOCR (text → editable) · passports at airports + face recognitionCAD · 3D printing · medical imaging
Fig 3.29 How a 2D scanner works
Fig 3.30 Face recognition key points
Fig 3.31 Tomography (CT scanning)

👆 Touch screens 3.2.1

CapacitiveInfraredResistive
How it worksConductive layer under glass · finger changes the electrostatic field · surface: corner sensors · projective: X–Y gridGrid of IR beams from edge transmitters · finger breaks beams · microcontroller finds the crossingTwo resistive layers with a gap · press → layers touch → voltage change gives position
✅ ProsClear in sunlight · durable, scratch-resistant · projective = multi-touch, thin glovesMulti-touch · durable · works if scratched or crackedDust and water resistant · finger, stylus or glove
⚠️ ConsSurface type: bare finger / special stylus only · electromagnetic interferenceWater / moisture · accidental touches · light interferenceLow sensitivity · no multi-touch · poor in sunlight · scratches easily
Fig 3.32 Capacitive touch screen
Fig 3.33 Infrared transmitters and sensors around the screen
Fig 3.34 Touched infrared screen — blocked beams
Fig 3.35 Resistive touch screen

🎮 Infrared Touch Screen

Tap or click anywhere on the "screen". Your finger blocks some of the infrared beams, and the microcontroller finds where the blocked beams cross.

Waiting for a touch…

🧊 3D · Output devices

Watch a 3D printer build an object layer by layer, a DLP chip's micromirrors make a picture, and a loudspeaker turn current into sound.

⚙️ Actuators 3.2.2

  • 🦾 Used when a computer controls something physical (conveyor belt, valve)
  • ⚙️ Mechanical / electromechanical: relay, solenoid, motor
  • 🧲 Solenoid = coil · current → magnet → pulls a plunger (straight-line motion; rotary solenoids turn)
Fig 3.36 A solenoid

📽️ Projectors 3.2.2

DLP (digital light projector)LCD projector
Key partDMD chip — millions of micromirrors, one per pixelThree LCD screens (R, G, B)
HowMirror tilted to light = ON, away = OFF · flipping fast → ~1024 greys · colour filter → 16 million+ coloursDichroic mirrors split white light → each colour through its LCD → prism recombines → lens
✅ ProsHigher contrast · longer life · quieter · one chip (no alignment issues) · smaller, lighter · better in dust/smokeBetter colour saturation · more energy-efficient → less heat
⚠️ Cons"Shadows" on moving images · weaker colour saturationLower contrast · shorter life — panels yellow and degrade
Fig 3.37 Digital light projector (DLP)
Fig 3.38 LCD projector

🖨️ Printers 3.2.2

Inkjet vs laser

InkjetLaser
Prints withLiquid ink dropletsDry powder toner + static electricity
PrintsLine by line (head moves side to side)A whole page at a time
Key partsPrint head + nozzles · stepper motor and beltCharged drum · laser · fuser · discharge lamp
Droplets / imageThermal bubble (heated resistor) or piezoelectric (vibrating crystal)Laser removes charge → toner sticks to those areas
Best forOne-off photos · a few pages of good colourHigh volume · fast · big toner and paper trays
Fig 3.39 Inkjet printer
Fig 3.40 Laser printer
StepInkjetLaser
1–4Data → printer driver → printer format · checks printer is free (busy / offline / out of ink) · data stored in the printer buffer
5Sheet fed in; sensor checks for paper (error if empty / jammed)Drum given a positive charge; laser removes charge → negative image of the page
6Head moves side to side spraying 4 inksPositive toner sticks only to negative areas
7Paper advances after each pass until the page is doneNegatively charged paper rolls over the drum…
8More data in buffer? → repeat from step 5…toner transfers to the paper
9Buffer empty → interrupt to CPU for more dataPaper's charge removed so it doesn't stick
10—Fuser (heated rollers) melts toner onto paper
11—Discharge lamp clears the drum

🧱 3D printers 3.2.2

  • 🧱 Build solid objects layer by layer (often 0.1 mm)
  • 🧪 Materials: powdered resin, metal, paper, ceramic · newer: liquid polymer hardened by laser / UV
Additive (3D printing)Subtractive (carving, CNC)
Builds the object up by adding layersRemoves material from a block
Direct 3D printingBinder 3D printing
Inkjet technology · head also moves up and downTwo passes per layer: dry powder, then a binder (glue)
  1. Design in CAD (or scan with a 3D scanner)
  2. Software converts it to a printer format
  3. Printer set up
  4. Built layer by layer — can take hours
  5. Removed and finished (wash supports, remove powder, cure)
Fig 3.41 Typical 3D printer
Fig 3.42 Alloy wheel made by a 3D printer
Fig 3.43 Making an object with a 3D printer

Uses

  • 🦿 Prosthetic limbs made to fit exactly · parts for reconstructive surgery
  • ✈️ Lightweight aerospace parts
  • 🎨 Fashion and art · spare parts no longer made

🖥️ Screens and loudspeakers 3.2.2

LED vs LCD vs OLED

LED screenLCD screenOLED screen
Light sourceRed, green and blue LEDsNone of its own → needs backlighting (now LEDs)Organic layers glow on their own — no backlight
StrengthsVery bright — big outdoor displaysMany "LED TVs" are LED-backlit LCDsThinner, lighter, bendable · brighter · less power · ~170° viewing angle

LED vs CCFL backlighting

LED backlightCCFL (old tubes)
Full brightness instantlyNeeds warm-up
Whiter, brighter light → vivid coloursSlightly yellow tint
Thinner screens · longer lifeThicker · shorter life
Less power, less heatMore power, more heat
Fig 3.44 How an OLED screen works
Fig 3.45 OLED television (curved screen)

Loudspeakers

  1. Digital sound → DAC → analogue current
  2. Amplifier boosts the current
  3. Current through a coil on an iron core → temporary electromagnet beside a permanent magnet
  4. Changing current pushes and pulls the core → cone vibrates → sound waves
Fig 3.46 Digital to analogue conversion
Fig 3.47 How a loudspeaker works

🌡️ Sensors 3.2.3

  • 📏 Input devices that measure physical properties
  • 〰️ Real-world data is analogue → ADC → digital for the microprocessor
  • 🦾 Driving motors / valves → DAC → analogue for the actuator
  • 🔁 Sensors send readings constantly — the microprocessor decides what to do
Fig 3.48 Thermometer — an analogue reading
Fig 3.49 ADC — analogue to digital
SensorExample uses
TemperatureCentral heating, chemical processes, greenhouses
MoistureWater in soil (greenhouse), moisture in food processing
HumidityWater vapour in the air — buildings, microchip factories, greenhouses
LightStreet lights, automatic car headlights, (rain detection for) wipers
InfraredActive: an intruder breaks a beam. Passive: detects body heat
PressureWeighing lorries, gas pressure in a reactor, intruder alarms
AcousticFootsteps or breaking glass in alarms, leaks at a pipe joint
GasPollution, O₂ / CO₂ in greenhouses, oxygen in car exhausts
pHAcidity of soil or a chemical process
Magnetic fieldAnti-lock brakes, phones and CD players
AccelerometerAirbags (sudden deceleration), phone portrait/landscape
ProximityTurning a phone screen off when held to your ear
FlowGas flow in pipes, respiratory devices
LevelPetrol tank level, powder in tablet production, coolant leaks

👀 Monitoring vs 🎛️ control 3.2.3

👀 Monitoring🎛️ Control
What happensReads sensors · compares with acceptable range · shows readings or warningsOut of range → signals (via DAC) to actuators that change conditions
Effect on the processNone — it just watchesOutput affects the next input → feedback
ExamplesPatient's vital signs · burglar alarm · engine temperature · river pollutionStreet lights · central heating · chemical plant · ABS brakes · greenhouse
Fig 3.50 Monitoring and control systems

Systems step by step

SystemSensor(s)DecisionAction
🚨 Security alarmAcoustic, infrared, pressureIntruder detected?Siren and lights on
💡 Street lightLight (via ADC, sampled e.g. every minute)Reading below stored value?Lamp on (else off) · stays 30 min before re-checking — no flicker from passing clouds
🔥 Central heatingTemperature vs user's pre-set valueBelow pre-set?Via DAC: open gas valve + start water pump · else no action
🧪 Chemical processTemperature, pHTemp < 70 °C? · pH > 3.5?Heater on / off · acid valve open / closed
🚗 ABS brakesMagnetic field (wheel rotation)One wheel slower (locking)?Reduce its brake pressure · checked many times a second (the pedal "judder")
🌱 GreenhouseHumidity, moisture, temp, pH, lightAbove / below pre-set?e.g. humidity high → motors open windows · low → valves spray water
Fig 3.51 Security system
Fig 3.52 Street lighting
Fig 3.53 Controlling central heating
Fig 3.54 Controlling a greenhouse

🎮 Central Heating Control Loop

The sensor reading goes through the ADC, the microprocessor compares it with the pre-set value, and the actuators switch the boiler on or off. Watch feedback keep the temperature hovering around the target.

🖼️ Activity 3.5 diagrams

Fig 3.55 Reactor control (Activity 3.5)
Fig 3.56 Traffic-light junction (Activity 3.5)

🗄️ Memory vs storage 3.3

Primary memorySecondary & off-line storage
CPU accessDirectly addressableNot directly addressable
ExamplesRAM, ROM, cacheHDD, SSD, DVD, memory stick, Blu-ray
Volatile?RAM yes · ROM noAll non-volatile · internal or external
Size / speedSmaller, much fasterMuch larger, slower — holds OS, apps, files permanently
Fig 3.57 Typical memory and storage devices
Fig 3.58 Primary, secondary and off-line storage
Fig 3.59 Primary memory

⚡ RAM and ROM 3.3.1

RAMROM
LastsTemporary · volatilePermanent · non-volatile
AccessRead and write · any location directlyRead only — can't be altered
HoldsData, files, programs and OS parts in useBIOS — start-up (bootstrap) instructions
UpgradeMore RAM → faster (less swapping to storage)—

DRAM vs SRAM

DRAMSRAM
Stores a bit withTransistor + capacitorFlip-flops
RefreshConstantly (about every 15 µs)Not needed
Speed~60 nsMuch faster, ~25 ns
Cost / power / capacityCheaper · less power · higher capacityDearer · lower capacity
Used forMain memoryCache
Fig 3.60 DRAM
Fig 3.61 SRAM

🧊 3D · Storage up close

Switch between a hard disk, a solid-state drive and an optical disc.

💽 Magnetic storage — hard disk drives 3.3.3

  • 💿 Platters (aluminium, glass, ceramic) spin at 5400–7200 rpm
  • 🧲 Read-write heads = electromagnets on a moving arm · both sides of every platter
  • 🗺️ Data laid out in tracks and sectors
  • 🐢 Latency — wait for the sector to rotate to the head · many head moves → slow ("Please wait…")
  • 🧩 Fragmentation — file split across non-adjacent sectors → slower · fix: defragmentation
  • 🔌 Removable HDDs (USB) for back-ups and moving files
Fig 3.62 Hard disk drive
Fig 3.63 Tracks and sectors

🔲 Solid-state storage 3.3.3

  • 🚫 No moving parts — controls electrons in NAND (or NOR) flash chips
  • 🔳 Chips arranged as a matrix · each intersection: floating gate + control gate
  • ⚡ Voltage on control gate → electrons through tunnel oxide → trapped by the dielectric in the floating gate
  • 1️⃣ Charged = 1 · empty = 0 · non-volatile (may leak after ~1 year unused)
Fig 3.64 Flash memory cell

SSD vs HDD

SSDHDD
Moving partsNone → more reliableSpinning platters, moving heads
SpeedMuch faster access · no spin-upLatency · must get up to speed
Size / weightLighter, thinnerHeavier, bulkier
Power / heatLower · runs cooler (great for laptops)Higher
⚠️ Weak spotsLimited writes (endurance) · must erase before rewritingFragmentation · damaged by knocks
Memory sticks — same flash technology · small, light, for moving files and small back-ups · some software uses one as a dongle (won't run without it).

📀 Optical storage 3.3.3

  • 🔦 Data stored as pits and lands on one spiral track (centre → outside), read by a laser
  • ✍️ R = write once · RW = rewrite many times
  • 📏 Shorter wavelength → smaller pits → more data
CDDVDBlu-ray
LaserRed, 780 nmRed, 650 nmBlue, 405 nm
Track pitch1.6 µm0.74 µm0.32 µm
Capacity~700 MB4.7 GB per layer (dual-layer possible)25 GB per layer · 50 GB dual-layer
NotesToo small for most moviesTwo 0.6 mm layers read separatelyBuilt-in anti-piracy encryption · faster transfer · more interactive
Fig 3.65 Optical media — spiral track, pits and lands
Fig 3.66 Dual-layering on a DVD
Fig 3.67 Blu-ray disc

🧠 Virtual memory 3.3.4

  • 💥 Programs need more RAM than exists → system could crash
  • ➕ Virtual memory = RAM + swap space on the HDD/SSD
  • 📄 Data moved in fixed-size pages (paging) · RAM full → oldest page moved out
  • 🗺️ A memory map tracks where every page is
✅ Benefits⚠️ Drawback: disk thrashing
Programs bigger than RAM can runRAM fills → more and more swapping → huge numbers of head movements
No RAM wasted on unused dataMore time swapping than processing · thrash point = execution stops
Less need to buy expensive RAMCan wear out the HDD · fix: more RAM, fewer programs, smaller swap file, SSD
Fig 3.68 Normal memory management
Fig 3.69 Just before program 4 is given RAM
Fig 3.70 Program 0 swapped to disk, program 4 gets RAM

🎮 Virtual Memory Simulator

RAM has room for 4 programs' pages. Run programs and watch the oldest page get swapped out to the disk. Then try "Run them all ×3" to see thrashing.

RAM (4 frames)

Swap space on the HDD/SSD

☁️ Cloud storage 3.3.5

  • 🌐 Data on remote servers
  • 📑 Copied across several servers (data redundancy) → always available
Public cloudPrivate cloudHybrid cloud
Client and provider are different companiesDedicated environment behind the company's firewallSensitive data private · the rest public
✅ Benefits⚠️ Drawbacks
Access any time, any device, anywhere onlineSlow / unstable internet → can't reach data
No storage device to carryCosts for big capacity and data transfer
Remote back-up — recover after disk failureProvider could fail and lose your data
Almost unlimited capacityYou lose control of security — physical, disasters, staff, hackers

🔌 NICs and MAC addresses 3.4.1–3.4.2

  • 🔌 NIC (network interface card) — connects a device to a network · holds its MAC address
  • 📶 WNIC — wireless version, uses an antenna
  • 🔢 MAC address = 48 bits · six pairs of hex: NN-NN-NN-DD-DD-DD
  • 🏭 First half = manufacturer · second half = device serial number
  • 🔁 Replace the NIC → the MAC address changes
UAA (universally administered)LAA (locally administered)
Set byFactoryThe user
How commonBy far the most commonRare
Why—Fit an addressing format · bypass a MAC filter or network restrictions
Risk—Clashes if the new address isn't unique

🏷️ IP addresses 3.4.3

  • 🏠 Private IP — given by the router; unique on that network
  • 🌍 Public IP — the router's, from the ISP; unique on the whole internet

IPv4 vs IPv6

IPv4IPv6
Size32 bits128 bits
Format4 groups of 8 bits in denary · 109.108.158.18 groups of hex, separated by colons
Extras—Far more addresses · no address collisions · built-in authentication · more efficient routing

MAC vs IP

MAC addressIP address
IdentifiesThe physical deviceWhere it's connected on the internet
Assigned byManufacturer · part of the NIC · uniqueISP (dynamic ones by DHCP) · not necessarily unique
Size48 bits32 bits (IPv4) / 128 bits (IPv6)
TypesUAA or LAAStatic or dynamic
Used forIdentifying sender and receiverRouting

Static vs dynamic

StaticDynamic
AssignedPermanently by the ISPBy a DHCP server at each connection
Used forWeb servers, online databases, FTP serversEveryday devices
PrivacyDevice fully traceableGreater — it changes
PerformanceFaster up/downloads · consistent locationCan drop VoIP calls if it changes mid-call
Cost / reliabilityMore expensive to maintainCheaper (addresses reused) · less reliable
Fig 3.71 Dynamic vs static IP addressing

🎮 Getting a web page — DHCP and DNS

Step through what happens when a device opens a website, with a dynamic or a static IP address.

📡 Routers 3.4.4

  • 🔀 Moves data packets between different networks (e.g. LAN ↔ internet)
  • 🔄 Converts data between network protocols and formats
  • 🔍 Inspects each packet's IP → sends it to the right switch
  • 🎯 The switch delivers it using the MAC destination address
  • 🛡️ Broadband routers sit behind a firewall · wired or wireless
Fig 3.72 Router flow diagram

✏️ Practice hub 8 activities · every example

Every activity from the coursebook chapter, as an auto-marked practice set. Same skill as the book's activity with the same number — but fresh questions every time you hit 🔀 New questions.

📘 Worked examples

Every type of worked example in the chapter, solved step by step. Hit 🔀 Another example on any of them for a new one.

🃏 Key-term flashcards Tap to flip

🧠 Mini-quiz

📝 Exam-style questions Try, then peek

  • ✅ The PC holds the address of the next instruction; this is copied into the MAR.
  • ✅ The instruction at the address in the MAR is copied into the MDR (then into the CIR).
  • ✅ The PC is incremented so it points at the next instruction.
  • ✅ The CPU has to communicate with each core, and the cores with each other.
  • ✅ More cores need more channels (4 cores need 6), and that communication reduces the overall gain.
  • ✅ A combination of hardware and software dedicated to a specific task.
  • ✅ Based on a microcontroller, microprocessor or system on chip.
  • ✅ Small, low cost, often no operating system; reacts in real time to sensor inputs.
  • ✅ The drum is given a positive charge; a laser removes the charge where the text/images will be.
  • ✅ Positively charged toner sticks only to those negatively charged areas.
  • ✅ Negatively charged paper is rolled over the drum and the toner transfers to it.
  • ✅ The paper's charge is removed; a fuser (heated rollers) melts the toner onto the paper.
  • ✅ A discharge lamp removes the charge from the drum ready for the next page.
  • ✅ The sensor constantly sends readings; an ADC converts them to digital.
  • ✅ The microprocessor compares each reading with the pre-set value stored in memory.
  • ✅ If it's too low, a signal is sent (via a DAC) to an actuator to switch the heater on / close the windows.
  • ✅ If it's too high, the heater is switched off / motors open the windows.
  • ✅ The output affects the next reading (feedback); this repeats while the system is on.
  • ✅ No moving parts, so more reliable if the laptop is knocked or carried.
  • ✅ Lighter and thinner.
  • ✅ Lower power consumption (longer battery life) and run cooler; faster access too.
  • ✅ Virtual memory uses part of the HDD/SSD (swap space) as if it were RAM when RAM is full.
  • ✅ Pages of data are swapped between RAM and the disk; the oldest page is moved out to make room.
  • ✅ Disk thrashing: so much swapping that there's a very high rate of read/write head movement…
  • ✅ …so more time is spent moving data than processing; at the thrash point execution halts.
  • ✅ MAC is the physical address of the device; IP identifies where it's connected on the internet.
  • ✅ MAC is set by the manufacturer and fixed (UAA); IP is assigned by the ISP and can be static or dynamic.
  • ✅ MAC is 48 bits; IP is 32 bits (IPv4) or 128 bits (IPv6).

🚀 Going further A Level preview

Beyond the syllabus, the coursebook looks at how devices connect:

  • 🔌 USB — serial, the industry standard
  • 🖥️ HDMI — digital replacement for VGA · HD sound + video · high bandwidth
  • 📶 Bluetooth — 79 channels at ~2.45 GHz · each pair picks a free channel and keeps hopping (spread-spectrum frequency hopping)
BluetoothWi-Fi
RangeUnder ~30 m~100 m
SpeedLower bandwidthFaster
Best forSimple links — headphones, keyboardsFull networks
Wired (twisted pair, coaxial, fibre)Wireless
Speed / stabilityFaster, more stableInterference · dead spots
SecurityMore secureEasier to intercept
FlexibilityFixed cablesEasy to expand · devices can move

📒 Revision notes · 1.3.3 Input Devices Answers

Every question from the 1.3.3 revision sheet, answered. Test yourself first: press 🙈 Cover the notes, say your answer, then click a note to reveal it.

Question / key pointRevision notes
🖨️ Scanners
How does a 2D scanner work?
  1. The lid is raised, the document is placed face down on the glass panel and the lid is closed.
  2. A bright light (xenon lamp or LED) illuminates the document.
  3. A scan head moves across the page. Mirrors send the image of each strip to a lens, which focuses it.
  4. The focused image falls on a CCD (charge-coupled device): thousands of light-sensitive elements (pixels) that each produce an electric charge depending on how much light hits them.
  5. The charges go through an ADC, and software builds a digital image.
  6. OCR software can then turn scanned text into an editable text file; a photo becomes an image file such as a JPEG.
💡 light document mirrors lens CCD ADC digital image
What can a 2D scanner scan?Flat, hard-copy (paper) items. Examples: flatbed scanners for documents, photos and drawings; sheet-fed / document scanners for many pages; passport scanners at airports; handheld scanners and barcode/QR readers are specialised kinds.
How does a 3D scanner work?It scans a solid object from many positions, taking readings along the x, y and z coordinates, and builds a 3D digital model. Technologies include lasers, white/structured light, X-rays and magnetic resonance. Medical scanners use tomography: they image the object as a series of very thin 2D "slices" and stack the slices in memory to make the 3D image. The model can be used in CAD or sent to a 3D printer.
What can a 3D scanner scan?Solid objects and people. Examples: CT scanners (X-rays), MRI (radio frequencies/magnetic fields) and SPECT (gamma rays) for the human body; laser scanners for car parts, buildings and museum artefacts; handheld 3D scanners for making models to 3D print; the face-ID depth camera on a phone.
How does a scanned image compare to a photo?Both are made of pixels from a light-sensitive sensor (CCD/CMOS) and an ADC. A scan is taken in close, even, controlled light, so it's flat, distortion-free and usually high resolution (good for documents, and OCR can turn text into editable text). A photo is taken from a distance through a lens in natural light, so it can capture 3D scenes, depth and moving subjects, but can suffer from shadows, glare, blur and perspective distortion.
🏷️ Barcodes and QR codes
How does a barcode reader work?
  1. A red laser or red LED shines on the barcode.
  2. Light is reflected back; dark bars reflect little or no light, light spaces reflect a lot.
  3. Sensors (photoelectric cells) read the reflected light as the beam moves across the code.
  4. The pattern of light/dark is converted to binary (e.g. light = 0, dark = 1), which the computer decodes into the digits.
Guard bars separate the left and right halves; the left and right digits use different patterns, so the code can be read in either direction.
What info is held in a barcode?Only a number (up to about 30 digits): typically the country code, the manufacturer, the product number and a check digit. It does not hold the price or the name. The number is the key field used to look up the product's record in the stock database.
What is a QR code and what can it store?A quick response code: a 2D matrix of dark and light squares (pixels). It holds far more than a barcode — up to 4296 characters or 7089 digits: website addresses, phone numbers, text, contact details, Wi-Fi logins, payment details, boarding passes and tickets. 3 large squares → position & orientation (read from any angle) small square → checks size and angle of the camera shot
How does a QR reader work?The camera on a phone or tablet takes an image of the code. A QR app finds the three large corner squares to locate and straighten the code, reads the grid of dark/light squares as binary data, uses the built-in error-checking data to fix damaged parts, then decodes the text or web address.
How is a QR code used to get information?Point the camera at the code → the app decodes it → you're taken automatically to the website, the phone app (if a phone number is stored), or the boarding pass/ticket is saved to the phone. Uses: adverts and posters, menus, product information, payments, boarding passes, event tickets.
vs barcodes: ✅ more data, built-in error checking, read by any phone camera, can be sent as images/messages, can be encrypted. ❌ several formats exist; can hide malicious links ("attagging") leading to fake websites or malware.
📷 Cameras, keyboards and pointing devices
How does a digital camera work?
  1. Light passes through the lens onto a light-sensitive sensor (a CCD or CMOS) made of millions of tiny photodiodes — the pixels.
  2. Each pixel produces an electric charge proportional to the light hitting it.
  3. An ADC converts each charge to binary — e.g. 8 bits per colour gives 256 levels; 24-bit RGB gives red, green and blue values of 0–255 for each pixel.
  4. The embedded system controls focus, shutter speed, aperture, flash and red-eye removal, then compresses and saves the image (e.g. JPEG).
More pixels and a better lens and sensor → better quality and bigger files.
What memory / storage / communication does a digital camera use?Storage: a removable flash memory card (SD/microSD, solid state) or built-in flash memory in a phone. Memory: RAM as a buffer while processing; ROM/firmware for the embedded system. Communication: USB cable, Bluetooth or Wi-Fi to transfer files to a computer, phone or cloud storage.
How does a keyboard work?Under the keys are two conductive layers separated by an insulating layer (a membrane or circuit board). Pressing a key pushes the layers together and completes a circuit at that point. The keyboard's controller detects which circuit closed, the CPU looks the key up in an index (key map) and converts it to the character's ASCII/Unicode value.
What different types of keyboard are there?QWERTY (standard), ergonomic (split/curved to reduce RSI), numeric keypads (ATMs, checkouts, chip-and-PIN), concept/overlay keyboards (fast-food tills), virtual/on-screen keyboards (phones, tablets), wireless/Bluetooth, mechanical and membrane keyboards, and Braille keyboards.
How can data input by a keyboard be verified?Double entry — type it twice and the computer compares the two copies (e.g. new passwords, email addresses). Visual check — the user reads what's on screen against the original document. (Validation — range, length, type, format checks — then checks the data is reasonable, but not that it's correct.)
How does a mouse / pointing device work?Optical mouse: a red LED lights the surface; a tiny CMOS camera takes about 1500 images a second of the reflected light; a digital signal processor compares the changing images to work out the direction and distance moved, and sends the new coordinates to the computer, which moves the pointer. Buttons and the scroll wheel send click/scroll signals. ✅ No moving parts, so it's reliable, dirt can't get in, and it works on most surfaces.
What types of mouse / pointing device are there?Optical mouse, laser mouse, mechanical (ball) mouse, wireless/Bluetooth mouse, trackpad/touchpad (laptops), trackerball (ball on top — good for limited movement/disabilities), joystick, stylus/graphics tablet, touch screen, and the pointing stick on some laptops.
Wired vs wireless: wired has no signal loss and needs no batteries; wireless is more flexible.
👆 Touch screens and whiteboards
What are the different types of touch screen? How does each type work? Capacitive glass conductive glass base finger changes theelectrostatic field Infrared finger breaks beams → x, y Resistive flexible top layer glass bottom layer press: layers touch,voltage change → x, y Capacitive (glass, a transparent conductive layer, glass base). Skin conducts electricity, so a finger changes the electrostatic field; a microcontroller works out where. Surface capacitive has sensors at the corners; projective capacitive uses an X–Y grid, so it allows multi-touch and works through thin gloves.
Infrared — infrared transmitters and sensors around the edge make a grid of invisible beams; a finger breaks beams, the sensors detect less infrared, and the microcontroller calculates the position.
Resistive — two layers with a resistive coating (a flexible polyethylene top layer and a glass bottom layer) separated by air or an inert gas. Pressing pushes them together, completing a circuit; the change in voltage gives the position.
For each type, a benefit and a drawback (no opposites) Capacitive ✅ very clear image, even in strong sunlight ❌ affected by electromagnetic radiation (magnetic fields, microwaves)
Infrared ✅ still works if the screen is scratched or cracked ❌ can be set off accidentally — anything breaking the beams (an insect, a sleeve) registers as a touch
Resistive ✅ good resistance to dust and water ❌ easily scratched (the top layer is plastic)
Advantages and disadvantages of each touch screen type for a mobile phone or tablet? Capacitive (projective) — ✅ multi-touch for pinch/zoom/swipe, very durable and scratch-resistant glass, sharp display, needs only a light touch ❌ needs a bare finger or special stylus (surface type), affected by electromagnetic interference, more expensive. This is why almost all phones use it.
Infrared — ✅ multi-touch, durable, works with any object (gloves, pen) ❌ sensitive to water/moisture and to strong light, accidental touches; the frame of sensors makes the device bulkier — unsuitable for a phone.
Resistive — ✅ cheap, works with gloves or any stylus, resists dust and water ❌ no multi-touch, low sensitivity (must press harder), poor visibility in sunlight, plastic surface scratches.
How does an interactive whiteboard work?A projector shows the computer's screen on a large touch-sensitive board. Touching the board with a finger or special pen is detected — by a resistive or capacitive surface, an infrared frame or cameras in the corners — and the position is sent to the computer as mouse coordinates. So the board is both an input device (touch/pen) and, with the projector, an output surface: you can click, drag, write notes and save them.
What hardware and software do you need with an interactive whiteboard?Hardware: the board, a computer, a (short-throw) projector (or a large touch-screen panel instead), a connection (USB/wireless and HDMI), special pens/stylus, speakers. Software: device drivers, calibration software so the touch position matches the image, and whiteboard/presentation software for writing, annotating and saving lessons.
How does a microphone work?Sound makes the air vibrate → the diaphragm vibrates → it moves a coil of wire back and forth around a permanent magnet → the coil cutting through the magnetic field induces an electric current (analogue) → the current is amplified and a sound card / ADC samples it into digital values so the computer can store or process it.
Systems that use a microphone, and howVoice assistants / smart speakers — voice commands. Phones & video calls — capturing speech. Voice recognition / dictation software — speech to text. Security systems — acoustic sensor detects footsteps or breaking glass. Voice authentication at banks — identifies the speaker. Cars — hands-free calls and voice control. Games consoles — voice chat. Music recording / podcasts. Hearing aids — pick up and amplify sound. Noise-cancelling headphones — detect outside noise to cancel it.
🛫 Input devices at work
Input and output devices when scanning passports at airportsInput: 2D passport scanner (with OCR to read the text into the database), RFID reader for the chip in an e-passport, digital camera to photograph the passenger's face (compared with the passport photo using face recognition), sometimes a fingerprint scanner, and a touch screen. Output: screen/monitor with instructions, gate actuator (motor) opening the barrier, lights (green/red), speaker, and a printer for a slip if needed.
Input and output devices with barcode readers at supermarket checkoutsInput: barcode reader/scanner, keypad (number of identical items, weights, or the barcode number if it won't scan), touch screen (choose loose items such as fruit), weighing scale, card reader / chip-and-PIN / contactless reader. Output: screen (item and price), speaker (a beep for a good read, another sound for an error), printer (receipt).
How is a product barcode used at a supermarket checkout? (the steps)
  1. The barcode is scanned and the number decoded (the check digit is checked).
  2. The number is the key field: it's looked up in the stock database.
  3. When the record is found, the name and price are sent back to the checkout (POS terminal), shown on screen and added to the bill/receipt.
  4. The number in stock in that record is reduced by 1 and written back.
scan look up key price → POS stock − 1 ≤ reorder? auto-order
How do barcodes allow automatic stock control?Every sale reduces the stock level in the database automatically. After each sale the new level is compared with the reorder level; if it's less than or equal to it, an order is automatically sent to the supplier and a flag is set so the item isn't reordered with every later sale. When the delivery arrives, the new items are scanned in and the stock level is updated (and the flag cleared). Management benefits: up-to-date sales information and trends, prices changed in one place, no need to price every item, fewer items run out, and customer buying habits can be analysed (e.g. with loyalty cards).
🌡️ Sensors and control
Name 7 sensors that input data, with two applications each Temperature — central heating; greenhouse; chemical process · Light — street lights; car headlights · Moisture — greenhouse soil; food factory · Humidity — greenhouse air; microchip factory · Infrared (active / passive) — burglar alarm beam / body heat; automatic doors · Pressure — burglar alarm (weight on a mat); weighing lorries; reactor gas pressure · Acoustic — footsteps/breaking glass in security; detecting leaking pipes · Gas (O₂/CO₂) — greenhouse; pollution monitoring; car exhaust · pH — soil acidity; chemical process · Magnetic field — phones' compass; anti-lock brakes · Accelerometer — airbags; phone portrait/landscape · Proximity — phone screen off at your ear; parking sensors · Flow — gas pipes; inhalers/respirators · Level — petrol tank; river height; tablet powder levels.
What is an ADC?An analogue-to-digital converter. Real-world data from sensors is analogue (continuously varying, e.g. a voltage). A computer can only process digital data, so the ADC turns the analogue signal into discrete binary values (e.g. 8 bits → 256 levels). A DAC does the reverse so a computer can drive analogue devices such as motors and valves (actuators).
Sensors for street lightsLight sensor (on at dusk, off at dawn); infrared / motion sensor (brighten only when people or cars pass, saving energy); acoustic sensor (traffic noise) in smart street lights.
Sensors for security devicesInfrared (active beam broken; passive body heat), pressure (mats under doors and windows), acoustic (footsteps, breaking glass), magnetic field (door/window contacts), proximity, light (torch at night), plus cameras.
Sensors for pollution controlGas (CO₂, CO, NO₂, O₂), pH (acid in rivers and rain), temperature (water/thermal pollution), light (water clarity / turbidity), acoustic (noise pollution), humidity, flow and level (rivers, waste outflows).
Sensors for gamesAccelerometer and gyroscope (tilting/swinging a controller or phone), infrared (motion cameras such as Kinect, TV-remote style pointing), pressure (dance mats, balance boards, trigger buttons), acoustic/microphone (voice control, singing games), proximity and touch, light/camera (AR games).
Sensors for household applicationsTemperature (fridge, oven, central heating, kettle), moisture/humidity (tumble dryer stops when clothes are dry, bathroom extractor fan), pressure (washing machine water level), light (automatic garden lights), infrared (TV remote, motion-sensing lights), gas (carbon-monoxide/smoke alarms), proximity (robot vacuum), acoustic (smart speakers).
Sensors for industrial applicationsTemperature and pH (chemical processes), pressure (nuclear reactor gas, hydraulic systems), flow (gas/liquid in pipes), level (tanks, powder in tablet production), gas (leak detection), proximity/infrared (items on a conveyor belt, robot safety), humidity (microchip manufacture), magnetic field, accelerometer (vibration in machinery).
Why use sensors instead of humans to collect data?Readings are more accurate (no human error); they're taken 24/7 and at regular intervals without breaks or tiredness; the computer responds faster; sensors work in dangerous places (nuclear reactors, chemicals, deep sea, space); data is stored automatically for analysis and graphs; it's cheaper over time (fewer staff); and changes too small or too quick for a person to notice are detected.
How is a sensor used in a control system to control the output? sensor ADC microprocessorcompares with pre-set value DAC actuator (heater…) feedback: the output changes the next sensor reading
  1. The sensor constantly sends readings (it never "decides" anything itself).
  2. An ADC converts them to digital, if they're analogue.
  3. The microprocessor compares each reading with the pre-set (stored) value.
  4. If it's outside the range, it sends a signal (through a DAC if needed) to an actuator — e.g. switch the heater on, open a valve or a window.
  5. The change affects the next readings: this is feedback. The loop repeats as long as the system is on. (A monitoring system only warns — sounds an alarm or shows a message — and doesn't change the process.)
How is data from a sensor processed?The microprocessor samples the digital data at regular intervals (e.g. every second), compares each value with stored values/limits, decides on an action (warning, alarm or control signal), may store it to show graphs and trends, and sometimes averages several readings to smooth out "noise" from a faulty or jumpy reading.
How does a control system avoid frequent changes of output (flickering)?It doesn't switch at exactly one value. It uses a range / two thresholds (hysteresis): e.g. a heater turns on below 19 °C but only off above 21 °C, so a reading wobbling around 20 °C doesn't keep toggling it. A street light might come on below one light level and off only above a higher one. Other methods: wait until the reading has stayed past the limit for a set time (a delay — a passing car's headlights won't switch a street light off), and average several readings before deciding.
📌 Summary for 1.3.3 Input Devices — Input devices turn real-world data into a form a computer can process. Scanners (2D: light, mirrors, lens, CCD, ADC, OCR; 3D: x-y-z points or tomography slices), barcode readers (laser/LED + photoelectric sensors → binary number → key field in the stock database → automatic stock control) and QR codes (camera + app; far more data, error checking, but can hide malicious links). Digital cameras (lens → CCD pixels → ADC → RGB values, flash card storage, USB/Bluetooth/Wi-Fi). Keyboards (a key press completes a circuit → ASCII; verify by double entry/visual check). Optical mice (LED + CMOS images → DSP → coordinates). Touch screens — capacitive (electrostatic field), infrared (beam grid), resistive (two layers touch). Microphones (diaphragm + coil + magnet → current → ADC). Sensors send analogue readings through an ADC to a microprocessor, which compares them with pre-set values and controls actuators through a DAC — feedback, with hysteresis to stop flickering.
📌 Chapter summary — The CPU (CU, ALU, registers, buses) runs the fetch–decode–execute cycle using the PC, MAR, MDR, CIR and ACC; performance depends on clock speed, cache, cores and bus width. Embedded systems are dedicated hardware+software. Input devices (barcode/QR scanners, cameras, keyboards, microphones, mice, scanners, touch screens) and output devices (actuators, projectors, printers, screens, speakers) convert between the real world and data; sensors with ADCs/DACs and actuators allow monitoring and feedback control. RAM is volatile, ROM isn't; secondary storage is magnetic, optical or solid-state; virtual memory swaps pages to disk; cloud storage keeps data on remote servers. NICs hold MAC addresses; IP addresses (static/dynamic, IPv4/IPv6) and routers move packets between networks.
Guru Jazzy 🕶️ · Chapter 3 · Hardware · it's silicon all the way down 🧠