OCR A-Level CS: Component 01 - Computer Systems

H446/01  ·  2 hours 30 minutes  ·  40% of A-Level  ·  Topics 1.1 – 1.5

1.1 - The characteristics of contemporary processors, input, output and storage devices

1.1.1  Structure and function of the processor

CPU components:

ALU (Arithmetic Logic Unit)
Performs arithmetic (add, subtract) and logical (AND, OR, NOT, comparisons) operations on data.
Control Unit (CU)
Directs the operation of the CPU: fetches, decodes and executes instructions. Sends control signals to other components.
PC (Program Counter)
Holds the memory address of the next instruction to be fetched.
ACC (Accumulator)
Stores the result of the most recent ALU operation.
MAR (Memory Address Register)
Holds the address of memory location currently being read from or written to.
MDR (Memory Data Register)
Holds data that has just been read from memory or is about to be written to memory.
CIR (Current Instruction Register)
Holds the instruction currently being decoded and executed.

Buses:

Data bus
Carries data between CPU, memory and I/O. Bidirectional. Width = word size.
Address bus
Carries memory addresses from CPU to memory/I/O. Unidirectional. Width determines addressable memory.
Control bus
Carries control signals (read/write, clock, interrupt). Bidirectional.

Fetch-Decode-Execute cycle:

  • Fetch: MAR ← PC; PC incremented; MDR ← memory[MAR]; CIR ← MDR
  • Decode: CU decodes instruction in CIR, splitting it into opcode and operand
  • Execute: CU carries out the instruction, which may involve the ALU, reading/writing memory, or jumping

Factors affecting CPU performance:

Clock speed
Number of cycles per second (GHz). Higher = faster execution. Limited by heat.
Number of cores
More cores = more instructions processed simultaneously. Benefits multi-threaded applications.
Cache
Small, fast memory between CPU and RAM. L1 (fastest, smallest) → L2 → L3. 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:

Von Neumann
Single shared memory for both instructions and data. Single bus. Simple and cheap. Bottleneck = von Neumann bottleneck (bus limits speed).
Harvard
Separate memory and buses for instructions and data. Faster, as it can fetch instruction and data simultaneously. Used in embedded systems and DSPs.
Contemporary
Modern processor architectures that go beyond the classic Von Neumann model. May incorporate features from both Von Neumann and Harvard designs. The spec lists this as a third category alongside Von Neumann and Harvard.

1.1.2  Types of processor

CISC (Complex Instruction Set Computer)
Large set of complex instructions. Each instruction can perform multiple operations. Variable length instructions. Fewer lines of code needed. Examples: x86 (Intel, AMD). Hardware does more work, so the compiler is simpler.
RISC (Reduced Instruction Set Computer)
Small set of simple instructions. Each executes in one clock cycle. Fixed length instructions. Easier to pipeline. Examples: ARM (phones, Raspberry Pi). Compiler does more work, requiring more instructions.
GPU (Graphics Processing Unit)
Thousands of smaller, simpler cores optimised for parallel processing. Originally for rendering graphics. The spec notes GPUs have uses beyond graphics, e.g. machine learning, scientific simulation, video processing, physics simulation. Suited to tasks that can be broken into many simultaneous calculations.
Multicore and parallel systems
Multiple processor cores on one chip. Tasks divided between cores and run simultaneously. Parallel systems = multiple processors working together. Benefits: faster for tasks that can be parallelised. Limitation: some tasks are inherently sequential and cannot benefit from additional cores.

1.1.3  Input, output and storage

Magnetic storage (HDD)
Spinning magnetic platters. Large capacity, low cost per GB. Slower than SSD. Mechanical and susceptible to physical damage. Used for bulk data storage.
Flash storage (SSD, USB)
No moving parts. Fast read/write. More durable and silent. Higher cost per GB. Used in phones, laptops, USB drives.
Optical storage (CD/DVD/Blu-ray)
Laser reads/writes data on reflective disc. Large capacity (Blu-ray up to 128GB). Slower. Used for distribution and archiving.
RAM (Random Access Memory)
Volatile: loses data when power is off. Fast. Stores currently running programs and data. More RAM = more programs run simultaneously without slowdown.
ROM (Read Only Memory)
Non-volatile: retains data without power. Contains BIOS/firmware. Cannot be easily written to. Stores boot instructions.
Virtual storage
Uses part of secondary storage (HDD/SSD) as if it were RAM when RAM is full. Slower than RAM. Allows running programs larger than physical RAM.

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:

Paging
Memory divided into fixed-size pages. Programs split into pages. Pages stored wherever space exists, not necessarily contiguous.
Segmentation
Memory divided into variable-size segments based on logical divisions of a program (code, stack, data). More flexible than paging.
Virtual memory
Uses secondary storage as extension of RAM. Pages swapped in/out as needed (thrashing = excessive swapping → performance drops).

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:

