PAPER 1 REVISION
1.1 — Processors, Input, Output & Storage
The internal architecture of the CPU, how instructions are processed, and the different types of hardware. Expect LMC assembly code questions and FDE cycle traces.
CPU Components

ALU — Arithmetic Logic Unit

Performs all arithmetic (add, subtract, multiply) and logical (AND, OR, NOT, comparisons) operations. The computational engine of the CPU.

Control Unit (CU)

Coordinates all CPU activity. Fetches instructions, decodes them, and controls the flow of data between CPU components and memory. Does NOT process data itself.

Registers

RegisterFull NameRole
PCProgram CounterHolds the address of the NEXT instruction to fetch
MARMemory Address RegisterHolds the address in memory being read from/written to
MDRMemory Data RegisterTemporarily holds data read from or to be written to memory
CIRCurrent Instruction RegisterHolds the instruction currently being decoded/executed
ACCAccumulatorStores results of ALU calculations

Buses

Data Bus
  • Carries data between CPU, memory and I/O
  • Bidirectional
  • Width = word size (e.g. 64-bit)
Address Bus
  • Carries memory addresses
  • Unidirectional (CPU → memory)
  • Width determines addressable memory
Control Bus
  • Carries control signals (read, write, clock, interrupt)
  • Bidirectional
  • Coordinates operations
The Fetch-Decode-Execute (FDE) Cycle

FETCH

Contents of PC copied to MAR via address bus

Memory at address in MAR is read; data copied to MDR via data bus

Instruction copied from MDR to CIR

PC is incremented (points to next instruction)

DECODE

Control unit decodes the instruction in the CIR

Splits into opcode (what to do) and operand (what to do it to)

EXECUTE

Appropriate components activated (ALU, registers, memory)

Instruction carried out; result may go to ACC or memory

CPU Performance Factors

FactorEffect
Clock speedHigher = more FDE cycles per second (measured in GHz). More heat generated.
Number of coresMore cores = more instructions in parallel. Limited by software that can utilise them.
Cache sizeLarger cache = more data stored close to CPU, fewer slow RAM accesses. L1 fastest, L3 largest.

Pipelining

While one instruction is being executed, the next is being decoded and the one after is being fetched. Overlapping stages increases throughput.

Increases throughput RISC enables it (1 cycle/instruction) Hazards can stall pipeline
Processor Architectures

Von Neumann Architecture

  • Single memory stores both data and instructions
  • Single shared bus — can only do one at a time (bottleneck)
  • Used by most general-purpose computers
  • The "Von Neumann bottleneck" = slow memory access limits CPU speed

Harvard Architecture

  • Separate memory and buses for data and instructions
  • Data and instructions fetched simultaneously — no bottleneck
  • More complex and expensive
  • Used in: embedded systems, DSPs, microcontrollers
Contemporary architectures use a modified Harvard design — separate caches for instructions and data at L1 level, but shared main memory below that (combining benefits of both).
Little Man Computer (LMC) Assembly

OCR uses LMC as a simplified model of assembly language. You must be able to follow and write programs.

MnemonicMeaning
INPInput a value → ACC
OUTOutput ACC value
LDA xxLoad value from address xx into ACC
STA xxStore ACC value to address xx
ADD xxAdd value at address xx to ACC
SUB xxSubtract value at address xx from ACC
BRP xxBranch to xx if ACC ≥ 0
BRZ xxBranch to xx if ACC = 0
BRA xxAlways branch to xx
HLTStop program
DATDeclare a memory location

Example: Add two numbers

INP          // get first number → ACC
STA NUM1     // store in NUM1
INP          // get second number → ACC
ADD NUM1     // ACC = ACC + NUM1
OUT          // output result
HLT

NUM1 DAT      // memory location

