Chapter 1 β What Is a Chip?
Before we can explain why bf16 beats fp16 for training, or why a 70-billion-parameter model wonβt fit on one GPU, we have to answer a more basic question: what is a chip? Not metaphorically β physically. What is the thing that PyTorchβs tensor.cuda() ultimately runs on?
This chapter starts at the very bottom: a grain of sand. Weβll build up through the transistor β the single most-manufactured object in human history β to the integrated circuit, and arrive at the two exponential curves (Mooreβs Law and Dennard scaling) whose rise and fall explain everything that follows in this guide, including why parallel hardware exists at all.
The one-sentence version: A chip is billions of microscopic electrical switches (transistors) etched into a sliver of silicon, wired together so that the patterns in which they switch on and off perform computation.
What a Chip Physically Is
A chip (or integrated circuit, IC, or die) is a small, flat piece of semiconductor β almost always silicon β onto which an enormous number of tiny electronic components, primarily transistors, have been fabricated and interconnected.
The vocabulary stack, from raw material to the thing in your server:
(refined sand)
300 mm disc
one chip
die + pins
what you buy
- Silicon is element 14 β the second-most-abundant element in Earthβs crust, the main ingredient of sand (silicon dioxide, SiOβ). It is a semiconductor: its ability to conduct electricity sits between a conductor (copper) and an insulator (glass), and β crucially β that conductivity can be controlled. That controllability is the whole game.
- A wafer is a polished disc of ultra-pure crystalline silicon, today usually 300 mm (β12 inches) in diameter, sliced from a single grown crystal. Hundreds of chips are fabricated on one wafer simultaneously (see Appendix A β How Chips Are Made).
- A die is one individual chip cut from the wafer.
- A package encases the die, protects it, spreads its heat, and fans its microscopic connections out to pins/balls you can solder to a board.
When this guide says βa chip,β we almost always mean the die: the active silicon where computation happens.
Why Silicon? The Semiconductor
To understand the transistor, you need one idea: you can change how well silicon conducts electricity by injecting impurities into it. This is called doping.
Pure silicon has 4 outer (valence) electrons, each locked into a bond with a neighbor β a tidy crystal with few free charge carriers, so it barely conducts. Doping breaks that tidiness on purpose:
- Dope with phosphorus/arsenic (5 valence electrons)
- One extra electron per dopant atom β free to move
- Majority carriers: electrons (β)
- Dope with boron (3 valence electrons)
- One missing electron β a "hole" β that moves
- Majority carriers: holes (+)
Put n-type and p-type silicon next to each other and you get a junction β the basis of diodes. Arrange three doped regions cleverly and you get the device that runs the modern world: the transistor.
The Transistor: A Voltage-Controlled Switch
The transistor used in essentially every digital chip is the MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor). Conceptually, it is dead simple: an electrical switch with no moving parts, flipped by a voltage.
An n-channel MOSFET (NMOS) has three terminals plus a body:
- Source and Drain β two n-type regions in a p-type substrate (where current flows in/out).
- Gate β a conductor sitting just above the channel between source and drain, separated by an ultra-thin insulating layer of oxide.
1
2
3
4
5
6
7
8
9
GATE (control voltage)
β
βββββββ΄ββββββ
β oxide β β ultra-thin insulator (a few atoms thick!)
ββββββͺββββββββββββͺβββββ
β n+ β channel β n+ β β apply +V to gate β channel turns conductive
β(S) β (p-type) β(D) β
ββββββ§ββββββββββββ§βββββ
p-type substrate (body)
How it switches:
- Gate voltage low (β0 V): the p-type channel separates source and drain. No current flows. The switch is OFF β logical 0.
- Gate voltage high (βVdd): the gateβs electric field pulls electrons into the channel, forming a conductive bridge (βinversion layerβ). Current flows from drain to source. The switch is ON β logical 1.
That is the atom of digital computing: a voltage on the gate decides whether current flows. No mechanical parts, switchable billions of times per second, and shrinkable to a few nanometers. A PMOS transistor is the mirror image (p-type source/drain in an n-type body) and conducts when the gate is low.
Why βfield-effectβ? The gate never touches the channel β itβs insulated by oxide. It controls the channel purely through its electric field. This is why the gate draws almost no steady-state current, which is what makes MOSFETs so energy-efficient to hold in a state.
CMOS: Why Transistors Come in Pairs
Modern logic is CMOS (Complementary MOS): every gate uses NMOS and PMOS transistors in complementary pairs. The payoff is enormous: in a static CMOS gate, there is (almost) no path from power to ground except during a switch. Power is consumed mainly when bits change, not when they sit still. This single property is why a phone can hold billions of transistors and not melt.
The energy to switch a CMOS gate once is approximately:
\[E_{\text{switch}} \approx \tfrac{1}{2}\, C V_{dd}^{2}\]where $C$ is the load capacitance and $V_{dd}$ is the supply voltage. Remember this formula β its quadratic dependence on voltage is the lever behind nearly every power-saving technique in this book, from low-voltage inference accelerators to DVFS.
From One Transistor to Tens of Billions
A single transistor is a switch. Wire a handful together and you get a logic gate (Chapter 2). Wire millions of gates together and you get an adder, a register, a core. Wire billions together and you get a GPU.
The leap that made this economical was the integrated circuit (Jack Kilby & Robert Noyce, 1958β59): fabricate all the transistors and their wiring together on one piece of silicon, instead of soldering discrete parts. A modern chip is a layered 3D structure β transistors on the bottom, then 10β20 metal interconnect layers stacked above to wire everything up.
How many transistors are we talking about? The growth is staggering β and the table below is your first lesson in reading hardware history (a skill weβll use constantly):
| Chip | Year | Transistors | Process node | Notes |
|---|---|---|---|---|
| Intel 4004 | 1971 | 2,300 | 10,000 nm | First commercial microprocessor |
| Intel 80486 | 1989 | 1.2 M | 1,000 nm | Early PC era |
| Intel Pentium 4 | 2000 | 42 M | 180 nm | The GHz race |
| NVIDIA G80 (first CUDA GPU) | 2006 | 681 M | 90 nm | GPGPU is born |
| Apple A14 (iPhone SoC) | 2020 | 11.8 B | 5 nm | A phone chip |
| NVIDIA H100 (Hopper GPU) | 2022 | 80 B | 4 nm (TSMC N4) | The AI workhorse |
| NVIDIA B200 (Blackwell) | 2024 | 208 B (2 dies) | 4 nm (TSMC 4NP) | Two dies, one package |
Note the units: from thousands to hundreds of billions in ~50 years. That is roughly a 10βΈΓ increase β the steepest sustained engineering trend in history. It has a name.
The Two Curves That Explain Everything: Moore & Dennard
Mooreβs Law β how many transistors
In 1965, Gordon Moore observed that the number of transistors economically placed on a chip was doubling roughly every ~2 years. This was never a law of physics β it was an economic and engineering trend, a self-fulfilling industry roadmap. It held for ~5 decades and is what filled the table above.
\[N_{\text{transistors}}(t) \approx N_0 \cdot 2^{\,t / 2}\quad (t \text{ in years})\]More transistors per chip means you can spend them on: more cores, bigger caches, wider vector units, dedicated matrix-multiply hardware (tensor cores), and so on. Every accelerator in Part III is, fundamentally, a different answer to the question: βnow that we have billions of transistors, what should we build with them?β
Dennard Scaling β how fast and how power-hungry
Mooreβs Lawβs quieter, more important partner was Dennard scaling (1974): as transistors shrink, you can also lower their voltage, so power density stays constant while both speed goes up and energy per operation goes down. For ~30 years this let clock frequencies climb from MHz to GHz βfor free.β
(Moore's Law continues)
leakage current explodes
the "Power Wall"
so⦠go parallel
Around 2005, Dennard scaling broke. Transistors kept shrinking, but voltage couldnβt keep dropping without leakage currents wasting too much power. Clock speeds stalled at a few GHz, where they remain today. The industryβs response defines the modern era:
If you canβt make one core faster, use the extra transistors to build more cores β and design hardware that does many operations in parallel. This is the hinge on which the rest of this guide turns: itβs why CPUs went multi-core, why GPUs (thousands of simple cores) became dominant, and ultimately why deep learning β an embarrassingly parallel pile of matrix multiplies β found a perfect hardware match. (We follow this thread explicitly in Chapter 8 and Chapter 27.)
What a βProcess Nodeβ (5nm, 3nm) Actually Means
Youβll see chips described by a node: βTSMC N5,β βIntel 4,β β3nm.β Historically the number was a real physical feature size (the gate length). Today it is essentially a marketing label for a generation of manufacturing technology β β3nmβ transistors are not literally 3 nm wide. What still holds: a smaller node generally means more transistors per mmΒ², lower energy per switch, and higher cost per wafer. We dissect this in Chapter 34 and Appendix A.
A Transistor as a Switch β in Code
To make the abstraction concrete, here is an NMOS/PMOS pair modeled as the Python switches they logically are, composed into a CMOS inverter (the simplest gate β output is the opposite of the input):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
def nmos(gate: int, source_when_on: int = 0) -> int | None:
"""N-channel MOSFET: conducts (passes source) when gate is HIGH (1)."""
return source_when_on if gate == 1 else None # None = high-impedance (open)
def pmos(gate: int, source_when_on: int = 1) -> int | None:
"""P-channel MOSFET: conducts when gate is LOW (0)."""
return source_when_on if gate == 0 else None
def cmos_inverter(a: int) -> int:
"""
PMOS pulls output HIGH (to Vdd=1) when input a=0.
NMOS pulls output LOW (to GND=0) when input a=1.
Exactly one transistor conducts -> almost no power wasted.
"""
pull_up = pmos(gate=a, source_when_on=1) # connects out to Vdd when a=0
pull_down = nmos(gate=a, source_when_on=0) # connects out to GND when a=1
out = pull_up if pull_up is not None else pull_down
return out
assert [cmos_inverter(a) for a in (0, 1)] == [1, 0] # NOT gate β
This is the whole idea in miniature: logic is what happens when you wire switches together. Chapter 2 builds every gate, then an adder, from exactly this primitive. Note the data here is a single bit (int 0/1) β the indivisible unit of information a transistor stores. Eight bits make a byte; the floating-point numbers your model is made of are just structured bundles of these bits (Chapter 3 and Chapter 23).
Why This Matters for Model Optimization
It may feel a long way from a MOSFET to a quantized LLM. It isnβt. Three facts established here drive decisions youβll make weekly:
Key Takeaways
- A chip is billions of transistors (voltage-controlled switches) fabricated in silicon and wired together by metal layers. Computation is the pattern of switching.
- The MOSFET switches based on a gate voltage; CMOS pairs make it so power is spent mostly when bits change ($E \approx \tfrac{1}{2}CV_{dd}^2$).
- Mooreβs Law (more transistors) gave us the budget for ever-bigger compute; Dennard scaling (free speed/efficiency) gave us frequency β until it ended around 2005.
- Dennardβs end forced the pivot to parallelism, which is the root cause of GPUs, accelerators, and the whole hardware story behind modern AI.
- Every optimization in this guide (quantization, sparsity, parallelism) is ultimately about spending a finite transistor, energy, and bandwidth budget wisely.
Next: Chapter 2 β Transistors to Logic, where we turn these switches into gates, adders, and the arithmetic units that actually multiply your matrices.