Round robin
Each process gets equal time slice in turn. Fair but higher priority tasks not favoured.
First come first served (FCFS)
Processes run in order of arrival. Simple. Long jobs can block short ones (convoy effect).
Shortest job first (SJF)
Shortest process runs first. Minimises average wait time. Requires knowing job length in advance.
Shortest remaining time (SRT)
Preemptive version of SJF. New shorter job can interrupt current one.
Multi-level feedback queues
Multiple queues with different priorities. Processes can move between queues based on behaviour.

Types of operating system:

Distributed
Manages resources across multiple machines that appear as one system to the user.
Embedded
Built into hardware devices. Minimal, dedicated to specific tasks (washing machine, car ECU).
Multi-tasking
Runs multiple processes simultaneously by rapidly switching between them.
Multi-user
Multiple users share one system simultaneously. Manages resource allocation between users.
Real-time
Guarantees response within a defined time. Used where timing is critical (air traffic control, medical devices). Hard RTOS = missing deadline = failure.

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

Open source vs closed source
Open source: source code publicly available, free to modify and distribute. Community maintained. Closed source: source code hidden, proprietary. Commercial support available.
Utilities
System tools for maintenance: antivirus, disk defragmenter, backup tools, file compression.

Translators:

Compiler
Translates entire high-level source code to machine code in one go. Creates an executable. Fast execution. Error list produced at end. Examples: C, C++.
Interpreter
Translates and executes source code line by line. No executable produced. Stops at first error. Slower execution. Easier to debug. Examples: Python.
Assembler
Translates assembly language (mnemonics) to machine code. One-to-one translation. Output is object code.

Stages of compilation (4 stages per spec):

  1. Lexical analysis: removes whitespace/comments, tokenises keywords, identifiers and literals. Produces a token stream.
  2. Syntax analysis: checks token stream against grammar rules. Produces a parse tree. Reports syntax errors.
  3. Code generation: converts parse tree to intermediate or machine code.
  4. Optimisation: improves efficiency of generated code by removing redundant operations and simplifying expressions.

Linkers: combine object code files and library code into one executable. Loaders: load executable into memory ready to run. Libraries: pre-written, tested code modules that can be reused.

1.2.3  Software development methodologies

Waterfall
Linear, sequential. Each phase complete before next begins. Clear documentation. Poor for changing requirements. Good for well-defined projects.
Agile
Iterative sprints. Frequent customer feedback. Adapts to change. Less documentation. Good for unclear or evolving requirements.
Extreme Programming (XP)
Agile variant. Pair programming, test-driven development, frequent releases. Very short iterations.
Spiral model
Iterative + risk management. Each cycle: plan → risk analyse → develop → evaluate. Best for large, high-risk projects.
RAD (Rapid Application Development)
Prototyping + iterative delivery. Heavy user involvement. Fast delivery. Requirements can evolve.

1.2.4  Types of programming language

Programming paradigms:

Procedural / imperative
Step-by-step instructions. Uses procedures/functions. Examples: Python, Pascal, C. Good for straightforward sequential problems.
Object-oriented (OOP)
Models the world as objects. Key concepts: classes, objects, methods, attributes, inheritance, encapsulation, polymorphism.
Declarative
Describes what to do, not how. Examples: SQL, Prolog. Logic-based.
Functional
Based on mathematical functions. No side effects. Examples: Haskell, Erlang.

OOP concepts:

Class
Blueprint/template defining attributes and methods for a type of object.
Object
Instance of a class. Has its own attribute values.
Encapsulation
Bundling data and methods together. Hides internal state, which is only accessible via methods (getters/setters).
Inheritance
A subclass inherits attributes and methods of a parent class. Enables code reuse. "is-a" relationship.
Polymorphism
Same method name behaves differently in different classes. Overriding parent methods in subclasses.
Abstraction
Hiding complexity behind simple interfaces. User interacts with simplified interface, not internal workings.

Assembly language and addressing modes:

The spec requires following and writing simple programs using the Little Man Computer (LMC) instruction set:

LMC instruction set
MnemonicOperation
INPInput a value → ACC
OUTOutput ACC
LDA xLoad value at address x → ACC
STA xStore ACC → address x
ADD xACC = ACC + value at x
SUB xACC = ACC − value at x
BRA xBranch always → address x
BRZ xBranch to x if ACC = 0
BRP xBranch to x if ACC ≥ 0
HLTHalt the program
DATDefine a data value / label a memory location

Addressing modes:

Immediate addressing
Operand IS the actual value. LDA #5 loads the value 5.
Direct addressing
Operand is the memory address containing the value. LDA 50 loads value at address 50.
Indirect addressing
Operand is address that contains the address of the value. Extra memory access needed.
Indexed addressing
Operand + value in index register = effective address. Used for arrays.

