1. Fundamentals: Moore's Law, Quantitative Design and Performance
Description
Moore's Law (Gordon Moore, Intel co-founder, 1965; revised 1975) observes that the number of transistors on an integrated circuit doubles roughly every two years. Some sources quote 18-24 months; the 18-month figure is usually attributed to Intel's David House and refers to performance, not transistor count. The law drove decades of cheaper, faster, smaller chips.
Why it matters and why it is slowing:
- Miniaturization: smaller transistors pack more logic per chip and switch faster (process nodes shrank from 10 µm in the 1970s to about 3 nm today).
- Clock speed: measured in GHz (billions of cycles per second). Frequencies stopped rising around 2004 because of the power wall.
- Dennard scaling (power density stays constant as transistors shrink) ended around 2004, so more transistors no longer meant free speed. The industry moved to multicore, parallelism and specialization.
- Physical and economic limits: leakage current, heat, lithography cost. 3D stacking and chiplets help continue progress.
Quantitative design means making architecture decisions with measured numbers (latency, throughput, energy, cost) rather than intuition. Hennessy and Patterson's guiding ideas:
- Take advantage of parallelism (data, instruction, thread, request level).
- Exploit the principle of locality (temporal and spatial).
- Focus on the common case (optimize what happens most often).
- Amdahl's Law limits what any single improvement can deliver.
- The Processor Performance Equation ties it all together.
Key Formulas
Speedup (X vs Y) = Time_old / Time_new = Perf_new / Perf_old
CPU time = Instruction count (IC) × CPI × Clock period
= IC × CPI / Clock rate
CPI (weighted) = Σ (fraction_i × CPI_i)
Amdahl: Speedup_overall = 1 / [ (1 − f) + f / s ]
f = fraction of ORIGINAL time that benefits, s = speedup of that part
Upper limit as s → ∞ : 1 / (1 − f)
MIPS = IC / (Time × 10⁶) = Clock rate / (CPI × 10⁶)
FLOPS = floating-point operations per second
Performance metrics to know:
| Metric | Meaning |
|---|---|
| Latency (response time) | Time to finish one task |
| Throughput (bandwidth) | Tasks completed per unit time |
| Energy efficiency | Work per joule (e.g. FLOPS/W) |
| Dependability | Availability = MTTF / (MTTF + MTTR) |
| Benchmark suites | Standard programs (e.g. SPEC CPU) to compare machines fairly; summarize with the geometric mean of ratios |
Steps
To compare two machines: (1) fix the workload, (2) measure execution time on each, (3) speedup = slower time ÷ faster time.
To find CPU time: (1) get IC from the compiler/profiler, (2) get CPI (weighted by instruction mix), (3) get clock period, (4) multiply.
To apply Amdahl: (1) find the fraction f of original time the improvement touches, (2) find the speedup s of that fraction, (3) plug into the formula, (4) check against the 1/(1 − f) ceiling.
Worked Example
A. Transistor growth. A chip has 2 billion transistors in 2020. Doubling every 2 years gives 2 × 2⁵ = 64 billion in 2030 (5 doublings in 10 years).
B. Speedup. Program takes 12 s on X and 8 s on Y. Speedup of Y over X = 12/8 = 1.5, meaning Y is 50% faster.
C. CPU time. IC = 2 × 10⁹, CPI = 1.5, clock = 3 GHz. CPU time = (2 × 10⁹ × 1.5) / (3 × 10⁹) = 1.0 s.
D. Weighted CPI. Mix: ALU 50% (CPI 1), loads 20% (CPI 2), stores 10% (CPI 2), branches 20% (CPI 3). CPI = 0.5(1) + 0.2(2) + 0.1(2) + 0.2(3) = 0.5 + 0.4 + 0.2 + 0.6 = 1.7.
E. Amdahl, single enhancement. A part that uses 40% of execution time is made 10× faster. Speedup = 1 / (0.6 + 0.4/10) = 1 / 0.64 = 1.5625. Even a 10× boost on 40% of the work yields only 1.56×.
F. Amdahl, parallel cores. Program is 95% parallelizable.
| Cores | Speedup |
|---|---|
| 8 | 1 / (0.05 + 0.95/8) = 5.93 |
| 64 | 1 / (0.05 + 0.95/64) = 15.4 |
| ∞ | 1 / 0.05 = 20 (hard ceiling) |
Example: 90% parallelizable → maximum speedup 1/0.1 = 10×.
G. MIPS and peak FLOPS. 3 GHz, CPI 1.5 → 3000 / 1.5 = 2000 MIPS. A core with two 256-bit FMA units does 2 units × 4 doubles × 2 FLOP = 16 DP FLOP/cycle, so 8 cores at 3 GHz peak at 8 × 3 × 16 = 384 GFLOPS.
Python / Assembly
def speedup(t_old, t_new):
return t_old / t_new
def cpu_time(ic, cpi, clock_hz):
return ic * cpi / clock_hz
def weighted_cpi(mix): # mix = [(fraction, cpi), ...]
return sum(f * c for f, c in mix)
def amdahl(f, s):
return 1.0 / ((1 - f) + f / s)
print(cpu_time(2e9, 1.5, 3e9)) # 1.0
print(round(weighted_cpi([(.5,1),(.2,2),(.1,2),(.2,3)]), 2)) # 1.7
print(amdahl(0.4, 10)) # 1.5625
print([round(amdahl(0.95, n), 2) for n in (8, 64, 10**9)]) # [5.93, 15.42, 20.0]
Measuring cycles on real hardware (x86-64 and RISC-V read a cycle counter):
# RISC-V: read the cycle counter before and after a code region
rdcycle t0
# ... code under test ...
rdcycle t1
sub t2, t1, t0 # cycles elapsed
Notes
- Common mistake: lowering voltage does not reduce power "exponentially." Dynamic power depends on V² (quadratic). See Topic 4.
- MIPS is a poor cross-machine metric: it ignores instruction complexity (a CISC instruction does more than a RISC one). Use execution time on real programs.
- Amdahl's f is the fraction of original time. Using the fraction of the new time is a common mistake.
- Higher clock rate alone does not mean faster: IC and CPI also change with design.
- Quick facts: Moore proposed it in 1965; it is slowing but 3D stacking sustains progress; key metrics are latency, throughput and energy efficiency.
References: [HP6] Ch. 1 (1.1-1.9); [PH-RV] Ch. 1; Moore, "Cramming More Components onto Integrated Circuits," Electronics, 1965; Amdahl, "Validity of the Single Processor Approach to Achieving Large Scale Computing Capabilities," AFIPS 1967;
All rights remain with the original author (Algo-holics). Publishing here does not grant a license to copy or reuse this text. Copyright & license. If you noticed a mistake or copyright issues, please contact: lebroskiofficial@proton.me