SILICON · EPISODE 7 OF 10 · 11 MIN ·

Logic from switches: gates, CMOS and the 555

Shows how pairs of n-type and p-type transistors make CMOS gates, and why NAND gates alone can build any logic. Covers George Boole, Claude Shannon's relays, binary adders, why idle CMOS draws almost no power, the clock, the flip-flop as one bit of memory, and Hans Camenzind's 555 timer.

▶ Watch on YouTubePlay the whole Silicon series ▶

The full story

The episode's narration, word for word. Numbers link to the sources below; timestamps play that moment.

The question 0:00

Last time, we learned to print switches by the million. But a switch only knows two things: on, and off. It can't decide anything. So how does a pile of switches add up your shopping, or check a password? The trick is that you don't need a switch to think. You need to arrange them, so the arrangement does the thinking 1,2.

Two states are enough 0:24

First, why only on and off? A bit is a binary digit, 0 or 1, and any switch with two clear states can hold one 2. In a chip, a low voltage means 0 and a high voltage means 1 2. But they're bands, not exact values 2. For classic five-volt TTL chips, anything under eight tenths of a volt counts as low, and anything over two volts counts as high 2. And every gate puts out a cleaner signal than it accepts, so noise gets scrubbed off at each step instead of piling up 2,3.

Logic as algebra 1:01

The maths came first. In 1854, the English mathematician George Boole published rules for reasoning with values that can only be true or false, 1 or 0 4. Three operations do most of the work 4,2. AND is true only if both inputs are true 4,2. OR is true if either one is, and NOT flips it 4,2.

Switches are logic 1:26

In 1937, an MIT master's student, Claude Shannon, noticed that switch circuits obey Boole's rules 1,4. Put two switches in a row, and the bulb lights only if A and B are both closed: that's AND 1,4. Put them side by side, and either one will do: that's OR 1,4. His switches were relays, switches flipped by an electromagnet, the workhorses of telephone exchanges 1,5. His thesis even sketched a circuit to add binary numbers 1.

A kitchen-table adder 1:58

The same year, a Bell Labs mathematician, George Stibitz, took two relays from the company's scrap pile home 6. With strips cut from a tobacco tin, a couple of dry cells and some flashlight bulbs, he built a machine on his kitchen table that added two binary digits 6. His wife suggested calling it the Model K, for kitchen 6.

Two kinds of switch 2:23

Transistors do the same job as relays, with no moving parts, and far faster 5. And they come in two flavours. The n-type MOSFET from episode five turns on when its gate is high 3. Its mirror image, the p-type, turns on when its gate is low 3. Opposite tempers. That's the whole trick.

The NOT gate 2:47

Stack one of each 2,3. The p-type connects the output up to the supply, and the n-type connects it down to ground 2,3. Both gates are wired to the same input 3. Input 0: the top one's on, the bottom one's off, so the output is pulled up to 1 2,3. Input 1: the reverse, and the output drops to 0 2,3. That's a NOT gate, also called an inverter 2. Two transistors, and the answer is always the opposite 2,3.

NAND and NOR 3:19

Now use four 2. Put two p-types side by side on top, and two n-types in a row underneath 2,3. The only way to pull the output down is for both bottom switches to be on, so the output is 0 only when A and B are both 1 2. That's NOT-AND, or NAND 2. Swap the arrangement, two in a row on top and two side by side below, and you get NOT-OR, or NOR 2. Add an inverter and you have AND, or OR 2.

Why NAND is universal 3:52

Here's the remarkable part. Given enough of them, NAND gates alone can build any other gate, and so can NOR gates alone 2. Tie a NAND's two inputs together, and it's a NOT 2. Follow a NAND with a NOT, and it's an AND 2. Flip both inputs first, and it's an OR 2. And since AND, OR and NOT can express any rule at all, NAND can too 4,2. This isn't just theory. The computer that guided Apollo to the Moon did all its logic with NOR gates, two to a chip 7.

Adding with gates 4:29

So how do you add? In binary, there are only two digits, so one plus one is written one-zero: put down 0, carry 1 8,9. For two single bits, the sum digit is 1 only when the inputs differ, a gate called exclusive-or 9. The carry is 1 only when both are 1, which is just AND 9. Those two gates together are a half adder 9. Built from NANDs, it's five gates, about twenty transistors 2,9. Chain full adders, which also take in a carry, and you can add numbers of any length 9.