1.3 - Exchanging data

1.3.1  Compression, encryption and hashing

Lossy compression
Permanently removes data, so the original cannot be perfectly reconstructed. Smaller files. Used for images (JPEG), audio (MP3), video (MP4). Acceptable quality loss for the use case.
Lossless compression
Original data perfectly reconstructed on decompression. Used for text, executables, ZIP. Smaller reduction in size than lossy.
Run Length Encoding (RLE)
Replaces consecutive repeated values with a count and value. E.g. AAABBBBA → 3A4B1A. Effective for images with large areas of the same colour.
Dictionary coding (LZW)
Builds a dictionary of repeated patterns. Replaces patterns with shorter dictionary references. Effective for text with repeated words/phrases.

Symmetric encryption
Same key used to encrypt and decrypt. Fast. Problem: key must be securely shared. Examples: AES, DES. Used for encrypting large data.
Asymmetric encryption
Public key encrypts, private key decrypts. No need to share private key. Slower. Used for key exchange, digital signatures. Examples: RSA. Used in HTTPS handshake.

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

Flat file
All data in one table. Simple but leads to data redundancy and update anomalies.
Relational database
Data split into multiple related tables. Linked by keys. Reduces redundancy. More complex to query.
Primary key
Unique identifier for each record in a table. Cannot be null.
Foreign key
Field in one table that is the primary key of another. Creates a link between tables.
Secondary key
Non-unique field used for searching/indexing. Speeds up queries.
Referential integrity
Foreign key values must match an existing primary key value, or be null. Prevents orphaned records.

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:

SELECT column1, column2 FROM table1 WHERE condition ORDER BY column1 ASC INNER JOIN table2 ON table1.id = table2.id;

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:

Atomicity
Transaction is all-or-nothing. If any part fails, the whole transaction is rolled back.
Consistency
Transaction brings database from one valid state to another. All rules/constraints maintained.
Isolation
Concurrent transactions execute as if sequential. Intermediate states not visible to other transactions.
Durability
Once committed, transaction persists even after system failure.

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

TCP/IP stack (4 layers):

Application layer
Protocols: HTTP, HTTPS, FTP, SMTP, POP3, DNS. User-facing communication.
Transport layer
TCP (reliable, ordered, connection-oriented) or UDP (fast, connectionless). Breaks data into segments. Port numbers.
Internet/Network layer
IP addressing and routing. Packets routed across networks. IPv4 (32-bit) and IPv6 (128-bit).
Network access/Link layer
Physical transmission. MAC addresses. Ethernet, Wi-Fi. Converts to electrical/optical/radio signals.

DNS (Domain Name System): translates domain names (e.g. example.com) to IP addresses. Hierarchical: root servers → TLD servers → authoritative servers.

LAN (Local Area Network)
Small geographic area (building/campus). Organisation owns infrastructure. High speed. Uses Ethernet/Wi-Fi.
WAN (Wide Area Network)
Large geographic area (country/world). Uses third-party infrastructure (ISP). The internet is the largest WAN.
Packet switching
Data split into packets. Each routed independently and can take different paths. Reassembled at destination. Efficient for bursty data. Internet uses this.
Circuit switching
Dedicated physical path established for entire communication. Guaranteed bandwidth. Inefficient (path reserved even when idle). Used in traditional phone networks.

Network security: firewalls (filter packets by rules), proxies (intermediate server that hides client IP and caches content), encryption (TLS/HTTPS).

Client-server
Central server provides services to clients. Centralised management. Server = single point of failure. Examples: web servers, email servers.
Peer to peer (P2P)
Each node acts as both client and server. Decentralised. No single point of failure. Harder to manage. Examples: BitTorrent, blockchain.

Network hardware: switch (connects devices in LAN, uses MAC addresses), router (connects networks, uses IP addresses), NIC (network interface card), WAP (wireless access point).

1.3.4  Web technologies

HTML
HyperText Markup Language. Defines structure and content of web pages. Uses tags: <h1>, <p>, <a>, <form>.
CSS
Cascading Style Sheets. Defines presentation/styling: colours, fonts, layout. Separates style from content.
JavaScript
Client-side scripting. Adds interactivity. Runs in the browser. Manipulates the DOM.

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.

Client-side processing
Code runs on the user's device (browser). JavaScript. Fast, with no server round trip. Can access local resources. Less secure, as code is visible.
Server-side processing
Code runs on the server. PHP, Python, Node.js. More secure, as code is hidden. Database access. Slower, as it requires a network request.

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:

