1.1 - The characteristics of contemporary processors, input, output and storage devices
1.1.1 Structure and function of the processor
CPU components:
Buses:
Fetch-Decode-Execute cycle:
- Fetch: The PC holds the address of the next instruction. This address is copied to the MAR and sent to main memory via the address bus. The CU sends a read signal via the control bus, and the instruction travels along the data bus into the MDR, which copies it into the CIR. The PC is then incremented by 1.
- Decode: The decode unit decodes the instruction held in the CIR, splitting it into the opcode (what operation to perform) and the operand (what data or address to use).
- Execute: The CPU carries out the operation specified by the instruction. Results of processing are stored in the ACC.
Factors affecting CPU performance:
Limited by heat.
Benefits multi-threaded applications.
Reduces memory access time.
Pipelining: while one instruction is being executed, the next is being decoded and the one after is being fetched. Increases throughput but hazards (data dependencies, branching) can cause stalls.
Processor architectures:
1.1.2 Types of processor
Advantages:
- Compiler must do very little work to translate the high-level language statement into assembly.
- More complex hardware.
- A single instruction usually takes multiple clock cycles.
- Slower clock cycles.
- Pipelining is more difficult to implement.
Advantages:
- Cheap.
- Each instruction can be completed in a single clock cycle.
- As instructions are sequential, pipelining is possible.
- Results in lower energy consumption.
- More instructions needed to do complex tasks.
- Larger program size.
GPUs use SIMD (Single Instruction, Multiple Data), where the same instruction is applied to multiple pieces of data at the same time, making them highly efficient for repetitive operations across large datasets.
Benefits: faster for tasks that can be parallelised.
Limitations: some tasks are inherently sequential and cannot benefit from additional cores. Not all software is written to exploit multiple cores, so single-threaded applications see no benefit.
1.1.3 Input, output and storage
Know the trade-offs: speed vs cost vs capacity vs volatility. Exam questions often ask you to justify storage choice for a given scenario.
1.2 - Software and software development
1.2.1 Systems software
Operating system functions: manages hardware resources, provides user interface, manages files, handles security and user accounts, manages processes and memory.
Memory management:
Interrupts: signal to the CPU that an event needs attention. CPU finishes current instruction, saves state to stack, executes ISR (Interrupt Service Routine), restores state and continues. Types: hardware interrupts (keyboard, mouse, I/O), software interrupts (program calls), timer interrupts.
Scheduling algorithms:
Types of operating system:
BIOS (Basic Input/Output System): firmware stored in ROM. First code to run on boot. Performs POST (Power-On Self Test), identifies hardware, loads OS bootloader.
Device drivers: software allowing the OS to communicate with hardware. Translates generic OS commands into device-specific instructions.
Virtual machines: software emulation of a computer. Allows one OS to run inside another. Uses: running legacy software, testing, sandboxing, cloud computing (hypervisors manage multiple VMs on one physical machine).
1.2.2 Applications generation
Translators:
Stages of compilation (4 stages per spec): with each pass, the compiler performs different actions on the source code, preparing it for the next stage.
[tokenclass:token].
- Each lexeme is checked against predefined rules and classified as a token: keyword, identifier, operator, separator, literal, datatype, etc.
- Whitespace and comments are removed, as they are simply passed over by the lexer (this is a side effect of tokenising, not the main job).
- Identifiers (variable and subroutine names) are added to a symbol table, which keeps track of every variable and subroutine used in the program.
- Builds an abstract syntax tree from the tokens, strictly following the syntax diagrams of the language.
- Reports syntax errors if any token breaks the rules, stating the exact line and location of the error and possibly suggesting corrections.
- The symbol table is updated with extra information about identifiers, e.g. their data type, which is used for semantic checks such as type checking (ensuring operations are applied to compatible types).
- Each node of the abstract syntax tree is translated into the equivalent low-level (machine code / assembly) instructions.
- The object code is then passed to the linker, which combines it with any library code (and a loader places it into memory) to produce the final executable.
- Redundant instruction elimination: removes unnecessary load/store instructions, e.g.
MOV x,R0thenMOV R0,R1can be replaced with the single instructionMOV x,R1. - Unreachable code removal: deletes code that can never be executed (e.g. a
printstatement placed after areturn). - Flow / control optimisation: removes pointless jumps, e.g.
GOTO L1whereL1: GOTO L2is rewritten as a directGOTO L2. - Removes subroutines that are never called and variables/constants that are never referenced.
A common exam question is "What happens during the different phases of compilation?" For full marks, name all four stages in order (Lexical, Syntax, Code generation, Optimisation) and describe the key output of each: token stream + symbol table, abstract syntax tree, object code, optimised object code.
Libraries:
A library is a collection of ready-compiled and tested programs (subroutines/functions) that can be called upon when needed. Most programming languages include extensive standard libraries, for example, Python's math module provides functions such as sqrt, factorial, ceil, floor, and constants like pi. Windows programs can call Dynamic Link Libraries (DLLs), shared subroutines for common OS tasks (e.g. a Save As dialog box) that any program can call with the correct parameters.
- Quick and easy to integrate into your own code.
- Pre-tested, so they are relatively free from errors.
- Pre-compiled and typically optimised for fast execution.
- Adding functionality or making specific tweaks can be difficult or impossible.
- Implementation is "black-boxed": you cannot always see or control how it works internally.
- You must trust that developers will continue to maintain the library.
Linkers:
The linker combines multiple object code files (produced by compilers) with any required library code to produce a single executable. It resolves all external references by inserting the correct machine addresses into every external call and return instruction, so all modules are correctly linked together.
Loaders:
The loader is the part of the operating system responsible for loading the executable machine code file into memory so it is ready to run. When dynamic linking is used, the loader is also responsible for locating and loading the required library files into memory at the point they are needed.
Know the full pipeline: source code → compiler → object code → linker (+ libraries) → executable → loader → memory. Be clear on the difference between static linking (library baked in at link time) and dynamic linking (library loaded at runtime by the OS).
1.2.3 Software development methodologies
1.2.4 Types of programming language
Programming paradigms:
OOP concepts:
Assembly language and addressing modes:
The spec requires following and writing simple programs using the Little Man Computer (LMC) instruction set:
| Mnemonic | Operation |
|---|---|
| INP | Input a value → ACC |
| OUT | Output ACC |
| LDA x | Load value at address x → ACC |
| STA x | Store ACC → address x |
| ADD x | ACC = ACC + value at x |
| SUB x | ACC = ACC − value at x |
| BRA x | Branch always → address x |
| BRZ x | Branch to x if ACC = 0 |
| BRP x | Branch to x if ACC ≥ 0 |
| HLT | Halt the program |
| DAT | Define a data value / label a memory location |
Addressing modes:
1.3 - Exchanging data
1.3.1 Compression, encryption and hashing
Hashing: one-way function that converts data to a fixed-length hash value. Cannot be reversed. Uses: password storage (store hash not password), data integrity checking, hash tables (for fast lookup), digital signatures.
Symmetric vs asymmetric: symmetric is faster but has the key distribution problem. Asymmetric solves key sharing but is slower. In practice, asymmetric is used to exchange a symmetric key, which is then used for bulk encryption (TLS does this).
1.3.2 Databases
Normalisation: process of structuring a database to reduce redundancy.
- 1NF: No repeating groups. Each cell contains one atomic value. Each row is unique.
- 2NF: In 1NF + no partial dependencies (all non-key attributes depend on the whole primary key, not just part of it). Applies to composite keys.
- 3NF: In 2NF + no transitive dependencies (non-key attributes depend only on the primary key, not on other non-key attributes).
SQL: the spec requires students to interpret and modify SQL queries:
Also know: INSERT INTO, UPDATE SET, DELETE FROM. The focus is on reading and modifying existing queries rather than writing complex queries from scratch.
Transaction processing: ACID properties:
Record locking: prevents two users editing same record simultaneously. Deadlock: two processes each waiting for the other to release a lock; prevented by ordering locks or timeout.
Indexing: creates a separate data structure for fast lookups on a field. Speeds up queries but slows INSERT/UPDATE/DELETE.
1.3.3 Networks
Protocols and standards:
Common application-layer protocols:
TCP/IP stack (4 layers):
POP3 vs IMAP: POP3 downloads and deletes from server (single device), IMAP keeps mail on the server (multi-device). Exam often asks you to justify which to use for a given scenario.
DNS (Domain Name System): translates domain names (e.g. example.com) to IP addresses. Hierarchical: client queries local resolver → root name servers → TLD servers (e.g. .com, .uk) → authoritative name server → returns IP. Results cached to reduce future lookups.
Network security threats:
Phishing requires the user to be deceived into clicking a link. Pharming redirects the user automatically at the DNS/network level; the user does not need to make any mistake.
Network security protection:
Network hardware:
1.3.4 Web technologies
Search engine indexing: web crawlers follow links and index page content. Index is a data structure mapping keywords to URLs. Allows fast search queries.
PageRank algorithm: ranks pages by the number and quality of links pointing to them. More links from high-ranked pages = higher rank. Iterative algorithm: rank flows through the link graph.
1.4 - Data types, data structures and algorithms
1.4.1 Data types and number representation
Primitive data types: integer, real/floating-point, character, string, Boolean.
Two's complement (representing negative integers):
- To negate: flip all bits, then add 1
- MSB has negative place value: e.g. 8-bit: -128 to +127
- Addition works normally; overflow detected if carry into and out of MSB differ
Sign and magnitude: MSB = sign bit (0=positive, 1=negative). Simpler but two representations of zero. Less used in practice.
Hexadecimal: base 16, digits 0–9 and A–F. Each hex digit = 4 bits (nibble). Used as shorthand for binary, as it is easier to read. IPv6 addresses, colour codes (#FF5733), memory addresses.
Floating point representation: sign bit + mantissa + exponent. Value = mantissa × 2^exponent.
- Normalisation: ensures leading bit of mantissa is always 1 (or 0 for negative in two's complement). Maximises precision for a given number of bits.
- More mantissa bits = greater precision. More exponent bits = greater range.
- Floating point errors: rounding, representation errors (some decimals can't be exactly represented in binary).
Bitwise operations:
Character sets: ASCII (7-bit, 128 characters, basic Latin), Extended ASCII (8-bit, 256), Unicode (up to 32-bit, covers all world languages and symbols). UTF-8 is the most common Unicode encoding.
Binary addition: add column by column right to left. 0+0=0, 0+1=1, 1+1=10 (write 0 carry 1), 1+1+1=11 (write 1 carry 1). Overflow occurs if the result requires more bits than available.
Binary subtraction: use two's complement by negating the number being subtracted, then add. Alternatively, subtract directly: 0−0=0, 1−0=1, 1−1=0, 10−1=1 (borrow from next column).
1.4.2 Data structures
Know how to create, traverse, add and remove from each structure. Also know which is best for which scenario, e.g. hash table for fast lookup, queue for scheduling, stack for backtracking.
1.4.3 Boolean algebra
Logic gates: AND, OR, NOT, NAND, NOR, XOR. Know their truth tables and symbols.
Boolean laws for simplification (as listed in spec):
¬(A ∧ B) ≡ ¬A ∨ ¬B
¬(A ∨ B) ≡ ¬A ∧ ¬B
A ∧ (B ∨ C) ≡ (A ∧ B) ∨ (A ∧ C)
A ∨ (B ∧ C) ≡ (A ∨ B) ∧ (A ∨ C)
A ∧ (B ∧ C) ≡ (A ∧ B) ∧ C
A ∨ (B ∨ C) ≡ (A ∨ B) ∨ C
A ∧ B ≡ B ∧ A
A ∨ B ≡ B ∨ A
¬(¬A) ≡ A
Karnaugh maps (K-maps): visual tool for simplifying Boolean expressions. Group 1s in powers of 2 (1, 2, 4, 8). Larger groups = simpler expression. Wrap around edges allowed. Eliminates need for algebraic manipulation.
D-type flip-flop: stores 1 bit. Output Q takes the value of input D on the rising clock edge. Used in registers and memory cells.
Half adder: adds two 1-bit inputs. Sum = A XOR B. Carry = A AND B.
Full adder: adds two 1-bit inputs + carry in. Built from two half adders. Enables multi-bit addition.
1.5 - Legal, moral, cultural and ethical issues