š» GCSE Computer Science
Programming, algorithms, data representation, networks, and cyber security revision.
AQA
Edexcel
OCR
Programming Fundamentals
Variables & Data Types
- Integer: whole number (e.g. 5, -3)
- Float/Real: decimal number (e.g. 3.14)
- String: sequence of characters (e.g. "hello")
- Boolean: True or False
- Character: single character (e.g. 'A')
- Casting: converting between types ā e.g. int("5") converts string to integer
Sequence, Selection & Iteration
- Sequence: instructions run one after another, top to bottom
- Selection (IF statements): executes different code based on a condition
- Iteration (loops): FOR loops (known number of times), WHILE loops (condition-based)
Pseudocode ā Common Constructs
IF condition THEN ... ELSE ... ENDIF
FOR i ā 1 TO 10 ... NEXT i
WHILE condition DO ... ENDWHILE
x ā value (assignment)
OUTPUT "text"
INPUT x
Subroutines
- Procedure: a named block of code that performs a task; does not return a value
- Function: like a procedure but returns a value
- Parameters: variables passed into a subroutine
- Benefits: reduces repetition, easier to test and debug, improves readability
Exam Tip:
Know the difference between local variables (only exist inside a subroutine) and global variables (accessible anywhere). Examiners often ask about scope.
Data Structures
Arrays (Lists)
- A collection of values stored under one variable name, accessed by index
- Most languages are zero-indexed (first item = index 0)
- 1D array: a single row (e.g. scores[0], scores[1])
- 2D array: rows and columns (e.g. grid[row][col])
Records (Structs)
- A collection of related fields, each with a name and data type
- e.g. a student record might have name (string), age (integer), grade (char)
File Handling
- Open, read, write, and close files in programs
- Text files: store data as plain text; CSV files: comma-separated values
Algorithms
Searching Algorithms
- Linear search: check each item one by one ā works on unsorted lists; O(n)
- Binary search: repeatedly halve the search space ā requires sorted list; O(log n) ā much faster for large datasets
Sorting Algorithms
- Bubble sort: repeatedly swap adjacent items if in wrong order; simple but slow; O(n²)
- Merge sort: divide list in half repeatedly, then merge in order; efficient; O(n log n)
- Insertion sort: build sorted list one item at a time; efficient for small/nearly sorted lists
Computational Thinking
- Decomposition: breaking a problem into smaller parts
- Abstraction: removing unnecessary detail to focus on what's important
- Algorithmic thinking: creating step-by-step instructions to solve a problem
- Pattern recognition: identifying similarities between problems
Trace Tables
Used to track variable values as an algorithm runs ā each column is a variable, each row is an execution step. Essential for dry-running code in exams.
Hardware & Software
CPU Components
- ALU (Arithmetic Logic Unit): performs calculations and logical operations
- CU (Control Unit): directs data flow and manages the fetch-decode-execute cycle
- Registers: tiny, fast storage locations within the CPU (e.g. Program Counter, Accumulator)
- Cache: fast memory between CPU and RAM ā stores frequently used data
- Clock: controls the speed of the CPU in GHz; higher clock speed = more instructions per second
Von Neumann Architecture
- Fetch: PC holds address of next instruction; fetched from memory into MAR then MDR
- Decode: CU interprets the instruction
- Execute: ALU performs the operation
CPU Performance Factors
- Clock speed (GHz): higher = faster processing
- Number of cores: multi-core CPUs can handle multiple tasks simultaneously
- Cache size: larger cache = fewer slow RAM accesses
Types of Software
- System software: OS, utility programs, drivers
- Application software: word processors, browsers, games
- OS functions: file management, memory management, user interface, hardware communication
Data Representation
Binary & Number Systems
- Binary (base 2): uses 0 and 1; 1 bit = 0 or 1; 8 bits = 1 byte
- Denary (base 10): our everyday number system
- Hexadecimal (base 16): 0ā9, AāF; 1 hex digit = 4 bits (a nibble)
Binary to Denary Example
Bit values: 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
1 0 1 1 0 0 1 0 = 128 + 32 + 16 + 2 = 178
- To convert denary ā binary: repeatedly divide by 2, note remainders (bottom up)
- To convert binary ā hex: split into groups of 4 bits, convert each group
- Adding binary: 1+1 = 10 (carry the 1); overflow occurs when the result exceeds available bits
Character Encoding
- ASCII: 7-bit encoding; 128 characters; only covers English/basic symbols
- Unicode: 16-bit or 32-bit encoding; supports over 100,000 characters worldwide
Images
- Each pixel is stored as a binary value representing its colour
- Colour depth: number of bits per pixel (e.g. 8-bit = 256 colours)
- Resolution: number of pixels ā higher resolution = better quality but larger file size
- File size (bits) = image width Ć height Ć colour depth
Sound
- Analogue sound converted to digital via sampling
- Sample rate: number of samples per second (Hz) ā higher = better quality
- Bit depth: bits per sample ā higher = more accurate amplitude values
- File size (bits) = sample rate Ć bit depth Ć duration (seconds)
Compression
- Lossy: permanently removes data; smaller file; quality loss (e.g. MP3, JPEG)
- Lossless: no data lost; original can be fully restored; slightly larger (e.g. PNG, FLAC, ZIP)
- Run Length Encoding (RLE): a lossless method ā stores repeated values as a count+value pair
Storage & Memory
- RAM (Random Access Memory): primary storage; fast; volatile (loses data when power off)
- ROM (Read-Only Memory): stores BIOS/firmware; non-volatile; cannot be changed
- Secondary storage: permanent; slower than RAM. Types: HDD, SSD, optical (CD/DVD), USB
- HDD: uses magnetic platters; cheap, high capacity, slower, mechanical
- SSD: uses flash memory; faster, lighter, no moving parts, more expensive per GB
- Virtual memory: section of secondary storage used as extra RAM when RAM is full ā slower
Network Fundamentals
Types of Network
- LAN (Local Area Network): covers a small area (e.g. a school or office)
- WAN (Wide Area Network): covers large geographical areas (e.g. the internet)
- Client-server: dedicated servers manage resources; easier to manage and back up
- Peer-to-peer: all computers share resources equally; cheaper, less secure
Hardware
- Router: connects different networks and routes data packets between them
- Switch: connects devices within a LAN; sends data to specific device (not broadcast)
- NIC (Network Interface Card): allows a device to connect to a network
- WAP (Wireless Access Point): allows wireless connection to a LAN
Transmission Media
- Copper cable (Ethernet): cheap, reliable, susceptible to interference
- Fibre optic: uses light; very fast, no interference, expensive
- Wi-Fi: wireless; convenient; less secure, slower, signal degrades with distance/walls
Protocols & Layers
- Protocol: a set of rules for communication between devices
- TCP/IP: core internet protocol suite
- HTTP/HTTPS: web browsing (HTTPS is encrypted with SSL/TLS)
- FTP: file transfer
- SMTP, IMAP, POP3: email protocols
- DNS: translates domain names to IP addresses
The Internet
- IP address: unique numerical label for each device on a network (e.g. 192.168.1.1)
- IPv4: 32-bit addresses (about 4 billion); IPv6: 128-bit addresses (virtually unlimited)
- Packet switching: data split into packets, each routed independently, reassembled at destination
- Each packet has: source IP, destination IP, payload (data), packet number
- Web servers host websites; browsers request pages via HTTP; DNS resolves domain to IP
- HTML: structure; CSS: style; JavaScript: interactivity
- Cloud computing: storage and processing via remote servers on the internet
Cyber Security
Common Threats
- Malware: malicious software including viruses, worms, trojans, ransomware, spyware
- Phishing: fake emails/websites trick users into revealing credentials
- Brute force attack: trying all possible passwords until one works
- SQL injection: inserting malicious SQL code into input fields to access databases
- Man-in-the-middle: attacker intercepts communication between two parties
- DoS (Denial of Service): flooding a server with requests to make it unavailable
- Social engineering: manipulating people to reveal confidential information
Defences
- Strong passwords and multi-factor authentication (MFA)
- Firewalls: monitor and filter incoming/outgoing network traffic
- Encryption: scrambles data so only authorised parties can read it
- Anti-malware software: detects and removes malicious software
- Regular software updates: patch known vulnerabilities
- HTTPS and SSL/TLS certificates for secure web communication
- User access levels: give users only the permissions they need (principle of least privilege)
Ethical, Legal & Environmental Issues
Legislation
- Data Protection Act 2018 / GDPR: regulates how personal data is stored and used
- Computer Misuse Act 1990: makes unauthorised access and hacking illegal (three tiers)
- Copyright, Designs and Patents Act 1988: protects creative works from copying
- Freedom of Information Act 2000: right to access public authority data
Ethical Issues
- Privacy: surveillance, data harvesting by tech companies
- Artificial intelligence: bias in algorithms, job automation, decision-making
- Digital divide: unequal access to technology between different groups/countries
- Environmental impact: e-waste, energy consumption of data centres