Addressing Modes

  • Immediate — operand is the actual value (e.g. LDA #5, loads 5)
  • Direct — operand is the memory address containing the value
  • Indirect — operand is address that holds the address of the value
  • Indexed — address = operand + index register value
RISC vs CISC Processors

RISC — Reduced Instruction Set Computer

  • Small instruction set — each instruction is simple
  • Each instruction takes one clock cycle
  • Instructions are single lines of machine code
  • Pipelining is easy and efficient
  • Compiler must do more work to break down complex tasks
  • Needs more RAM (longer programs)
  • Used in: smartphones (ARM), tablets, embedded systems
// RISC: multiply X by Y
LDA R1, X
LDA R2, Y
MULT R1, R2
STO R1, X

CISC — Complex Instruction Set Computer

  • Large instruction set — complex multi-step instructions
  • Instructions can take multiple clock cycles
  • Instructions built into hardware (microcode)
  • Pipelining harder (variable instruction length)
  • Compiler has less work — one instruction does more
  • Needs less RAM (shorter programs)
  • Used in: desktops, laptops (x86 Intel/AMD)
// CISC: same multiply in one instruction
MULT A, B
RISCCISC
Instruction setSmall, simpleLarge, complex
Clock cycles per instruction1Multiple
PipeliningEasyHard
Compiler complexityHighLow
RAM requiredMoreLess
ExamplesARM (phones)x86 (PCs)
GPUs & Parallel Systems

GPU — Graphics Processing Unit

  • Contains thousands of small cores optimised for parallel tasks
  • A co-processor — supplements the CPU
  • Excellent for repetitive, identical operations on large datasets
  • Originally for rendering graphics (millions of pixels simultaneously)
  • Now used for: machine learning, AI training, scientific simulation, cryptocurrency mining
Massively parallel High throughput Poor at sequential tasks

Multi-core & Parallel Systems

  • Multi-core: multiple independent CPU cores on one chip. Each core can execute a separate instruction stream simultaneously.
  • Parallel systems: multiple processors working on parts of the same problem. Can use threading on a single core.
  • Both improve performance by doing work concurrently
Limitation: Not all software can use multiple cores. Threads must be managed carefully to avoid race conditions. The performance gain is limited by the sequential parts of a program (Amdahl's Law).
Storage: Magnetic, Flash & Optical
TypeExamplesHow it worksSpeedUse case
MagneticHDD, tapeMagnetic coating on spinning platters; read/write head moves to sectorSlow (mechanical)Cheap bulk storage, backups
FlashSSD, USB drives, SD cardsNAND flash: electrons trapped in floating gate transistors; no moving partsVery fastOS drives, portable storage
OpticalCD, DVD, Blu-rayLaser reads pits and lands on disc surfaceSlowMedia distribution, archiving
RAM, ROM & Virtual Storage

RAM — Random Access Memory

  • Volatile — loses data when power removed
  • Stores currently running programs and data
  • Fast read/write access
  • More RAM = can run more programs simultaneously

ROM — Read Only Memory

  • Non-volatile — retains data without power
  • Cannot be modified (Read Only)
  • Stores BIOS/firmware
  • Used in embedded systems where program never changes

Virtual Storage

  • Uses secondary storage (hard disk) as if it were RAM
  • Allows programs larger than physical RAM to run
  • OS moves pages between RAM and disk as needed
  • Page file: section of disk used as virtual memory
  • Disk thrashing: computer freezes when pages swap constantly (too many programs, not enough RAM)
Exam tip: Virtual storage is well-suited for backups because data doesn't need fast access and can be stored remotely/cheaply on disk.
Input & Output Devices — Applied Examples

You need to justify why a specific device is suitable for a given scenario.

DeviceTypeBest suited for
Barcode scannerInputFast, accurate product identification in retail
TouchscreenInput/OutputKiosks, mobile — intuitive, no extra hardware
MicrophoneInputVoice recognition, video conferencing
Digital cameraInputCapturing images for processing
3D printerOutputPrototyping physical objects from digital models
SpeakerOutputAudio alerts, music, accessibility (text-to-speech)
ActuatorOutputPhysical movement in robotics/automated systems
1.2 — Software & Software Development
Operating systems, compilers, development methodologies and programming paradigms. OS questions (scheduling, memory management, interrupts) are heavily examined.
Operating System — Roles
  • Memory management — allocates RAM to processes, handles virtual memory
  • Process management / scheduling — decides which process runs and when
  • Device management — manages hardware via device drivers
  • File management — organises files on storage, handles permissions
  • Security — manages user accounts, authentication, access control
  • User interface — provides GUI or CLI
  • Interrupt handling — responds to hardware/software interrupts

Types of Operating System

TypeDescriptionExample
DistributedMultiple networked computers work together, appear as oneGoogle's infrastructure
EmbeddedBuilt into hardware; ROM; limited function; no UIWashing machine, router
Multi-taskingMultiple processes run concurrently (time-slicing)Windows, macOS
Multi-userMultiple users share one machine simultaneouslyUniversity mainframe
Real-time (RTOS)Processes data and responds within a guaranteed timeframePacemaker, autopilot
Memory Management

Paging

  • Memory divided into fixed-size blocks called pages
  • Processes split into pages; loaded into any free page frames
  • Avoids external fragmentation
  • OS maintains a page table mapping logical → physical addresses
  • Pages can be swapped to/from disk (virtual memory)

Segmentation

  • Memory divided into variable-size logical segments (code, data, stack)
  • Segments match the logical structure of a program
  • More flexible than paging for the programmer
  • Can cause external fragmentation (gaps between segments)

Virtual Memory

Part of the hard disk acts as overflow RAM. When RAM is full, inactive pages are moved to disk (page file). This allows programs larger than physical RAM to run.

Disk thrashing: If pages are constantly swapped in/out, performance collapses. The disk can't keep up — CPU idles waiting for memory. More RAM is the fix.

BIOS

  • Basic Input/Output System — stored in ROM
  • First code run when computer powers on
  • Runs POST (Power-On Self Test) to check hardware
  • Loads the bootloader from storage, which loads the OS
  • Manages low-level hardware configuration
Scheduling Algorithms

The OS must share CPU time fairly between multiple processes. Scheduling algorithms decide the order and duration of execution.

AlgorithmHow it worksProsCons
Round RobinEach process gets an equal time slice. If not done, goes to back of queue.Fair; all processes get CPU time; no starvationHigh overhead switching; not optimal for short jobs
First Come First Served (FCFS)Jobs processed in arrival order. Runs to completion.Simple to implement; fair in orderLong jobs block short ones (convoy effect); no starvation prevention
Shortest Job First (SJF)Always runs the job with shortest estimated time next.Minimises average wait timeLong jobs may starve; requires knowing job lengths in advance
Shortest Remaining Time (SRT)Preemptive SJF — if a new job arrives with shorter time remaining, it preempts.Optimal average wait timeHigh overhead; starvation of long jobs
Multi-level Feedback QueueMultiple queues with different priorities. Processes can move between queues.Flexible; balances responsiveness and throughputComplex to implement
Round Robin is the most common exam answer for "why does a multi-tasking OS use this algorithm?" — because it ensures all processes receive CPU time and prevents starvation.
Interrupts & the ISR

An interrupt is a signal sent to the CPU requesting its attention. After each FDE cycle, the CPU checks for interrupts.

How the CPU handles an interrupt:

CPU finishes current instruction

Checks interrupt register for pending interrupts

If interrupt higher priority than current task: current state saved to stack (PC, registers)

PC loaded with address of ISR (Interrupt Service Routine)

ISR executes to handle the interrupt

Interrupt flag reset; saved state restored from stack

Original program resumes from where it stopped

Types of Interrupt

  • Printer completing a job
  • Keyboard/mouse input received
  • Peripheral unplugged
  • Division by zero (software interrupt)
  • Timer interrupt (used by scheduler)
  • Power failure warning

Device Drivers

Software that allows the OS to communicate with hardware. Acts as a translator between generic OS calls and device-specific hardware instructions. Without a driver, the OS cannot use the device.

Hardware-specific OS-hardware interface Must match OS version
Virtual Machines
  • Software emulation of a complete computer system
  • Runs an OS within another OS (host and guest)
  • The "host" runs the hypervisor which manages virtual machines
  • Used for: testing software across OSes, running legacy software, server consolidation, sandboxing
  • Also: intermediate code (e.g. JVM for Java) — code compiles to bytecode, which runs on a virtual machine independent of the hardware
Translators: Compilers, Interpreters & Assemblers
Compiler
  • Translates entire HLL program to machine code in one go
  • Produces a standalone executable
  • Errors reported all at once after compilation
  • Faster execution (already translated)
  • Source code hidden from user
Interpreter
  • Translates and executes line by line
  • No executable produced — source needed each time
  • Stops at first error — easier to debug
  • Slower execution (translates every run)
  • Source code visible
Assembler
  • Translates assembly language to machine code
  • One-to-one mapping (each mnemonic → one instruction)
  • Platform-specific output
Intermediate code (e.g. Java bytecode): compiled to bytecode (halfway between HLL and machine code), then interpreted by a JVM. Platform-independent — "write once, run anywhere."
Stages of Compilation

Lexical Analysis — tokenisation: removes whitespace and comments; converts source code into tokens (keywords, identifiers, literals). Builds a symbol table.

Syntax Analysis — parsing: checks tokens against grammar rules of the language. Produces a parse tree (AST). Identifies syntax errors.

Semantic Analysis — checks meaning: type checking, variable declarations, scope rules. Ensures code makes sense logically.

Code Generation — translates the AST into machine code or intermediate code for the target platform.

Code Optimisation — improves efficiency of generated code: removes redundant instructions, simplifies loops, reduces memory use. Done without changing behaviour.

Linkers combine separately compiled modules/object files into one executable. Loaders load the executable into memory when it's run and resolve memory addresses.
Open Source vs Closed Source
Open SourceClosed Source (Proprietary)
Source codePublicly availableHidden, restricted
CostUsually freeUsually paid
Modifiable?Yes — users can edit and redistributeNo
SupportCommunity-drivenOfficial vendor support
SecurityMany eyes find bugs fast, but vulnerabilities visibleObscurity offers some protection
ExamplesLinux, Firefox, PythonWindows, Microsoft Office, Photoshop

Utilities

  • System software with a specific maintenance purpose
  • Examples: disk defragmenter (rearranges fragmented files for faster access), antivirus (detects/removes malware), file manager, backup software, disk compression
Software Development Methodologies
MethodologyApproachBest forDrawback
WaterfallLinear stages: requirements → design → implementation → testing → maintenance. Each stage must complete before the next.Well-defined, stable requirements; fixed scopeInflexible — going back is costly; client sees product late
AgileIterative sprints (2-4 weeks). Working software delivered frequently. Requirements can change.Evolving requirements; client involvementHard to predict cost/timeline; needs constant client engagement
Extreme Programming (XP)Agile variant: pair programming, test-driven development, continuous integration, frequent small releasesSmall teams, high-quality code focusRequires experienced developers; intensive client involvement
Spiral ModelRisk-driven: each cycle = risk analysis → prototype → evaluate. Combines waterfall + prototyping.Large, high-risk projectsComplex; expensive risk management; not for small projects
RAD (Rapid Application Development)Rapid prototyping; users involved throughout; iterative testingTight deadlines; UI-heavy applicationsRequires user time; may sacrifice quality for speed
Programming Paradigms

Procedural / Imperative

  • Sequence of instructions, executed top to bottom
  • Uses procedures, functions, loops, conditionals
  • Clear flow of control
  • Examples: C, Pascal, BASIC

Object-Oriented (OOP)

  • Programs built from objects — bundled data + behaviour
  • Key concepts: encapsulation, inheritance, polymorphism
  • Promotes reuse and modularity
  • Examples: Python, Java, C++

Declarative

  • Describe what you want, not how to do it
  • The system works out the steps
  • Examples: SQL ("SELECT * FROM table"), HTML, Prolog

Functional

  • Programs as mathematical functions — input → output, no side effects
  • Avoids mutable state and shared data
  • Examples: Haskell, Erlang; functional features in Python
Need for different paradigms: Different problems suit different approaches. OOP for large systems, declarative for databases, functional for concurrent systems. Most modern languages are multi-paradigm.
1.3 — Exchanging Data
Compression, encryption, databases (SQL and normalisation), networking (TCP/IP stack, protocols) and web technologies. SQL and normalisation questions appear frequently.
Lossy vs Lossless Compression

Lossless

  • Original file can be perfectly reconstructed
  • No data lost — just encoded more efficiently
  • Used when: data integrity critical (text, executables, medical images)
  • Examples: PNG, ZIP, FLAC

Run Length Encoding (RLE)

Replaces consecutive repeated values with a count + value pair.

Original: AAAABBCCCCCDD
RLE:      4A 2B 5C 2D
Saves: 13 chars → 8 values

Dictionary Coding

Frequently occurring strings are replaced by a short index. A dictionary maps index → original string. The compressed data + dictionary is stored.

Lossy

  • Some data is permanently discarded
  • Original cannot be recovered exactly
  • Used when: small size matters more than perfection (images, audio, video)
  • Examples: JPEG, MP3, MP4

When to use each

Use lossy when…Use lossless when…
Streaming video/audioCompressing executables
Sharing photos onlineMedical imaging
Storage is the priorityText documents
Encryption

Symmetric Encryption

  • Same key used to encrypt and decrypt
  • Fast and efficient
  • Problem: how to securely share the key? If intercepted during exchange, security broken
  • Examples: AES, DES

Asymmetric Encryption

  • Uses a key pair: public key (shared openly) + private key (secret)
  • Anyone encrypts with public key; only private key holder can decrypt
  • Solves key distribution problem — public key can be shared freely
  • Slower than symmetric
  • Used in: HTTPS, digital signatures, key exchange
Digital signatures: To prove a message is from you, encrypt with your private key. Anyone can decrypt with your public key — proving only you could have sent it. This is the basis of code signing and certificate authorities.
Hashing
  • A hash function takes input data and produces a fixed-length hash value
  • One-way — cannot reverse a hash to get the original data
  • Same input always gives the same hash
  • A collision = two different inputs produce the same hash (bad — should be rare)

Uses of Hashing

  • Password storage: store hash of password, not the password itself. When user logs in, hash their input and compare to stored hash.
  • Hash tables: use hash as an index to find data in O(1) time
  • Data integrity: hash a file and send hash alongside it. Recipient hashes the received file — if hashes match, file wasn't tampered with
  • Digital fingerprinting: uniquely identify files
Relational Databases — Key Concepts
  • Flat file: single table — simple but prone to redundancy and anomalies
  • Relational database: multiple linked tables — reduces redundancy
  • Primary key: unique identifier for each record in a table (e.g. StudentID)
  • Foreign key: primary key of another table, stored here to link tables
  • Secondary key: non-unique field used to index/search (e.g. Surname)
  • Entity: a thing about which data is stored (e.g. Student, Course)

Entity-Relationship (ER) Notation

  • One-to-one: one student has one ID card
  • One-to-many: one teacher teaches many students
  • Many-to-many: many students take many courses (requires a junction/link table)

Referential Integrity

A foreign key cannot reference a primary key that doesn't exist. Prevents orphaned records. The database enforces this constraint automatically.

Normalisation to 3NF

1NF (First Normal Form): All values are atomic (no lists/repeating groups). Each row is unique (has a primary key). No repeating columns.

2NF (Second Normal Form): In 1NF AND every non-key attribute is fully dependent on the whole primary key (no partial dependencies). Only matters if there's a composite key.

3NF (Third Normal Form): In 2NF AND no transitive dependencies — non-key attributes must depend only on the primary key, not on other non-key attributes.

Why normalise? Removes data redundancy, prevents update/insert/delete anomalies, reduces storage, makes data consistent.
SQL — Interpret & Modify

SELECT (retrieve data)

SELECT Name, Grade
FROM Students
WHERE Grade >= 70
ORDER BY Grade DESC;

JOIN (combine tables)

SELECT Students.Name, Courses.Title
FROM Students
INNER JOIN Enrolments
  ON Students.StudentID = Enrolments.StudentID
INNER JOIN Courses
  ON Enrolments.CourseID = Courses.CourseID;

INSERT (add record)

INSERT INTO Students (Name, Grade)
VALUES ('Alice', 85);

UPDATE (change data)

UPDATE Students
SET Grade = 90
WHERE StudentID = 3;

DELETE (remove record)

DELETE FROM Students
WHERE StudentID = 3;
Transaction Processing & ACID

A transaction is a sequence of database operations treated as a single unit. ACID properties ensure data integrity even if something goes wrong mid-transaction.

PropertyMeaning
AtomicityAll operations in a transaction succeed, or none do. No partial transactions.
ConsistencyDatabase always moves from one valid state to another. Rules/constraints are never violated.
IsolationConcurrent transactions don't interfere with each other — each appears to run sequentially.
DurabilityOnce committed, changes persist even if the system crashes. Written to non-volatile storage.
Record locking: When a transaction reads/writes a record, it locks it so other transactions can't modify it simultaneously. Prevents dirty reads and lost updates. Redundancy: Keeping multiple copies of data so if one fails, another is available.
The TCP/IP Stack — Protocol Layering

Data passes down the stack when sending, and up the stack when receiving. Each layer adds/removes its own header.

LayerProtocol examplesWhat it addsWhat it does
ApplicationHTTP, HTTPS, FTP, POP3, IMAP, SMTPApplication dataDetermines which protocol the application needs
TransportTCPPort number, packet number, total packetsSplits data into packets; handles retransmission of lost packets; end-to-end connection
NetworkIPSource & destination IP addressesLogical addressing; routers operate here; determines route through network
LinkEthernet, Wi-FiSource & destination MAC addressesPhysical addressing; identifies NIC cards; handles transmission on local network
Socket address = IP address + port number. This uniquely identifies a specific application on a specific device. Ports: HTTP = 80, HTTPS = 443, FTP = 21.
Packet vs Circuit Switching

Packet Switching

Data split into packets. Each packet can take a different route. Reassembled at destination.

  • Packets contain: header (source/dest IP, order, TTL), payload (data), trailer (checksum)
  • More efficient — bandwidth shared
  • Resilient — if one route fails, packets reroute
  • Used by the Internet

Circuit Switching

A dedicated connection is established for the duration of communication.

  • Data arrives in order — no reassembly needed
  • Bandwidth wasted when nothing transmitted
  • Both sides must transmit at same rate
  • Used by: traditional phone networks (PSTN)
Network Security

Firewalls

  • Monitors and filters incoming/outgoing traffic using rules (packet filters)
  • Examines: source IP, destination IP, port, protocol
  • Dropped packets: silently discarded
  • Rejected packets: sender is notified
  • Can be hardware or software

Proxy Servers

  • Acts as intermediary between user and internet
  • Hides user's real IP address (anonymity)
  • Can cache frequently accessed pages (speed)
  • Can block access to specific sites (filtering)

Network Threats

  • Malware: viruses, trojans, ransomware, spyware
  • Phishing: fake emails/sites to steal credentials
  • DDoS: flood server with requests to make it unavailable
  • Man-in-the-middle: attacker intercepts communications
  • SQL injection: malicious SQL in input fields to manipulate database

Network Hardware

DeviceRole
NICConnects device to network; has MAC address
SwitchDirects data to correct device on LAN using MAC addresses
RouterConnects networks; routes packets using IP addresses
WAPWireless access point; connects wireless devices to network
GatewayTranslates between different protocols/networks
Client-Server vs Peer-to-Peer
Client-ServerPeer-to-Peer (P2P)
StructureCentral server; clients connect to itAll devices equal — each is client AND server
SecurityMore secure; centralised controlLess secure; no central control
BackupsCentralised backupsEach device must backup independently
CostExpensive (dedicated server)Cheap to set up
FailureServer failure = all clients affectedNo single point of failure
ExamplesWebsites, email serversBitTorrent, some chat apps
DNS — Domain Name System
  • Translates human-readable domain names (e.g. bbc.co.uk) into IP addresses
  • Hierarchical structure: TLD (.uk) → 2LD (co) → subdomain (bbc)
  • When you type a URL, your device queries a DNS server to get the IP, then connects to that IP
  • DNS records cached locally to speed up future lookups
Web Technologies
HTML
  • HyperText Markup Language
  • Defines structure and content of web pages
  • Tags: <h1>, <p>, <a>, <img>, <table>
  • Declarative — describes what to show
CSS
  • Cascading Style Sheets
  • Controls visual presentation (colours, fonts, layout)
  • Separates style from content
  • Selectors target HTML elements
JavaScript
  • Scripting language for dynamic web pages
  • Runs in the browser (client-side)
  • Can modify HTML/CSS dynamically (DOM manipulation)
  • Form validation, animations, API calls
Client-Side vs Server-Side Processing
Client-SideServer-Side
Where it runsIn the user's browserOn the web server
LanguagesHTML, CSS, JavaScriptPHP, Python, Node.js, SQL
ProsFaster (no server round-trip); responsive UISecure (logic hidden); can access databases; consistent across browsers
ConsSource code visible; dependent on client's hardwareSlower (network delay); more server load
ExamplesForm validation, dropdown menusLogin authentication, database queries
Search Engines — Indexing & PageRank

Indexing

  • Web crawlers (spiders) follow links on pages and collect content
  • Content is stored in an index (huge database mapping words → pages)
  • When you search, the engine queries this index rather than the live web

PageRank Algorithm

  • Developed by Google — ranks pages by importance
  • More links pointing to a page = higher rank
  • Links from high-rank pages count more
  • Calculated iteratively — every page's rank depends on pages linking to it
  • Used alongside content relevance to produce search results
1.4 — Data Types, Structures & Boolean Algebra
Binary maths, data representation, data structures and Boolean logic. Expect binary arithmetic, two's complement, floating point, logic gate diagrams and truth tables.
Primitive Data Types
TypeDescriptionExample values
IntegerWhole numbers (positive, negative, zero)42, -7, 0
Real / FloatNumbers with decimal/fractional part3.14, -0.5
BooleanTrue or False only (1 or 0)True, False
CharacterSingle letter, digit or symbol'A', '3', '!'
StringSequence of characters"Hello", "abc123"
Binary — Positive Integers

Binary → Denary

Each bit position has a value (powers of 2). Sum the values where there is a 1.

128  64  32  16   8   4   2   1
  1   0   1   1   0   1   0   1
= 128 + 32 + 16 + 4 + 1 = 181

Denary → Binary

Repeatedly divide by 2, read remainders bottom to top.

45 ÷ 2 = 22 r1
22 ÷ 2 = 11 r0
11 ÷ 2 =  5 r1
 5 ÷ 2 =  2 r1
 2 ÷ 2 =  1 r0
 1 ÷ 2 =  0 r1
Read up: 101101 = 45

Binary ↔ Hexadecimal

Split binary into groups of 4 bits. Each group = one hex digit.

1011 0101
 B    5   = 0xB5

Hex digits: 0-9, A=10, B=11,
            C=12, D=13, E=14, F=15

Binary Addition

  0110 0101  (101)
+ 0011 1010  ( 58)
-----------
  1001 1111  (159)

Rules: 0+0=0, 0+1=1,
       1+1=0 carry 1,
       1+1+1=1 carry 1
Overflow occurs when the result is too large to fit in the available bits. The carry out of the most significant bit indicates overflow.
Negative Numbers — Sign & Magnitude vs Two's Complement

Sign & Magnitude

  • MSB (leftmost bit) = sign bit: 0 = positive, 1 = negative
  • Remaining bits = magnitude
  • +5 = 0000 0101, −5 = 1000 0101
  • Problem: two representations of zero (+0 and −0)
  • Problem: arithmetic is complex

Two's Complement (preferred)

To negate: flip all bits, then add 1.

+5 = 0000 0101
Flip: 1111 1010
Add 1:1111 1011  = -5

Check: MSB 1 = negative
Value: -(128) + 64+32+16+8+2+1
     = -128 + 123 = -5 ✓
  • Only one representation of zero
  • Normal addition works on positive and negative numbers
Floating Point Representation

Floating point stores numbers as: mantissa × 2^exponent. Like scientific notation in binary.

Normalisation

A floating point number is normalised when the first bit after the binary point is different from the sign bit:

  • Positive normalised: mantissa starts with 0.1xxx
  • Negative normalised: mantissa starts with 1.0xxx
  • Ensures maximum precision for a given number of bits

Precision vs Range

  • More bits in mantissa → greater precision (more decimal places)
  • More bits in exponent → greater range (larger/smaller numbers)
  • Underflow: number too small to represent
  • Overflow: number too large to represent
  • Rounding errors occur due to finite precision
Bitwise Operations & Masks

Shifts

  • Left shift by 1 = multiply by 2
  • Right shift by 1 = divide by 2 (integer)
  • Bits shifted out are lost; zeros fill in
0000 1010  (10) left shift 1
0001 0100  (20)

Masks

  • AND mask: use to isolate bits (set unwanted bits to 0)
  • OR mask: use to force bits to 1
  • XOR mask: use to flip specific bits
1100 1010  (value)
AND 0000 1111  (mask)
=   0000 1010  (lower 4 bits)
Character Sets — ASCII & Unicode

ASCII

  • 7-bit encoding — 128 characters
  • Covers: uppercase, lowercase, digits, punctuation, control characters
  • Limitations: no non-Latin characters, no emoji

Unicode (UTF-8, UTF-16, UTF-32)

  • Superset of ASCII — first 128 code points identical
  • Supports 140,000+ characters including all world languages, emoji, symbols
  • UTF-8 uses variable length: 1-4 bytes per character (efficient, backward compatible)
Why Unicode over ASCII? Globalisation — websites/software must support all languages. ASCII can only represent English-language characters.
Arrays, Records, Lists & Tuples
StructureDescriptionKey property
ArrayFixed-size ordered collection of same type. Can be 1D, 2D, 3D.Fast random access O(1) by index; fixed size
RecordCollection of fields of different types (like a row in a database)Groups related data of mixed types
ListDynamic ordered collection; size can changeMutable; can add/remove elements
TupleOrdered collection; fixed once createdImmutable — cannot be changed after creation
Advanced Data Structures

Graph

  • Nodes (vertices) connected by edges
  • Directed: edges have a direction (one-way)
  • Undirected: edges are two-way
  • Weighted: edges have a numeric value (distance, cost)
  • Represented as: adjacency matrix or adjacency list
  • Used for: networks, maps, social connections

Hash Table

  • Uses a hash function to map keys to array indices
  • Average O(1) for insert/search/delete
  • Collision: two keys hash to same index — resolved by chaining or open addressing

Binary Search Tree (BST)

  • Left child < parent < right child
  • In-order traversal gives sorted order
  • Search: O(log n) on average, O(n) worst (unbalanced)

Differences: Tree vs Graph

  • Tree: no cycles, one root, hierarchical, edges = n-1
  • Graph: can have cycles, no root, can be disconnected, any number of edges
Adjacency matrix: 2D array of 0/1 (or weights). Fast to check if edge exists. Wastes space for sparse graphs. Adjacency list: list of neighbours per node. Space efficient for sparse graphs.
Logic Gates & Truth Tables
ABANDORXORNANDNOR
0000011
0101110
1001110
1111000

NOT gate

ANOT A
01
10

OCR Notation

  • NOT A = Ā (bar over) or ¬A
  • A AND B = A · B or AB
  • A OR B = A + B
  • A XOR B = A ⊕ B

Boolean Laws — Must Know

LawAND formOR form
IdentityA · 1 = AA + 0 = A
NullA · 0 = 0A + 1 = 1
IdempotentA · A = AA + A = A
ComplementA · Ā = 0A + Ā = 1
Double neg.Ā̄ = A
CommutationA·B = B·AA+B = B+A
AssociationA·(B·C) = (A·B)·CA+(B+C) = (A+B)+C
DistributionA·(B+C) = A·B + A·CA+(B·C) = (A+B)·(A+C)
De Morgan's Laws

De Morgan's Laws allow you to swap between AND/OR forms with negation:

// Law 1 — negate AND → OR
NOT(A AND B) = NOT A OR NOT B
Ā̄ · B̄ → Ā + B̄

// Law 2 — negate OR → AND
NOT(A OR B) = NOT A AND NOT B
Ā̄ + B̄ → Ā · B̄
Shortcut: Conjunction (AND) is replaced by disjunction (OR) and vice versa — and the whole expression AND each term is negated.

Example Simplification

Simplify: A·B + A·C

Factor out A (distribution):
= A·(B + C)

Another example:
Ā·B + Ā·C
= Ā·(B + C)

Karnaugh Maps (K-maps)

A grid method for simplifying Boolean expressions by grouping 1s in powers of 2 (1, 2, 4, 8...).

  • Adjacent cells differ by one variable
  • Group sizes must be powers of 2
  • Larger groups = simpler result
  • Groups can wrap around edges
D-Type Flip-Flop
  • A logic circuit that stores one bit
  • Two inputs: D (data) and CLK (clock)
  • Output Q — the stored bit
  • Q only updates on the rising edge of the clock
  • At rising edge: Q ← D (Q takes the value of D)
  • Between clock pulses: Q holds its value (memory!)
  • Built from 4 NAND gates
  • Sets of flip-flops form registers

Truth Table

CLK edgeDQ (next)
Rising ↑00
Rising ↑11
Not risingXNo change
Why is this important? Flip-flops are the basic building blocks of all memory (RAM, registers, cache). Understanding them shows how computers store state.
Half Adder & Full Adder

Half Adder

Adds two 1-bit values. Outputs: Sum and Carry.

  • Sum = A XOR B
  • Carry = A AND B
ABSumCarry
0000
0110
1010
1101

Full Adder

Adds three inputs: A, B, and Carry-in. Outputs: Sum, Carry-out.

  • Made of two half adders + an OR gate
  • Can be chained to add multi-bit numbers
  • Sum = A XOR B XOR Cin
  • Carry-out = (A AND B) OR (Cin AND (A XOR B))
ABCinSumCout
00000
00110
01010
01101
11111
1.5 — Legal, Moral, Cultural & Ethical Issues
Computing legislation and the broader ethical implications of technology. Usually 6-mark extended response questions — you must argue both sides and give a balanced conclusion.
1.5.1 — Computing Legislation
ActYearWhat it coversKey offences/provisions
Data Protection Act1998 (GDPR 2018) How personal data is collected, stored and used by organisations Data must be: collected lawfully, used only for stated purpose, kept accurate, not kept longer than necessary, kept secure, not transferred outside EU without adequate protection. Individuals have right to access their data.
Computer Misuse Act1990 Prevents unauthorised access or modification to computer systems Three offences: (1) Unauthorised access to computer material, (2) Unauthorised access with intent to commit further offences, (3) Unauthorised modification of computer contents (e.g. installing malware, deleting files)
Copyright, Designs & Patents Act1988 Protects intellectual property — software, music, films, code Illegal to copy, distribute or modify software without licence. Applies to piracy, illegal downloads. Open source licences (GPL, MIT) are legal frameworks under this act.
Regulation of Investigatory Powers Act (RIPA)2000 Regulates surveillance and investigation powers of public bodies Allows government/police to intercept communications lawfully. ISPs may be required to retain communications data. Balance between national security and individual privacy.
1.5.2 — Moral & Ethical Issues

Computers in the Workforce

  • For: Automation increases productivity, reduces costs, improves accuracy, frees humans for creative work
  • Against: Job displacement, widening inequality, deskilling, loss of human judgment in important decisions

Automated Decision Making

  • For: Consistent, fast, unbiased (no human prejudice), data-driven
  • Against: Algorithmic bias (reflects biased training data), lack of accountability, no empathy, opaque "black box" decisions
  • Examples: credit scoring, parole decisions, hiring algorithms

Artificial Intelligence

  • For: Medical diagnosis, climate modelling, accessibility, scientific research
  • Against: Deepfakes/misinformation, autonomous weapons, surveillance, job losses, existential risk debates

Environmental Effects

  • Data centres consume enormous energy — large carbon footprint
  • E-waste from discarded devices — toxic materials
  • But: Computing enables remote work (less travel), smart grids, environmental monitoring

Censorship & the Internet

  • For censorship: Prevents harmful content (child abuse, terrorism), protects vulnerable users
  • Against censorship: Suppresses free speech, government control, disproportionate blocking

Monitoring Behaviour & Personal Data

  • Cookies, tracking pixels, location data, social media profiling
  • For: Personalisation, targeted services, fraud detection
  • Against: Privacy invasion, Cambridge Analytica-style manipulation, lack of consent

Piracy & Offensive Communications

  • Piracy harms creators but raises access issues (cost barriers)
  • Online abuse, trolling — platform responsibility debate
For 6-mark extended responses: Always present both sides, use specific examples (real laws, real cases, real technologies), and conclude by weighing up the overall impact. Vague answers score poorly — specificity earns marks.