Lite / Textbooks / Digital Logic and Computer Architecture / Chapter 5
5. From silicon to switches
Introduction
Gates are made of transistors, and transistors are made of doped silicon. This chapter goes down a level: why silicon is a semiconductor, how adding small amounts of other elements creates p-type and n-type regions, how a MOSFET acts as a voltage-controlled switch, and how pairing two kinds of transistor (CMOS) builds gates that draw almost no current while they sit still.
Figure 5.1. A CMOS inverter (described in words)
A pMOS transistor connects the supply VDD to the output Y, and an nMOS transistor connects Y to ground. Input A drives both gates. When A is 0 the pMOS conducts and Y is 1; when A is 1 the nMOS conducts and Y is 0. Only one transistor is on at a time.
Explanation
Built from 3 School lessons. Each part is the lesson's own explanation.
5.1 Conductors, insulators and why silicon
Copper and glass differ in resistivity by about a hundred billion billion times. Silicon sits in between, and that is why your phone works.
Resistivity: a property of the material
Resistivity (ρ, in ohm-metres) says how strongly a material opposes current, whatever its shape. Copper is about 1.7 × 10⁻⁸ Ω·m, glass around 10¹² Ω·m. Conductors, semiconductors and insulators are three bands on that enormous scale.
Free carriers make the difference
Current needs charges free to move. In a metal, each atom lends electrons to a shared 'sea', so there are vast numbers of free carriers. In an insulator, electrons are tightly bound. The band picture says the same thing: to move, an electron must jump an energy gap, which is zero in metals, small in semiconductors (1.1 eV for silicon) and large in insulators (about 9 eV for glass).
Semiconductors can be tuned
In pure silicon, heat lifts a few electrons across the gap, so warming it lowers its resistance. Adding a few impurity atoms per million, called doping, supplies extra carriers and cuts resistivity by millions of times. N-type doping adds electrons; p-type creates 'holes'. Joining the two makes diodes and transistors.
Why silicon?
Silicon is the second most common element in Earth's crust (it is in sand). It grows a tough, insulating oxide layer that chipmakers use to build transistors. Its gap is wide enough to work reliably when hot, yet doping controls it precisely. Germanium came first, but heat frees too many of its electrons.
Common mix-ups
Semiconductors are just bad conductors.
✓ Their resistance can be changed enormously by temperature, light and doping. That controllability is what makes them useful.All materials resist more when they get hot.
✓ Metals do, a little. Semiconductors usually resist much less when hot.
Open the Lite lesson: Conductors, insulators and why silicon
5.2 Doped silicon and the p–n junction
Pure silicon barely conducts. Add one phosphorus atom for every few million silicon atoms and it conducts thousands of times better. Why so dramatic?
Doping
Pure silicon has very few free charge carriers at room temperature. n-type silicon is doped with atoms like phosphorus (5 outer electrons), adding free electrons. p-type is doped with boron (3), adding holes: gaps that move like positive charges. Tiny amounts change conductivity enormously because pure silicon starts with so few carriers.
The junction
Where p meets n, electrons and holes near the boundary combine, leaving a thin depletion region with no free carriers and a built-in voltage across it. Push current forward (p positive) and, above about 0.6–0.7 V for silicon, the barrier collapses and current flows. Push in reverse and the depletion region widens: almost no current. That is a diode.
From junctions to transistors
A MOSFET has two n-type regions (source and drain) in p-type silicon. Normally the p–n junctions block current between them. A positive voltage on an insulated gate above the gap pulls electrons up into a thin channel that connects source to drain. No gate current flows: the gate's voltage alone opens the switch.
Common mix-ups
Holes are just empty space with no effect.
✓ A hole moves as neighbouring electrons fill it, so it carries current like a positive charge.A diode conducts as soon as the voltage is positive.
✓ A silicon diode needs about 0.6–0.7 V before significant current flows.
Open the Lite lesson: Doped silicon and the p–n junction
5.3 Building gates from switches
A modern chip has billions of transistors and almost all are wired as just three or four patterns. What are they?
Two kinds of switch
An nMOS conducts when its gate is high (1) and is good at pulling a node down to ground. A pMOS conducts when its gate is low (0) and is good at pulling up to VDD. In the switch-level model each is simply on or off; in reality each has some resistance and capacitance.
Pull-up and pull-down networks
A static CMOS gate has a pull-down network of nMOS between the output and ground and a pull-up network of pMOS between VDD and the output. Series nMOS = AND condition for pulling down; parallel nMOS = OR. The pull-up is the dual: series becomes parallel and vice versa. So NAND = series nMOS + parallel pMOS; NOR = parallel nMOS + series pMOS. Each input drives one of each: a 2-input gate has 4 transistors.
Why it costs so little to sit still
For every input combination exactly one network conducts. So in steady state there is no path from VDD to ground and only tiny leakage flows. Power is spent mainly when the output switches and its load capacitance charges or discharges, which is next lesson's topic.
Common mix-ups
CMOS gates draw current all the time, like a resistor.
✓ In steady state one network is always off, so only tiny leakage flows.An AND gate is the simplest CMOS gate.
✓ NAND is simpler: AND is NAND plus an inverter (6 transistors).
Open the Lite lesson: Building gates from switches
Worked examples
Conductors, insulators and why silicon: example 1
How many powers of ten separate the resistivity of copper (1.7 × 10⁻⁸ Ω·m) from glass (10¹² Ω·m)?
Solution
From 10⁻⁸ to 10¹² is 20 powers of ten (ignoring the 1.7). Glass resists about 10²⁰ times more strongly, about a hundred billion billion times.
Doped silicon and the p–n junction: example 1
A silicon diode and a 470 Ω resistor are in series with a 3.3 V supply. Estimate the current.
Solution
I ≈ (3.3 − 0.7)/470 ≈ 5.5 mA.
Building gates from switches: example 1
Design the transistor networks for a 3-input NOR.
Solution
Pull-down: three nMOS in parallel (any input 1 pulls Y low). Pull-up: three pMOS in series (all inputs 0 to connect Y to VDD). 6 transistors.
Interactive figures, in words
Figure 5.2 from Conductors, insulators and why silicon
Start with copper, then step through every material and watch the marker jump along the resistivity scale. Pick pure silicon and raise the temperature from 20 °C to 100 °C. Then compare pure silicon with doped silicon at the same size. Which change made the bigger difference?
The materials explorer places eight materials on a resistivity scale from 10⁻⁹ to 10¹⁴ ohm-metres: copper, aluminium and nichrome in the conductor region; germanium, pure silicon and doped silicon in the semiconductor region; glass and rubber in the insulator region. Heating copper from 20 °C to 70 °C raises its resistance about 20%; heating pure silicon over the same range cuts its resistance by more than ten times. Doped silicon conducts millions of times better than pure silicon.
Figure 5.3 from Building gates from switches
Start with the inverter and toggle A. Then switch to NAND and NOR and try all four input combinations. For each, say which network conducts and confirm there is never a path from VDD to ground.
In the gate builder, the inverter's output is 1 when A = 0 (pMOS on) and 0 when A = 1 (nMOS on). The NAND output is 0 only for A = B = 1, when both series nMOS conduct; the NOR output is 1 only for A = B = 0, when both series pMOS conduct. In every case exactly one network conducts.
Laboratory
These run in a browser on the full site (they need a faster connection). Simulations are simplified educational models.
- Electronics Studio (Studio)
Use a diode in a low-voltage simulated circuit and compare current in the forward and reverse directions.
Open on the full site - BUILD: Virtual computer, Level 2 (BUILD level)
Pick one gate in the build and sketch the CMOS pull-up and pull-down networks that would make it.
Open on the full site
Practice
Each question links to its Lite lesson, where your answer is checked on our server and a wrong answer gets a hint. Answers are never sent to your device.
- Pure silicon at room temperature is best described as…
Answer it in “Conductors, insulators and why silicon” - What does doping do to silicon?
Answer it in “Conductors, insulators and why silicon” - Doping silicon with boron (3 outer electrons) makes…
Answer it in “Doped silicon and the p–n junction” - A diode is reverse biased. What happens to the depletion region?
Answer it in “Doped silicon and the p–n junction” - A pMOS transistor conducts when its gate is…
Answer it in “Building gates from switches” - How many transistors are in a static CMOS 3-input NAND gate?
Answer it in “Building gates from switches” - A student wires both networks of a gate so that, for input 11, both conduct. What happens?
Answer it in “Building gates from switches”
Engineering applications
Battery-powered devices
Because a CMOS gate has no direct path from supply to ground once it has settled, a sleeping microcontroller can draw very little current. This is a large part of why a sensor node can run for a long time on a small battery.
Temperature sensing
A semiconductor's resistance changes strongly with temperature. Thermistors use this on purpose; chip designers must allow for it, because hotter silicon conducts and leaks differently.
Watch (optional)
Streaming video uses a lot of data. Everything you need is in the text.
- “How semiconductors work” by Ben Eater
- “How Does a Transistor Work?” by Veritasium
- “Making logic gates from transistors” by Ben Eater
Summary
- Semiconductors sit between conductors and insulators, and doping tunes how many free charge carriers they have.
- A p–n junction conducts easily in one direction (forward bias) and very little in the other.
- A MOSFET is a switch controlled by its gate voltage: nMOS conducts when the gate is high, pMOS when it is low.
- A CMOS gate pairs a pMOS pull-up network with an nMOS pull-down network so exactly one of them conducts in steady state.
Glossary
- Diode forward voltage
- A diode conducts in one direction once the voltage across it reaches its forward voltage, after which its voltage stays roughly constant whatever the current. Field Guide
- NOT gate (inverter)
- A NOT gate has one input and outputs its opposite: 0 becomes 1 and 1 becomes 0. Field Guide
- NAND and NOR (universal gates)
- NAND outputs 0 only when all inputs are 1; NOR outputs 1 only when all inputs are 0. Either one alone can build every other logic function. Field Guide
- Electrical power
- The power transferred in a component is the voltage across it multiplied by the current through it. For a resistor this can also be written I²R or V²/R. Field Guide
Project: Transistor count for a NOR gate
Design a two-input CMOS NOR gate. Draw the pull-up and pull-down networks, explain why one is series and the other parallel, and check all four input cases to show the output is never connected to both supply and ground.
Deliverables
- A transistor-level sketch
- A four-row table of which transistors conduct
- A sentence on why the design draws almost no static current
Write it up on paper or in your own notes. Lite never stores what you write.
References
- Neil H. E. Weste and David Money Harris (2011). CMOS VLSI Design: A Circuits and Systems Perspective, 4th edition. Addison-Wesley.
- Robert H. Dennard et al. (1974). "Design of Ion-Implanted MOSFET's with Very Small Physical Dimensions". IEEE Journal of Solid-State Circuits 9(5), 256–268. doi:10.1109/JSSC.1974.1050511 Link
- Gordon E. Moore (1965). "Cramming More Components onto Integrated Circuits". Electronics 38(8), 114–117.