Key Formulas & Equations
Amdahl's Law: Speedup = 1 / [(1 β P) + P/S]
P = parallelizable fraction, S = number of processors
N = average number in system, Ξ» = arrival rate, W = average time in system
CPI: CPI = Ξ£ (CPIi Γ Instruction Frequencyi)
Bandwidth: BW = Data Transferred / Time
C = capacitance, V = voltage, f = frequency. Halving voltage reduces power to ΒΌ.
Core Concepts
The stored-program concept: instructions and data share the same memory. Components: ALU, control unit, memory, input/output. The fetch-decode-execute cycle: read instruction β interpret β perform β store result.
The contract between hardware and software. RISC (Reduced Instruction Set Computer): simple instructions, fixed length, load-store architecture. CISC (Complex Instruction Set Computer): variable-length instructions, complex addressing modes.
Overlapping execution of multiple instructions β like an assembly line. Stages: Fetch, Decode, Execute, Memory, Writeback. Hazards: structural (resource conflict), data (dependency), control (branches). Techniques: forwarding, branch prediction, out-of-order execution.
Multiple levels of storage balancing speed, cost, and size. Locality of reference: temporal (recently accessed likely again) and spatial (nearby data likely needed). Caches exploit both to bridge the processor-memory speed gap.
ILP (Instruction-Level): pipelining, superscalar, VLIW. TLP (Thread-Level): multi-core, SMT (Hyper-Threading). DLP (Data-Level): SIMD (SSE, AVX). MLP (Memory-Level): prefetching, multiple memory channels.
Core Definitions
Worked Examples
Program: 1 billion instructions, CPI = 1.5, clock rate = 3 GHz.
CPU Time = 10βΉ Γ 1.5 Γ (1/3Γ10βΉ) = 0.5 seconds
90% of a program can be parallelized using 10 processors:
Speedup = 1 / [(1β0.9) + 0.9/10] = 1 / (0.1 + 0.09) = 1/0.19 = 5.26Γ
Hit time = 2 cycles, miss rate = 5%, miss penalty = 100 cycles:
EAT = 2 + 0.05 Γ 100 = 2 + 5 = 7 cycles
Practice Problems
Answer: Instructions/sec = Clock Rate / CPI = 2Γ10βΉ / 2.5 = 800 MIPS
Answer: Speedup = 1/(1β0.7) = 1/0.3 = 3.33Γ maximum
Answer: EAT = 3 + 0.10 Γ 50 = 3 + 5 = 8 cycles
Answer: (0.7)Β² / (1.0)Β² = 0.49/1.0 = 51% reduction (power scales with VΒ²)
Answer: RISC: simple fixed-length instructions, load-store, many registers, compiler-optimized. CISC: complex variable-length instructions, memory-to-memory operations, fewer registers, hardware-optimized.