How Semiconductors and Transistors Actually Work
From silicon crystal lattices and P-N junctions to the quantum bandgap, MOSFET gate fields, and solid-state switching
“How does a microscopic slice of treated sand conduct or block electricity on command without any moving parts?”
Before semiconductors, electronic computation relied on vacuum tubes: hot, fragile glass bulbs that burned out like incandescent lightbulbs. The invention of the transistor replaced mechanical switches and thermionic emission with the quantum physics of solid silicon. By doping pure silicon crystals with trace amounts of phosphorus or boron, engineers create excess mobile electrons (N-type) or positive electron 'holes' (P-type). When joined, they form a self-limiting depletion barrier. In a modern MOSFET, an electric field applied across a nanometer-thin dielectric oxide layer attracts charges to form a conductive channel, allowing a tiny gate voltage to switch billions of electrons per second with zero moving components.
To understand the failure modes and edge cases detailed in this piece, we recommend familiarizing yourself with these foundational mechanisms first:
The Question That Changed Civilization
In 1946, the world’s most advanced electronic computer was the ENIAC (Electronic Numerical Integrator and Computer) at the University of Pennsylvania. It weighed 30 tons, occupied a 30-by-50-foot room, and consumed 150 kilowatts of electrical power—enough to run a modern suburban neighborhood.
Inside ENIAC were 17,468 vacuum tubes: hollow glass bulbs containing glowing metallic filaments.
Vacuum tubes worked, but they had a fatal mechanical flaw. Like incandescent lightbulbs, their heated filaments boiled off electrons through thermionic emission. They ran scorching hot, required hundreds of volts, and burned out constantly. On an average day, several tubes blew out during operation, halting military ballistics calculations while technicians crawled inside the machine with flashlights to locate and replace dead glass bulbs.
Engineers calculated that a computer with 100,000 vacuum tubes would be mathematically impossible to operate: tubes would burn out faster than technicians could swap them.
To break past this ceiling, humanity needed a switch that had no glowing filaments, no fragile glass vacuums, no high voltages, and no mechanical moving parts.
It needed a way to control the flow of electricity entirely within a cold, solid lump of matter.
That machine is the semiconductor transistor. Today, a single silicon chip smaller than your fingernail inside a smartphone contains over 15 billion transistors, each switching billions of times per second for years without burning out.
Here is the microscopic physics of how a treated grain of common beach sand became the brain of human civilization.
The Architecture of Silicon: Why Pure Sand Is an Insulator
To understand how a transistor switches, you must first look at the atomic architecture of Silicon (chemical symbol $\text{Si}$, atomic number 14).
Silicon is the second most abundant element in Earth’s crust, making up roughly 28% of its mass, primarily in the form of quartz sand ($\text{SiO}_2$).
An isolated atom of silicon has 14 protons in its nucleus and 14 electrons orbiting around it. These electrons arrange themselves in shells:
- 2 in the inner shell
- 8 in the middle shell
- 4 in the outermost valence shell
THE SILICON ATOM
[ 2 ] Inner shell (full)
[ 8 ] Middle shell (full)
──[ 4 ]── Valence shell (wants 8 to be stable)
Atoms are chemically stable when their outermost valence shell contains 8 electrons (the octet rule). Because silicon has exactly 4 valence electrons, it does not want to give them up (like a metal), nor does it greedily strip electrons from other atoms (like a halogen). Atoms are chemically stable when their outermost valence shell contains 8 electrons (the octet rule, explored in How the Periodic Table Organizes the Elements). Because silicon has exactly 4 valence electrons, it does not want to give them up (like an alkali metal), nor does it greedily strip electrons from other atoms (like a halogen).
Instead, in a solid crystal, each silicon atom forms covalent bonds with four neighboring silicon atoms. Each atom shares one electron with each neighbor, creating an orderly, rigid three-dimensional tetrahedral lattice known as the diamond cubic crystal structure: Instead, in a solid crystal, each silicon atom forms covalent bonds (see How Chemical Bonds Actually Form) with four neighboring silicon atoms. Each atom shares one electron with each neighbor, creating an orderly, rigid three-dimensional tetrahedral lattice known as the diamond cubic crystal structure:
PURE SILICON CRYSTAL LATTICE (ROOM TEMPERATURE)
: : :
... Si : : : : Si : : : : Si ...
: : :
: : :
... Si : : : : Si : : : : Si ...
: : :
: : :
... Si : : : : Si : : : : Si ...
: : :
(All 4 valence electrons tightly bound in covalent bonds;
zero free electrons available to carry electrical current)
In this pure crystal, every single valence electron is locked in place, binding the atoms together.
For an electric current to flow through any material, two conditions must be met:
- There must be charged particles (electrons).
- Those charged particles must be free to move.
In pure silicon at absolute zero ($-273.15^\circ\text{C}$), there are zero free electrons. Every electron is tied to its chemical bond. Pure silicon is therefore a complete electrical insulator.
Even at room temperature, thermal vibration only knocks an occasional electron loose—roughly one in every 100 billion atoms. This is called an intrinsic semiconductor, and its electrical conductivity is far too feeble to be useful in an electronic circuit.
The Quantum Ladder: Valence and Conduction Bands
In quantum physics, an electron inside a crystal lattice cannot possess arbitrary energy. It is restricted to specific energy bands:
Energy (E)
▲
│ ┌───────────────────────────────┐
│ │ CONDUCTION BAND │ ◄── Electrons here are free
│ │ (Empty in pure crystal) │ to move and carry current
│ └───────────────────────────────┘
│
│ ▲ BANDGAP ENERGY (Eg)
│ │ (Silicon: ~1.12 eV) ◄── FORBIDDEN ZONE
│ ▼
│ ┌───────────────────────────────┐
│ │ VALENCE BAND │ ◄── Electrons locked in
│ │ (Completely full of e⁻) │ covalent atomic bonds
│ └───────────────────────────────┘
└────────────────────────────────────────►
- The Valence Band: The low energy level where electrons remain locked in covalent bonds between atoms.
- The Conduction Band: The higher energy level where electrons break free from their atoms and can drift through the crystal lattice under an applied voltage.
- The Bandgap ($E_g$): The forbidden energy gulf between the two bands. No electron can exist with an energy inside this gap.
In conductors (like copper or gold), the valence band and conduction band overlap ($E_g = 0$). Copper electrons move with the slightest nudge of voltage.
In insulators (like glass or diamond), the bandgap is enormous ($E_g > 5\text{ eV}$). Knocking an electron into the conduction band requires so much energy that the material burns or shatters before it conducts.
In semiconductors (like silicon, $E_g \approx 1.12\text{ eV}$), the bandgap is modest. It is too large for electrons to cross easily on their own, but small enough that physicists can manipulate it.
The breakthrough of semiconductor engineering was the realization that we do not have to wait for heat to kick electrons across the bandgap. We can alter the crystal’s electrical behavior permanently by sprinkling in foreign atoms.
This chemical modification is called doping.
The Masterstroke: Doping Silicon
Doping does not mean contaminating silicon with random impurities. It is the ultra-precise substitution of one foreign atom for every one million to ten million silicon atoms inside an ultra-pure crystal (purified to $99.9999999%$ purity, or "nine nines").
Engineers use two distinct types of dopants to create two distinct types of silicon: N-type and P-type.
THE TWO FACES OF DOPED SILICON
N-TYPE (Phosphorus / Arsenic) P-TYPE (Boron / Gallium)
Group V: 5 valence electrons Group III: 3 valence electrons
: : : :
... Si : : : : Si ... ... Si : : : : Si ...
: : : :
: e⁻ (Extra electron) : [ ] (Missing electron: "Hole")
... Si : : : : P ... ... Si : : : : B ...
: : : :
... Si : : : : Si ... ... Si : : : : Si ...
: : : :
Negative charge carriers Positive charge carriers
(Mobile electrons) (Mobile positive holes)
1. N-Type Silicon: Creating Negative Mobile Carriers
To create N-type ("negative") silicon, engineers introduce trace amounts of an element from Group V of the periodic table, usually Phosphorus ($\text{P}$) or Arsenic ($\text{As}$).
Phosphorus has 5 valence electrons. When a phosphorus atom slips into the silicon lattice, four of its valence electrons form tight covalent bonds with the neighboring silicon atoms.
The fifth electron has no bond to hold it.
Because it does not participate in a bond, this fifth electron is bound to the phosphorus nucleus by a tiny fraction of energy—only about $0.045\text{ eV}$. At room temperature, ordinary ambient thermal energy kicks this fifth electron straight into the conduction band.
The electron is now free to wander through the crystal as a mobile charge carrier.
Because phosphorus "donates" a free electron, it is called a donor impurity. The silicon now has an abundance of negatively charged mobile electrons.
2. P-Type Silicon: Creating Positive "Holes"
To create P-type ("positive") silicon, engineers dope pure silicon with an element from Group III of the periodic table, usually Boron ($\text{B}$).
Boron has only 3 valence electrons. When boron takes the place of a silicon atom in the crystal, it shares its 3 electrons with three neighboring silicon atoms. But with the fourth neighbor, there is an empty seat: an unfulfilled covalent bond.
This missing electron in a bond is called an electron hole (or simply a hole).
A hole is not a physical particle; it is the absence of an electron where one ought to be. However, physics treats it as a mobile particle with a positive electrical charge ($+1.602 \times 10^{-19}\text{ C}$).
Why does a hole move?
Imagine a row of ten parking spaces with nine cars and one empty spot at the left end:
Position: [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ]
Initial: [ ] [🚗] [🚗] [🚗] [🚗] ◄── Empty space at #1
Step 1: [🚗] [ ] [🚗] [🚗] [🚗] ◄── Car moves left; space moves right to #2
Step 2: [🚗] [🚗] [ ] [🚗] [🚗] ◄── Car moves left; space moves right to #3
Step 3: [🚗] [🚗] [🚗] [ ] [🚗] ◄── Space moves to #4
When the car in space #2 moves left into space #1, the empty space moves right to #2. When the car in space #3 moves into space #2, the empty space moves to #3.
The physical objects (cars/electrons) move to the left. But the hole moves to the right.
In P-type silicon, an electron from an adjacent covalent bond jumps over to fill the boron atom's empty bond. That leaves behind a new hole at the adjacent atom. As electrons leap from bond to bond toward a positive voltage, the positively charged hole drifts smoothly toward the negative voltage.
Because boron "accepts" an electron from a neighbor, it is called an acceptor impurity.
The P-N Junction: The One-Way Gate
If you take a piece of N-type silicon and a piece of P-type silicon in isolation, both conduct electricity reasonably well. Neither is a switch.
The magic happens when you join them together inside a single continuous crystal lattice: the P-N Junction.
THE ANATOMY OF A P-N JUNCTION AT EQUILIBRIUM
P-TYPE REGION DEPLETION REGION N-TYPE REGION
(Mobile Positive Holes) (No Free Carriers) (Mobile Free Electrons)
┌─────────────────────────┬───────────────────┬─────────────────────────┐
│ │ Fixed Fixed │ │
│ (+) (+) (+) (+) │ Negative Positive│ (-) (-) (-) (-) │
│ │ Ions Ions │ │
│ (+) (+) (+) (+) │ [ ⊖ ] [ ⊕ ] │ (-) (-) (-) (-) │
│ │ │ │
│ (+) (+) (+) (+) │ [ ⊖ ] [ ⊕ ] │ (-) (-) (-) (-) │
│ │ │ │
│ (+) (+) (+) (+) │ [ ⊖ ] [ ⊕ ] │ (-) (-) (-) (-) │
└─────────────────────────┴───────────────────┴─────────────────────────┘
│◄── Built-in ────►│
│ Electric Field │
│ (E-field) │
│ ◄─── │
The moment the P-type and N-type regions meet, intense Brownian diffusion occurs:
- Free electrons in the N-region look across the boundary and see a P-region with virtually zero free electrons. They diffuse across the boundary into the P-side.
- Positive holes in the P-region diffuse across the boundary into the N-side.
- Near the boundary, migrating electrons fall into migrating holes and cancel each other out (recombination).
You might expect this diffusion to continue until the entire crystal is neutral. But it cannot.
When an electron leaves the N-side, it abandons the phosphorus atom it came from. The phosphorus atom has 15 protons and now only 14 electrons: it has become a fixed positive ion ($\text{P}^+$) locked rigidly into the crystal lattice.
When that electron crosses into the P-side and fills a hole in a boron atom, that boron atom now has 5 protons and 6 electrons: it has become a fixed negative ion ($\text{B}^-$).
Unlike electrons and holes, these ionized donor and acceptor atoms cannot move. They are welded into the crystal.
As more carriers diffuse, a wall of positive ions builds up on the N-side of the boundary, and a wall of negative ions builds up on the P-side of the boundary.
This zone stripped of all mobile charge carriers is called the Depletion Region.
The Equilibrium Barrier
The fixed ions create a permanent internal electric field pointing from the positive N-side back toward the negative P-side.
This electric field exerts an electrostatic force that repels any further electrons trying to cross from N to P, and repels any further holes trying to cross from P to N.
At room temperature in silicon, this internal barrier stabilizes at approximately 0.7 Volts.
Without any battery connected, current ceases entirely. The depletion region acts as an impenetrable insulating wall in the middle of the crystal.
Bias: Opening and Locking the Gate
Now connect an external battery to the P-N junction. Two things can happen depending on which way you wire the terminals:
REVERSE BIAS (NO CURRENT FLOWS)
(-) Battery Terminal (+) Battery Terminal
│ │
▼ ▼
┌───────────────┬─────────┬───────────────┐
│ P-Type │DEPLETION│ N-Type │
│ (Holes (-) │ REGION │(Electrons (+) │
│ pulled away) │ WIDENS! │ pulled away) │
└───────────────┴─────────┴───────────────┘
│◄───────►│
1. Reverse Bias (The Valve Closes)
Connect the negative terminal of a battery to the P-side and the positive terminal to the N-side:
- The positive battery terminal attracts mobile electrons away from the junction on the N-side.
- The negative battery terminal attracts mobile holes away from the junction on the P-side.
- The depletion region widens. The electrostatic barrier grows taller.
Except for a microscopic quantum leakage current (nanoamperes), zero electricity flows. The junction is an open switch.
FORWARD BIAS (MASSIVE CURRENT FLOWS)
(+) Battery Terminal (-) Battery Terminal
│ │
▼ ▼
┌───────────────┬───┬───────────────┐
│ P-Type │DEP│ N-Type │
│(Holes pushed │ L │(Electrons push│
│ toward center)│ │ toward center)│
└───────────────┴───┴───────────────┘
▲
Barrier collapses (>0.7V)
Electrons flood across junction!
2. Forward Bias (The Valve Opens)
Now reverse the battery: connect the positive terminal to the P-side and the negative terminal to the N-side:
- The negative terminal repels electrons on the N-side, pushing them toward the junction.
- The positive terminal repels holes on the P-side, pushing them toward the junction.
- Once the external voltage exceeds the internal barrier voltage ($\approx 0.7\text{ V}$), the depletion region collapses.
Electrons flood across the junction into the P-side and flow into the battery terminal. A massive, continuous current surges through the crystal.
The P-N junction is a diode: a solid-state, one-way electrical check valve.
The True Revolution: The MOSFET
A diode is useful for converting AC to DC, but it is not a computer switch. A computer switch must be a three-terminal device:
- Current enters through Terminal 1 (Source).
- Current exits through Terminal 2 (Drain).
- A third control terminal (Gate) turns the connection between Source and Drain ON or OFF without touching the current itself.
The device that runs every computer on Earth today is the MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor).
ANATOMY OF AN N-CHANNEL MOSFET (NMOS)
Gate Terminal (Control Voltage: V_G)
│
▼
┌─────────────────┐
│ Metal / Poly │ ◄── GATE TERMINAL
┌─────┴─────────────────┴─────┐
│ Dielectric Oxide (SiO₂ / Hf)│ ◄── INSULATOR (~1 nm)
SOURCE └─────────────────────────────┘ DRAIN
Terminal Terminal
│ │
▼ ▼
┌───────────┐ ┌───────────┐
│ N+ Well │ │ N+ Well │
│ (Heavy e⁻)│ │ (Heavy e⁻)│
└─────┬─────┴─────────────────────────────────────────────────┴─────┬─────┘
│ CONUCTIVE INVERSION CHANNEL │
│ (Forms when Gate Voltage V_G > V_th) │
│ │
└────────────────────── P-TYPE SUBSTRATE ─────────────────────┘
(Silicon Body)
The diagram below traces the structural hierarchy of a modern semiconductor transistor:
How a MOSFET Switches: The Field Effect
Look closely at the NMOS diagram above:
- The Source is a heavily doped N-type region ($N^+$) full of free electrons.
- The Drain is another heavily doped N-type region ($N^+$) full of free electrons.
- Between them lies the P-type substrate, which is full of holes and contains virtually no free electrons.
- Directly above the gap between Source and Drain sits a microscopically thin insulating layer: the gate dielectric (historically Silicon Dioxide, $\text{SiO}_2$; today high-$\kappa$ dielectrics like Hafnium Oxide).
- Atop this insulator sits the conductive Gate electrode.
Because the gate dielectric is a physical electrical insulator, no electrons can ever flow from the gate into the silicon. The gate is a capacitor.
Now look at what happens in the two states:
State 0: Gate Voltage is Zero ($V_G = 0\text{ V}$)
You connect a voltage between Source and Drain, trying to pull electrons from Source to Drain.
Can they move?
No. Between Source ($N^+$) and the P-substrate lies a reverse-biased P-N junction. The path is blocked by the depletion region.
The resistance between Source and Drain is virtually infinite ($>10^{10},\Omega$). The switch is OFF.
State 1: Positive Gate Voltage Applied ($V_G > V_{\text{threshold}}$)
You apply a positive voltage (such as $+0.8\text{ V}$) to the Gate electrode.
Because of the insulating oxide layer, no current flows into the gate. Instead, the positive charge on the gate creates an intense transverse electric field radiating down through the oxide into the P-type silicon below.
This electric field does two things simultaneously:
- It repels positive holes in the P-substrate downwards, pushing them away from the surface.
- It attracts the rare minority electrons in the P-substrate upwards toward the bottom of the oxide.
When the gate voltage crosses a critical threshold ($V_{\text{th}}$, typically $0.2\text{–}0.4\text{ V}$), the concentration of attracted electrons at the surface becomes greater than the concentration of holes.
The surface of the P-type silicon temporarily flips its electrical character, turning into N-type silicon!
This thin surface layer of attracted electrons is called the Inversion Layer or the Conductive Channel.
The channel forms a direct, unbroken bridge of free electrons connecting the N-type Source directly to the N-type Drain:
Source (N+) ═════════► [ Inversion Channel: Free e⁻ ] ═════════► Drain (N+)
Electrons rush across the bridge under the influence of the Source-Drain voltage. The resistance collapses from millions of ohms to a few hundred ohms. The switch is ON.
When you turn the gate voltage back to zero, the electric field collapses. The electrons in the channel disperse back into the crystal within picoseconds. The channel vanishes. The switch turns OFF.
Why the MOSFET Changed the Universe
The beauty of the field-effect transistor lies in its mechanical simplicity and efficiency:
- Pure Electrostatic Control: Because the gate is insulated by oxide, turning the switch ON requires no continuous current flow through the gate. It only takes a momentary surge to charge the gate capacitor.
- Zero Moving Components: A MOSFET switch has no springs, contacts, or filaments. It switches via the quantum redistribution of electrons inside a solid crystal lattice. It never wears out from physical friction.
- Extreme Miniaturization: In 1971, the Intel 4004 microprocessor had transistors with a gate length of $10,000\text{ nm}$ ($10\text{ microns}$). Today, leading-edge FinFET and GAA (Gate-All-Around) nanosheet transistors have gate lengths under 3 nanometers—the width of roughly 15 silicon atoms.
- Blazing Speed: Because electrons only need to travel a distance of a few nanometers across the inversion channel, a transistor can switch from OFF to ON in less than 10 picoseconds ($10^{-11}\text{ seconds}$). This is what allows CPUs to run at clock speeds exceeding 4 Gigahertz (4 billion cycles per second).
CMOS: How 0 and 1 Consume Zero Power
In early computers, transistors were wired with pull-up resistors. When the switch was ON, current flowed continuously from the power supply directly to ground, generating enormous heat even when the computer wasn't actively computing.
In 1963, Frank Wanlass at Fairchild Semiconductor invented CMOS (Complementary Metal-Oxide-Semiconductor).
CMOS pairs two opposite types of transistors together:
- NMOS (turns ON when gate is HIGH/1; turns OFF when gate is LOW/0)
- PMOS (turns ON when gate is LOW/0; turns OFF when gate is HIGH/1)
THE FUNDAMENTAL CMOS INVERTER (NOT GATE)
+V_DD (Power Supply: e.g. 1.0 V)
│
┌─────┴─────┐
│ PMOS │ ◄── Turns ON when Input is 0
└─────┬─────┘
│
INPUT ─────────────────┼──────────────── OUTPUT
│
┌─────┴─────┐
│ NMOS │ ◄── Turns ON when Input is 1
└─────┬─────┘
│
GND (0 V)
Look at what happens in both logical states:
- When Input is 0 ($0\text{ V}$): The PMOS turns ON, connecting the Output to $+V_{DD}$ (Logical 1). The NMOS turns OFF, disconnecting ground.
- When Input is 1 ($1\text{ V}$): The NMOS turns ON, connecting Output to Ground (Logical 0). The PMOS turns OFF, disconnecting $+V_{DD}$.
In both states, one of the two transistors is always completely OFF. There is never an open path connecting the power supply to ground!
A CMOS logic circuit consumes virtually zero electrical power while resting in a steady state (storing a 0 or a 1). It only consumes significant energy during the microscopic instant of switching, when both transistors momentarily transition.
By pairing NMOS and PMOS switches, engineers can assemble AND, OR, NOT, and XOR gates that consume minimal power and emit minimal heat—making it possible to pack 15 billion transistors into an iPhone without melting the casing in your pocket.
The Physical Foundation of Digital Thought
Every calculation in computer science—from adding two integers to calculating orbital mechanics, running an operating system, or sampling tokens in an artificial intelligence—is an abstract mathematical concept.
Yet that abstraction exists entirely as an illusion.
Beneath the software lies an architecture of physical logic gates (as explored in How Binary and Logic Gates Became Computation) orchestrated by clocked instruction decoders (as shown in How a CPU Executes an Instruction).
And beneath those gates lies the quantum physics of solid silicon:
- Millions of phosphorus atoms donating free electrons to N-wells.
- Boron atoms creating mobile positive holes in P-substrates.
- Depletion barriers holding back electrical currents.
- Dielectric oxide gates exerting electrostatic force to summon temporary inversion channels at the speed of light.
A microprocessor is not magic. It is an intricate city of billions of solid-state electronic valves etched into crystallized sand, synchronized by electricity, turning the fundamental laws of quantum electrodynamics into human thought.
Where to Go From Here
Explore companion architectures or dive deeper into downstream mechanisms.
How Special Relativity Warps Space and Time
Why does time slow down, why do physical objects shorten, and why does mass require infinite energy to reach the speed of light—and how did Einstein overthrow absolute Newtonian space?
How Electromagnetism Unifies Nature
Deep-dive following foundational explainer How Electromagnetism Unifies Nature
Verified Specifications & Architectural References
This explainer is grounded in primary-source engineering specifications, regulatory circulars, and standard documentation.
Solid State Electronic Devices (7th Edition)
The classic semiconductor physics textbook detailing carrier transport, energy band diagrams, P-N junction electrostatics, and field-effect transistor modeling.
Physics of Semiconductor Devices (4th Edition)
The definitive reference manual for device physicists, covering exact Poisson equation solutions across depletion zones and sub-micron MOSFET scaling.
The Solid State: An Introduction to the Physics of Crystals for Students of Physics, Materials Science, and Engineering
Clear pedagogical introduction to crystallography, covalent bonding, electronic band structures, and thermal generation of charge carriers.