Complementary 5:06

That pairing of opposite transistors has a name: CMOS, complementary MOS 2. In February 1963, Frank Wanlass and Chih-Tang Sah, at Fairchild, showed that complementary logic drew close to zero power while it sat still 10. Wanlass filed the patent that June 10,11. The patent put standby power at less than ten billionths of a watt per node 11.

Why idle is almost free 5:34

Why so little? Look at the inverter again. Whatever the input, one of the two transistors is off, so there's never a steady path from the supply to ground 3,12. And the gates themselves are insulated, so no current flows into them either 12. Held still, an ideal CMOS gate draws nothing at all 12. Real ones leak a trickle, and in today's tiniest transistors that leak is a real cost 3,12.

Where the power goes 6:03

So where does a chip's power go? Into switching 3,12. Every output is wired to the gates of the next transistors and a stretch of wire, and together they act like a tiny capacitor 3,12. Each time the output goes from 0 to 1, that capacitor is filled from the supply 3. Charging a capacitor through a resistance always loses half the energy as heat 13. The other half is stored, then dumped as heat when the output drops back to 0 3,13. So switching power rises with the capacitance, the clock rate, and the square of the voltage 3. All of it ends up as heat 3,13, which is episode ten's problem.

Watches first 6:45

At first, CMOS was slower, so it went where power mattered more than speed 10. In 1968, RCA launched a popular family of CMOS logic chips 10. Watches were the big early market 10. In 1970, Hamilton unveiled the Pulsar, a two-thousand-one-hundred-dollar digital watch 14. Its first electronics took forty-four chips, and it was notoriously unreliable 14. By 1974, a whole watch, display drivers and all, fitted on one CMOS chip, and by 1976 Texas Instruments sold one for under twenty dollars 14.

Then everything 7:26

Then the shrinking from episode five caught up 10. By 1978, CMOS could compete on speed 10. And as chips grew to hundreds of thousands of transistors, heat became the limit, and CMOS was the best way to manage it 10. Today it's the basis of nearly every chip made 10,15.

Gates take time 7:48

But gates aren't instant. Each one takes a moment to respond, and in a chain the delays add up 3,16. Watch a simple four-bit ripple counter go from seven to eight 16. Its bits flip one after another, so for an instant it reads six, then four, then zero, before it finally lands on eight 16. Read it mid-ripple, and you get garbage 16.

The clock 8:14

The fix is a clock: a steady beat that everything marches to 17,16. Results are only captured at the instant the beat ticks, so outputs change together, not whenever their inputs wobble 17,16. The beat just has to be slow enough for the slowest chain of gates to settle 18. If that takes a billionth of a second, you can tick about a billion times a second: one gigahertz 18. And a faster clock means more switching, and more heat 3.

A gate that remembers 8:43

And here's a twist. Feed a gate's output back into its input, and it can hold a state 17. Cross-connect two NOR gates, and give one a brief pulse. The output goes to 1, and stays there, even after the pulse ends, because each gate holds the other in place 17,7. Pulse the other side, and it flips to 0 and stays 17. That's a latch, and made to change only on the clock's tick, a flip-flop 17. It's one bit of memory 17.

Counting the seconds 9:14

Flip-flops can count, too. Wired to toggle, each one halves the frequency of the beat it's fed 16. Nearly every quartz watch has a crystal vibrating thirty-two thousand, seven hundred and sixty-eight times a second, which is fifteen twos multiplied together 19. Halve it fifteen times, and out comes exactly one tick per second 19,16.

The 555 9:38

Now a chip that mixes it all. In 1970, Hans Camenzind, working as a consultant to the chipmaker Signetics, came up with a simple timer 20,21. The company's engineers turned it down, but its marketing manager liked it 20. Camenzind spent nearly a year building it, cutting the masks by hand 20. It was on sale by 1972, with twenty-three transistors in an eight-pin package 20,22. And the name, 555? He said it was picked arbitrarily 21.

Inside the timer 10:13

