A1.1: Computer Hardware and Operation
1. Main CPU Components, Registers, Buses, and Architectures (A1.1.1)
The Central Processing Unit (CPU) is the primary computational engine responsible for executing machine instructions and coordinating data movement across the computer system.
Functional Units
Arithmetic Logic Unit (ALU): Performs all arithmetic calculations (e.g., addition, subtraction, multiplication, division) and logical operations (e.g., AND, OR, NOT, comparisons). It is where actual data computation occurs.
Control Unit (CU): Orchestrates the fetch-decode-execute cycle. It fetches instructions from memory, decodes opcodes (operation codes) and operands, and generates electrical control signals to activate hardware components.
Key CPU Registers
Registers are small-capacity, ultra-fast temporary storage locations inside the CPU chip itself.
Instruction Register (IR): Holds the current binary instruction being decoded and executed.
Program Counter (PC): Stores the memory address of the next instruction to be executed. It increments automatically after each instruction is fetched to point to the subsequent memory address in sequence.
Memory Address Register (MAR): Stores the target RAM address from which data/instructions need to be read or to which data must be written. It interfaces directly with the system address bus.
Memory Data Register (MDR): Holds the actual data byte or instruction bitstream received from primary memory or ready to be written into RAM.
Accumulator (AC): A special-purpose workspace register that stores intermediate arithmetic or logical results generated by the ALU before they are saved back to memory.
System Buses
Buses are shared parallel communication pathways (printed circuit tracks or wires) transferring data, memory addresses, and control signals:
Address Bus: Unidirectional pathway that carries target memory addresses from the CPU to primary memory/peripherals. The width of the address bus (number of physical wires) dictates the maximum memory space the CPU can address.
Data Bus: Bidirectional pathway that carries actual data bytes and instruction code between the CPU, memory, and external devices. Its width (e.g., 32-bit, 64-bit) determines how many bits can be transferred in a single memory operation.
Control Bus: Transfers control, timing, and acknowledgment signals generated by the CU (e.g., read/write commands, clock pulses, interrupt requests, and acknowledgment signals).
Processor Configurations
Single-Core Processors: Contain a single processing core that executes instructions sequentially along a single pipeline. They struggle with parallel processing demands, leading to bottlenecks during complex multitasking.
Multi-Core Processors: Integrate two or more independent processing cores on a single integrated circuit die or package. Each core can execute separate instruction threads simultaneously, improving multitasking efficiency and processing throughput.
Co-processors: Specialized auxiliary processors designed to offload specific compute-intensive tasks from the primary CPU (e.g., GPUs for graphics rendering, or Digital Signal Processors / DSPs for audio signal processing).
2. Graphics Processing Units (GPUs) and CPU Comparison (A1.1.2 & A1.1.3 — HL Only)
GPU Role & Architecture
A Graphics Processing Unit (GPU) is a specialized electronic circuit designed with a highly parallel architecture containing hundreds or thousands of smaller processing cores operating simultaneously.
Key Characteristics: Optimized for high throughput and SIMD (Single Instruction, Multiple Data) operations, where a single instruction is applied across large multidimensional datasets concurrently.
High-Speed Memory: Equipped with specialized VRAM (Video RAM) providing extremely high memory bandwidth to manage large texture maps and complex datasets without buffering delays.
Real-World Applications: 3D graphics rendering in video games, AI/machine learning (matrix and tensor computations in neural networks), scientific modeling (climate simulations, DNA sequencing), video editing/encoding, and cryptocurrency mining.
CPU vs. GPU Comparison
Feature / Characteristic | Central Processing Unit (CPU) | Graphics Processing Unit (GPU) |
|---|---|---|
Design Philosophy | Prioritizes low latency, high single-thread speed, and flexibility across diverse instruction types. | Prioritizes high throughput and massive parallelism on repetitive data tasks. |
Core Architecture | Few, highly powerful cores with large caches and advanced branch prediction. | Thousands of smaller, simpler cores operating concurrently at lower clock speeds. |
Instruction Set Architecture (ISA) | Versatile ISA supporting complex logical operations, dynamic branches, and OS control commands. | Specialized ISA tailored for mathematical transformations, SIMD tasks, and texture mapping. |
Memory Access | Uses a multi-tiered, low-latency cache hierarchy (L1/L2/L3) to minimize delay. | Uses high-bandwidth memory (VRAM) or unified memory to feed thousands of parallel cores. |
Power Efficiency | Managed via Dynamic Voltage & Frequency Scaling (DVFS) within a strict Thermal Design Power (TDP) envelope. | High overall power consumption, but higher performance per watt when executing parallel tasks. |
CPU-GPU Collaboration
In modern systems, the CPU acts as the main system controller—running the OS, managing network I/O, and handling decision-making logic—while offloading parallelizable, data-heavy workloads to the GPU. Data is transferred between primary RAM and VRAM across high-speed interconnects like the PCIe (Peripheral Component Interconnect Express) bus, or shared directly in unified memory architectures.
3. Primary Memory Hierarchy and Optimization (A1.1.4)
Types of Primary Memory
Registers: Tiny, ultra-fast memory units located directly inside the CPU; access latency ranges between 0.2 and 0.5 nanoseconds.
Cache Memory (L1, L2, L3): High-speed static RAM (SRAM) acting as a buffer between the CPU registers and main RAM.
L1 Cache: Smallest and fastest (3–7 ns access time), located directly on each core.
L2 Cache: Larger than L1, slightly slower (5–10 ns access time).
L3 Cache: Largest cache tier, shared across all processor cores (10–40 ns access time).
Random-Access Memory (RAM): Volatile primary workspace holding the active operating system, running applications, and working data. Access time is 50–70 nanoseconds. 32-bit systems can address a maximum of ~4 GB of RAM, whereas 64-bit systems handle significantly larger capacities.
Read-Only Memory (ROM): Non-volatile memory holding essential startup firmware (such as BIOS or UEFI). It retains its code when power is disconnected, enabling the hardware boot-up sequence.
Cache Locality & Optimization
Modern CPUs optimize memory performance using specific techniques:
Spatial Locality: Assumes that data located near recently accessed memory addresses will likely be needed soon, prefetching adjacent memory blocks into cache.
Temporal Locality: Assumes that data accessed recently will be accessed again in the near future, retaining those items in cache.
Cache Hit vs. Cache Miss:
Cache Hit: The requested data/instruction is found in cache, resulting in near-instant access.
Cache Miss: The requested item is not found in cache; the CPU must pause and fetch it from slower main RAM (or virtual memory), increasing latency.
4. The Fetch-Decode-Execute Cycle (A1.1.5)
The continuous operational cycle performed by the CPU to process machine language code involves three primary stages:
+-------------------------------------------------------------------+
| 1. FETCH PHASE |
| - Address in PC sent to MAR. |
| - Read signal sent over Control Bus. |
| - Memory location read; instruction placed on Data Bus into MDR. |
| - Instruction copied from MDR to IR. |
| - PC incremented to point to the next instruction address. |
+-------------------------------------------------------------------+
|
v
+-------------------------------------------------------------------+
| 2. DECODE PHASE |
| - CU parses instruction in IR. |
| - Opcode identified (operation to execute, e.g., ADD, LOAD). |
| - Operands identified (data values or target registers). |
| - Addressing mode evaluated (direct, immediate, register). |
+-------------------------------------------------------------------+
|
v
+-------------------------------------------------------------------+
| 3. EXECUTE PHASE |
| - CU sends signals to execute command: |
| * Arithmetic/Logic: ALU computes result; updates AC / flags. |
| * Memory Read/Write: Addresses dispatched via MAR/MDR. |
| * Control/Branch: PC updated to jump target address. |
+-------------------------------------------------------------------+
Detailed Steps of System Bus Interaction
Memory Read Operation: The CPU places the memory address (e.g.,
0x1A3B) on the address bus, asserts a readsignal on the control bus, retrieves the data returned across the data bus into the MDR, and receives an acknowledge signal on the control bus.Memory Write Operation: The CPU sends the target address via the address bus, places the data byte (e.g.,
0x7E) on the data bus, asserts a write signal on the control bus, and waits for a completion acknowledgment signal.
5. Pipelining in Multi-Core Architectures (A1.1.6 — HL Only)
Concept of Pipelining
Pipelining splits instruction execution into distinct, sequential sub-stages—typically Fetch (F), Decode (D), Execute (E), and Write-Back (WB). Instead of waiting for one instruction to finish its entire cycle before fetching the next, the CPU overlaps these stages.
Time Unit | Core Stage 1 | Core Stage 2 | Core Stage 3 | Core Stage 4 |
|---|---|---|---|---|
T1 | Fetch Inst 1 | — | — | — |
T2 | Decode Inst 1 | Fetch Inst 2 | — | — |
T3 | Execute Inst 1 | Decode Inst 2 | Fetch Inst 3 | — |
T4 | Write-back 1 | Execute Inst 2 | Decode Inst 3 | Fetch Inst 4 |
Benefit: Significantly increases instruction throughput (number of instructions completed per unit time).
Multi-Core Parallel Execution
In multi-core processors:
Each core maintains its own independent execution pipeline and hardware registers, allowing threads to run truly in parallel.
Cores coordinate shared L2/L3 cache access using cache coherency protocols to ensure that modified data in one core's cache is accurately reflected across all other cores, maintaining data consistency and preventing memory conflicts.
6. Secondary Memory Storage (A1.1.7)
Secondary storage is non-volatile, persistent storage used to retain system files, programs, and user data when the power is turned off.
Internal Secondary Storage
Hard Disk Drives (HDDs): Magnetic storage utilizing rigid spinning platters coated with magnetic material and moving read/write heads. High storage capacity at a low cost per gigabyte, but slower access times (sustained transfer rates around 100–200 MB/s) and mechanical vulnerability.
Solid-State Drives (SSDs): Non-volatile flash storage constructed from NAND flash memory chips with no moving parts. Uses floating-gate transistors to trap electrical charges (representing 0s and 1s). Offers faster access times, lower latency, and high transfer speeds (2,500–7,000 MB/s). Drives use wear-leveling algorithms to distribute write/erase cycles evenly across flash blocks.
Embedded Multimedia Cards (eMMCs): Integrated flash memory ICs that combine NAND flash, an eMMC interface, and a controller on a single small board. Slower than SSDs, but inexpensive and compact; commonly used in smartphones, tablets, and budget laptops.
External Secondary Storage
External HDDs / SSDs: Portable drives connected via cables (e.g., USB, Thunderbolt) for data backup or expansion.
Optical Drives (CD/DVD/Blu-ray): Uses a laser diode to shine light onto a reflective polycarbonate disc surface. The laser detects variations in light reflection between microscopic pits (burned indentations) and lands (flat areas) along a single continuous spiral track.
Flash Drives & Memory Cards (SD/microSD): Portable NAND flash storage modules suitable for transferring files across handheld cameras, phones, and PCs.
Network Attached Storage (NAS): Dedicated multi-drive storage appliances connected directly to a network router. Often configured with RAID (Redundant Array of Independent Disks) for data redundancy and fault tolerance, serving centralized files to multiple network clients.
7. Data Compression (A1.1.8)
Compression reduces the digital size of files to conserve storage space and speed up network transmission speeds.
+---------------------------+
| DATA COMPRESSION |
+---------------------------+
|
+-------------------------+-------------------------+
| |
v v
+----------------------------------+ +----------------------------------+
| LOSSLESS COMPRESSION | | LOSSY COMPRESSION |
| - Preserves exact original data. | | - Permanently discards details |
| - 100% reversible upon decompression.| | unnoticeable to human senses. |
| - Lower compression ratios. | | - Irreversible process. |
| - Essential for text & code. | | - High compression ratios. |
| - Example: Run-Length Encoding. | | - Example: Transform Coding (DCT).|
+----------------------------------+ +----------------------------------+
Lossless Compression
Principle: Identifies and eliminates statistical redundancy without losing any original data bits. Decompressed files are 100% identical replicas of the source file.
Run-Length Encoding (RLE): Replaces consecutive repeated data elements (runs) with a single instance of the data value and its count.
Example: The sequence
AAAAABBBCC(10 chars) compresses to5A3B2C(6 chars).
Applications: Text documents, source code executables, archival zip files (ZIP, PNG, GIF, TIFF, PDF).
Lossy Compression
Principle: Permanently removes perceptually minor or redundant details that human eyes or ears cannot easily perceive. It is irreversible—the original uncompressed data cannot be reconstructed.
Transform Coding: Converts spatial or time-domain data into frequency-domain representations (e.g., using Discrete Cosine Transform / DCT), then quantizes high-frequency details that are less noticeable to human senses.
Applications: Digital media formats including JPEG images, MP3 audio, and MPEG/H.264 video streams.
8. Cloud Computing Service Models (A1.1.9)
Cloud computing provides remote, on-demand access to virtualized computing resources hosted in global data centers.
+--------------------------------------------------------------------+
| 1. SOFTWARE AS A SERVICE (SaaS) |
| - End-user applications hosted entirely in the cloud. |
| - Accessed via web browser; zero infrastructure management. |
| - Examples: Salesforce, Canva, SurveyMonkey, Google Apps. |
+--------------------------------------------------------------------+
^
|
+--------------------------------------------------------------------+
| 2. PLATFORM AS A SERVICE (PaaS) |
| - Development environment with runtime, OS, and databases. |
| - Developers write & deploy code without managing servers. |
| - Examples: Google App Engine, Heroku, Azure App Service. |
+--------------------------------------------------------------------+
^
|
+--------------------------------------------------------------------+
| 3. INFRASTRUCTURE AS A SERVICE (IaaS) |
| - Virtualized hardware: Virtual Machines, storage, networking. |
| - Highest control; customer manages OS, software, and runtime. |
| - Examples: AWS EC2/S3, Microsoft Azure, Google Cloud (GCP). |
+--------------------------------------------------------------------+
Summary Comparison of Cloud Models
Feature | Software as a Service (SaaS) | Platform as a Service (PaaS) | Infrastructure as a Service (IaaS) |
|---|---|---|---|
Control Level | Lowest: Managed entirely by vendor. | Medium: Control over application code and deployment. | Highest: Complete operational control over OS and software stack. |
Flexibility | Lowest: Fixed application feature set. | Medium: Customizable software logic. | Highest: Fully customizable hardware specs and OS environment. |
User Focus | Non-technical end-users, general consumer software access. | Application developers and software engineering teams. | Systems administrators, IT operations, enterprise architects. |
Primary Advantage | Highly cost-effective; turnkey availability with auto-updates. | Faster application deployment; abstracts system administration. | Highly scalable on-demand infrastructure without physical hardware investment. |