AND mask
Used to check or clear specific bits. Masking with 1 preserves bit; with 0 clears bit.
OR mask
Used to set specific bits. Masking with 1 sets bit; with 0 preserves bit.
XOR mask
Used to toggle specific bits. XOR with 1 flips bit; with 0 preserves bit. Also used in simple encryption.
Logical shift left
Shifts bits left, fills with 0s on right. Equivalent to multiplying by 2 per shift.
Logical shift right
Shifts bits right, fills with 0s on left. Equivalent to integer division by 2 per shift.

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

Array
Fixed-size, same data type, indexed. Up to 3D. Fast random access O(1). Slow insertion/deletion.
Record
Collection of related fields of different data types. Like a row in a database.
List
Ordered, variable size, can hold mixed types (in some languages). Dynamic.
Tuple
Immutable ordered sequence. Cannot be changed after creation. Faster than lists.
Stack
LIFO (Last In First Out). Operations: push, pop, peek, isEmpty. Used for: function call stack, undo, expression evaluation, depth-first search.
Queue
FIFO (First In First Out). Operations: enqueue, dequeue, peek, isEmpty. Used for: scheduling, breadth-first search, print spooling. Circular queue avoids wasted space.
Linked list
Nodes containing data + pointer to next node. Dynamic size. O(1) insertion/deletion if position known. O(n) search. No random access.
Binary search tree
Left child < parent < right child. O(log n) search/insert if balanced. O(n) if unbalanced (degenerates to linked list).
Hash table
Key → hash function → index. O(1) average search/insert. Collisions handled by chaining or open addressing. Used for dictionaries, caches, sets.
Graph
Nodes (vertices) connected by edges. Directed (one-way) or undirected. Weighted (edges have costs) or unweighted. Used for networks, maps, social graphs.

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):

De Morgan's Laws
The NOT of an AND is the OR of the NOTs, and vice versa. Used to convert between NAND/NOR and equivalent AND/OR/NOT expressions.

¬(A ∧ B) ≡ ¬A ∨ ¬B
¬(A ∨ B) ≡ ¬A ∧ ¬B
Distribution
AND distributes over OR, and OR distributes over AND — analogous to multiplication over addition in arithmetic.

A ∧ (B ∨ C) ≡ (A ∧ B) ∨ (A ∧ C)
A ∨ (B ∧ C) ≡ (A ∨ B) ∧ (A ∨ C)
Association
The grouping of operands does not affect the result. Brackets can be rearranged freely when all operators are the same.

A ∧ (B ∧ C) ≡ (A ∧ B) ∧ C
A ∨ (B ∨ C) ≡ (A ∨ B) ∨ C
Commutation
The order of operands does not affect the result. A AND B gives the same output as B AND A.

A ∧ B ≡ B ∧ A
A ∨ B ≡ B ∨ A
Double negation
Negating a value twice returns the original value. Two NOTs cancel each other out.

¬(¬A) ≡ A
Absorption
A variable absorbs a more complex expression that already contains it, simplifying directly back to that variable.

A ∧ (A ∨ B) ≡ A
A ∨ (A ∧ B) ≡ 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

1.5.1  Computing-related legislation

Data Protection Act 1998
Controls how personal data is collected, stored and used. Principles: data must be fairly obtained, used only for stated purpose, accurate, not kept longer than necessary, kept secure. Individuals have right to access their data.
Computer Misuse Act 1990
Three offences: (1) unauthorised access to computer material, (2) unauthorised access with intent to commit further offences, (3) unauthorised modification of computer material (malware, deleting files).
Copyright, Designs and Patents Act 1988
Protects original works (software, music, text, images) from being copied without permission. Software piracy is illegal. Licences define permitted use.
Regulation of Investigatory Powers Act 2000 (RIPA)
Governs interception of communications. Allows government/law enforcement to monitor communications with authorisation. Covers internet and phone surveillance.

1.5.2  Moral and ethical issues

Computers in the workforce
Automation displaces jobs. New jobs created in tech. De-skilling. Digital divide: those without tech skills are left behind.
Automated decision making
Algorithms making decisions (loan approvals, sentencing, hiring). Concerns: bias, lack of transparency, accountability, right to explanation.
Artificial intelligence
Opportunities: healthcare, efficiency, safety. Risks: job displacement, bias, autonomous weapons, loss of human control, existential risk.
Environmental effects
Data centres consume huge energy. E-waste from discarded devices. Carbon footprint of internet. Green computing initiatives.
Censorship and the internet
Governments blocking content. Protecting children vs free speech. The Great Firewall of China. Net neutrality debates.
Monitoring behaviour
Employers monitoring employees. Government surveillance. Smart devices collecting data. Consent and transparency issues.
Analysing personal information
Big data analytics. Targeted advertising. Social credit systems. GDPR protections vs commercial interests.
Piracy and offensive communications
Illegal copying of software/media. Cyberbullying, hate speech, extremism online. Challenges of moderation at scale.