Inside, a chain of resistors marks two levels: one-third and two-thirds of the supply, and two comparators watch for them 23. Trigger it, and a flip-flop switches the output on, while an outside capacitor charges through a resistor 23. When the capacitor reaches two-thirds, the flip-flop flips back, and a transistor dumps the charge 23. That's a one-shot, lasting about one point one times the resistance times the capacitance 23. Wire it to retrigger itself, and it bounces between one-third and two-thirds forever: an oscillator 23. Billions have been sold 20.

One bit is not enough 10:54

So switches can decide, add, keep time, and even remember a single bit. But a flip-flop forgets the moment the power goes off, and it takes several transistors to hold one bit 17,3. So how does a phone keep billions of bits for years, even with a flat battery? How does silicon remember? RAM, ROM and flash. That's next time.

Sources

Every factual claim in the episode is tied to one of these. Spotted an error? Tell us.

  1. C. E. Shannon, A Symbolic Analysis of Relay and Switching Circuits, S.M. thesis, MIT… — dspace.mit.edu
  2. T. R. Kuphaldt, ibid., ch. 3 "Logic Gates" (digital signals; CMOS gate circuitry:… — ibiblio.org
  3. Chenming C. Hu, Modern Semiconductor Devices for Integrated Circuits (Pearson,… — chu.berkeley.edu
  4. T. R. Kuphaldt, Lessons In Electric Circuits, Vol. IV (Digital), ch. 7 "Boolean… — ibiblio.org
  5. T. R. Kuphaldt, ibid., ch. 5 "Electromechanical Relays": Relay construction — ibiblio.org
  6. IEEE Computer Society, "George Robert Stibitz" (Computer Pioneers, J. A. N. Lee) — history.computer.org
  7. K. Shirriff, "A computer built from NOR gates: inside the Apollo Guidance Computer",… — righto.com
  8. T. R. Kuphaldt, ibid., ch. 2 "Binary Arithmetic": Binary addition — ibiblio.org
  9. T. R. Kuphaldt, ibid., ch. 9 "Combinational Logic Functions" (half-adder: sum = XOR,… — ibiblio.org
  10. Computer History Museum, Silicon Engine: "1963: Complementary MOS Circuit… — computerhistory.org
  11. US Patent 3,356,858, F. M. Wanlass, "Low Stand-By Power Complementary Field Effect… — patents.google.com
  12. Texas Instruments, CMOS Power Consumption and Cpd Calculation, application report… — ti.com
  13. HyperPhysics (R. Nave, Georgia State Univ.): "Energy Stored on a Capacitor" ("half of… — hyperphysics.phy-astr.gsu.edu
  14. Computer History Museum, Silicon Engine: "1974: Digital Watch is First System-On-Chip… — computerhistory.org
  15. S. Leibson, "A Brief History of the MOS Transistor, Part 3: Frank Wanlass, MOS… — eejournal.com
  16. T. R. Kuphaldt, ibid., ch. 11 "Sequential Circuits" (divide-by-two, ripple effect… — ibiblio.org
  17. T. R. Kuphaldt, ibid., ch. 10 "Multivibrators" (logic with feedback, S-R latch,… — ibiblio.org
  18. E. A. Lee, J. Roychowdhury, S. A. Seshia, S. Tripakis, UC Berkeley EECS 144/244… — ptolemy.berkeley.edu
  19. J. C. Gust, R. M. Graham, M. A. Lombardi, Stopwatch and Timer Calibrations, NIST… — tf.nist.gov
  20. IEEE Spectrum, "Chip Hall of Fame: Signetics NE555 Timer" (30 June 2017, updated 2025)… — spectrum.ieee.org
  21. Semiconductor Museum (J. Ward), "The 555 Timer IC: An Interview with Hans Camenzind"… — semiconductormuseum.com
  22. S. Leibson, "Happy 50th Birthday to the Signetics 555 Timer IC", EEJournal, 10 January… — eejournal.com
  23. Texas Instruments, xx555 Precision Timers datasheet, SLFS022K (Sept 1973, rev. March… — ti.com

Researched and scripted with AI assistance, fact-checked claim by claim, with synthetic narration and diagrams drawn in code. How we make episodes.

More from Silicon