Sound – sampled at a rate (e.g., 44.1 kHz) with a bit depth (e.g., 16 bits). A 5‑second mono CD‑quality audio file: 44 100 samples × 5 s × 2 bytes ≈ 441 kB.
Compression
Lossless (e.g., Run‑Length Encoding, Huffman coding) – original data can be perfectly reconstructed.
Lossy (e.g., JPEG for images, MP3 for audio) – some information is discarded for higher compression ratios.
2 Communication & Networking
2.1 Basic Concepts
Network – a collection of devices (nodes) linked by communication channels.
Topology – physical or logical arrangement (star, bus, ring, mesh).
Protocol – a set of rules that governs data exchange (e.g., TCP, HTTP).
2.2 The OSI & TCP/IP Models
OSI Layer
TCP/IP Equivalent
Key Function
7 – Application
Application
High‑level services (email, web)
6 – Presentation
–
Data formatting, encryption
5 – Session
–
Connection management
4 – Transport
Transport
TCP/UDP – reliability, flow control
3 – Network
Internet
IP – addressing & routing
2 – Data Link
Link
Ethernet, Wi‑Fi – MAC addressing
1 – Physical
Physical
Copper, fibre, radio signals
2.3 IP Addressing & DNS
IPv4 – 32‑bit address written as four octets (e.g., 192.168.1.10).
Subnet mask separates network and host portions.
Domain Name System (DNS) translates human‑readable domain names to IP addresses.
Peer‑to‑Peer (P2P) – each node can act as both client and server (e.g., file‑sharing).
2.5 Cloud Computing (AS Level focus)
Delivery of services (IaaS, PaaS, SaaS) over the Internet.
Advantages: scalability, cost‑effectiveness; disadvantages: dependence on network, security concerns.
2.6 Practical Activity
Capture a simple HTTP request with Wireshark, identify the source/destination IP addresses, protocol (TCP), and the request line (“GET /index.html HTTP/1.1”). Discuss how the OSI layers are involved.
3 Hardware Components & Logic Circuits
3.1 Memory Hierarchy
Registers – fastest, located inside the CPU (few bytes).
Cache – small, fast SRAM (L1, L2, L3) sits between registers and main memory.
Main Memory – DRAM, volatile, accessed in nanoseconds.
Secondary Storage – magnetic disks, SSDs, optical media – slower but non‑volatile.
3.2 Logic Gates & Simple Circuits
Gate
Symbol
Boolean Expression
Truth Table (A B → Y)
AND
&
A ∧ B
00 → 0, 01 → 0, 10 → 0, 11 → 1
OR
≥1
A ∨ B
00 → 0, 01 → 1, 10 → 1, 11 → 1
NOT
¯
¬A
0 → 1, 1 → 0
NAND
⎕
¬(A ∧ B)
inverse of AND
NOR
⊽
¬(A ∨ B)
inverse of OR
XOR
⊕
A ⊕ B
1 when A≠B
Lab idea: build a half‑adder using two XOR gates and an AND gate; extend to a full‑adder and discuss how adders are combined to form an ALU.
3.3 Peripheral Devices & I/O Ports
Input devices – keyboard, mouse, sensors.
Output devices – monitor, printer, actuators.
Storage devices – HDD, SSD, USB flash.
I/O ports – parallel (e.g., printer), serial (UART, USB), and specialised buses (PCIe, USB‑C).
4 Processor Fundamentals
4.1 CPU Architecture Overview
Implements the Von Neumann stored‑program model: program instructions and data share the same memory.
Core components: Program Counter (PC), Memory Address Register (MAR), Memory Data Register (MDR), Instruction Register (IR), Accumulator/General‑purpose registers, Status/Condition Register (SR), Arithmetic‑Logic Unit (ALU), Control Unit.
Three bus systems:
Address bus – carries addresses from PC/MAR to memory/I/O.
Data bus – carries data between memory, MDR and registers.
Control bus – carries read/write, interrupt, clock, and reset signals.
4.2 Fetch‑Execute (F‑E) Cycle – Detailed Stages
Fetch (Instruction Fetch)
PC → MAR (address placed on the address bus).
Read signal asserted on the control bus.
Instruction word travels on the data bus → MDR → IR.
PC is incremented (or later altered by a branch).
Decode (Instruction Decode)
Control unit examines the opcode in IR.
Micro‑control signals are generated for the required functional units.
Addressing mode is resolved (immediate, direct, indirect, indexed/relative).
Execute (Operation)
ALU performs the operation specified by the opcode (add, AND, shift, compare, etc.).
For load/store, the effective address calculated here is sent to MAR.
Condition‑code flags in SR are updated as required.
Write‑back (Store)
Result from the ALU or memory is written to the destination register (ACC, Rn) or back to memory.
For a store instruction: MDR → data bus → memory (address from MAR).
For a branch/jump, PC is overwritten with the target address computed during Execute.
Timing Diagram (simplified)
Time → |---Fetch---|---Decode---|---Execute---|---Write‑back---|
PC | Addr | | | |
MAR | Addr | | | |
MDR | Instr | | | Result/Data |
IR | Instr | Instr | | |
ALU Op | | | Op Code | |
SR Flags | | | Updated | |
4.3 Registers – Micro‑operations in the Cycle
Register
Purpose (during F‑E)
Typical Size
Program Counter (PC)
Holds address of next instruction; incremented after fetch or loaded with branch target.
32 or 64 bits
Memory Address Register (MAR)
Temporarily stores any address the CPU wishes to read or write.
Same width as address bus
Memory Data Register (MDR)
Holds data being transferred to/from memory (instruction or operand).
Same width as data bus
Instruction Register (IR)
Stores the fetched instruction while it is decoded and executed.
Current PC and status register are saved (often on a stack).
PC is loaded with the address of the Interrupt Service Routine (ISR) from an interrupt vector table.
ISR executes; on return, the saved PC and SR are restored and normal execution resumes.
Interrupts enable multitasking, I/O handling and many security mechanisms.
4.6 Pipelining (Extended Concept)
Modern CPUs split the logical F‑E cycle into hardware stages (Fetch, Decode, Execute, Memory, Write‑back). Multiple instructions occupy different stages simultaneously, increasing instruction throughput while preserving the logical order for each instruction.
Pass 2 – Generate machine code, substitute symbolic addresses with numeric values from the table.
5.3 Common Addressing Modes (with one‑line examples)
Mode
Syntax (example)
CPU Action
Immediate
LDM #5
Operand 5 taken directly from the instruction.
Direct
LDM 1000
CPU reads memory location 1000.
Indirect
LDM @R2
R2 holds an address; value at that address is loaded.
Indexed
LDM (R3+4)
Effective address = contents of R3 + 4.
Relative (branch)
BR +8
PC ← PC + 8 (offset added to current PC).
5.4 Sample Mini‑Program (adds two numbers stored at 2000h and 2004h)
LDM 2000 ; Load first operand into ACC
ADD 2004 ; ACC ← ACC + M[2004]
STM 2008 ; Store result at 2008
HLT ; Halt the CPU
The F‑E cycle is performed four times – once for each instruction.
6 Bit Manipulation
Logical shifts – move bits left/right, inserting zeros. Useful for multiplication/division by powers of two.
Arithmetic shifts – preserve the sign bit when shifting right (signed division).
Masking – AND a value with a bit‑mask to isolate or clear particular bits.
Set / Clear – OR with a mask to set bits; AND with the complement of a mask to clear bits.
Example: clear bits 0‑3 of register R1
LDM R1 ; Load R1 into ACC
AND #0xFFF0 ; Mask with 1111 1111 1111 0000
STM R1 ; Store back to R1
7 Operating Systems – The Software Layer that Controls the CPU
Provides resource‑management: memory allocation, process scheduling, file handling, I/O control, and security.
Context switching – saves current PC, registers and SR (often on a stack), loads the state of another process, then resumes execution. This is a controlled use of the interrupt mechanism.
Manages privilege levels (user vs. kernel mode) to restrict direct access to privileged instructions and I/O ports, enhancing system security.
8 Language Translators – From Source Code to Machine Instructions
Translator
Typical Output
Key Characteristics (Cambridge focus)
Assembler
Machine code (binary) or object file
One‑to‑one mapping with assembly; uses a two‑pass process.
Translates high‑level language to machine code; may involve optimisation phases.
Interpreter
Executes statements directly (no permanent machine code)
Often used for scripting languages; each statement passes through the F‑E cycle at run‑time.
Regardless of the translator, the final step is the same: the CPU repeatedly performs the Fetch‑Decode‑Execute‑Write‑back cycle on the generated machine instructions.
9 Security, Data Integrity & Validation
Security – protecting data from unauthorised access or modification.
Privacy – ensuring personal data is not disclosed without consent.
Integrity – guaranteeing that data is accurate and uncorrupted.
CPU‑Level Safeguards
Privilege levels (user/kernel) prevent execution of privileged instructions by user programs.
Interrupt masking and control‑register flags (e.g., IF – Interrupt‑Enable) limit when external events can affect execution.
Parity bits, checksums and error‑detecting codes are generated by the ALU during data‑transfer operations.
Software‑Level Validation
Input checking, authentication, and authorisation complement hardware mechanisms.
Secure coding practices (e.g., avoiding buffer overflows) are essential for maintaining overall system security.
10 Ethics, Ownership & Professional Responsibility
Consider environmental impact – high‑frequency CPUs consume significant power; energy‑efficient design is a professional duty.
Assess societal effects – embedded systems in safety‑critical devices (medical, automotive) require rigorous testing and ethical awareness.
Follow professional codes of conduct (e.g., BCS Code of Conduct) – honesty, competence, and duty to protect user data.
11 Key Points to Remember
The Fetch‑Execute cycle is the fundamental loop that turns binary instructions into actions.
Each stage consists of several micro‑operations involving PC, MAR, MDR, IR, ACC, and SR.
Understanding the registers and bus connections is essential for debugging assembly programs and for designing simple CPUs.
Modern CPUs accelerate the logical cycle with pipelining, caches, wide buses, and parallelism, but the logical order of operations remains unchanged.
Interrupts, privilege levels, and OS scheduling are built on the basic F‑E mechanism and provide the foundation for multitasking, security, and resource management.
Assembly language, addressing modes, and bit‑manipulation instructions are direct manifestations of the underlying hardware actions described in the cycle.
Data representation, networking, and broader hardware concepts are integral parts of the Cambridge AS/A‑Level Computer Science syllabus and must be mastered alongside processor fundamentals.
Suggested diagram: Block diagram of a simple CPU datapath showing PC, MAR, MDR, IR, ACC, ALU, SR and the three buses (address, data, control). Arrows illustrate the data flow for each stage of the Fetch‑Execute cycle.
Support e-Consult Kenya
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources,
past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.