How transistors think

The parts of the computer that do the “thinking” are mostly made of little electronic switches called transistors. If you connect two wires to a transistor, you can use the voltage on one wire to control the voltage on the other. What’s especially handy for engineering purposes is that the presence or absence of a small voltage on one wire can control a wide range of voltages on the other wire. When voltage on the control wire changes, the transistor opens or closes the other wire to the flow of electricity in much the same way that a faucet controls the flow of water in a pipe.

It’s traditional to model the flow of electricity through a network of circuits in terms of the flow of water through a plumbing system. In fact, you can build a plumbing system that’s logically equivalent to the computer on your desk (though a lot slower.) A few working computers were made in the last century using tanks of water intricately connected by valves. Using different volumes of water to represent numerical quantities, these computers could perform complex feats of multivariable calculus.

Imagine if the faucets’ opening and closing could be precisely and rapidly controlled by the direction and pressure of the water’s flow in the pipes. You now have a very good picture of what’s going on in an electronic computer. A microchip is an elaborate plumbing system for electrons. The presence or absence of current on some wires can open and close transistor “faucets”, which can open or close other transistors, which can open and close still other transistors.

There are two flavors of transistors, called N-type and P-type. In an N-type transistor, the faucet’s default state is closed. A positive voltage on the gate wire attracts electrons into the transistor’s channel, opening the electrical faucet. The P-type transistor is like an N-type transistor, but with everything reversed. In a P-type transistor, the faucet’s default state is open. A negative voltage on the gate wire chases electrons out of the transistor’s channel, closing the faucet.

A single P-type transistor can perform a logical operation called inversion. You can think of the control wire as the input, making a statement: either “my voltage is minus six volts” or “my voltage is zero.” The other wire, connecting the transistor’s source and drain, is the output, making a statement: either “I have a voltage on me” or “I have zero voltage.” We can define a wire with a voltage on it to mean “yes” and a wire at zero voltage to mean “no.” When you put the “yes” voltage on the P-type transistor’s input wire, you get the “no” voltage on its output wire, and vice versa. You can imagine the inverter as being like a contrary little robot. When you tell it yes, it always responds no, and when you tell it no, it always responds with yes.

If you have two transistors connected together, they can perform more complicated feats of logic. Two N-type transistors connected in a series form an AND gate. The only way to get a “yes” voltage on the output wire of an AND is to have a “yes” voltage on both inputs. If either input wire is off, then the output wire will be off; the same if both input wires are off. The “and” gate is a little robot that says yes when both of its inputs say yes, and otherwise says no.

Two N-type transistors connected in parallel form an OR gate. If there’s a “yes” voltage on either input wire, then there’s a “yes” voltage on the output wire. Only if both input wires say “no” will the gate give “no” as an output. The OR gate is a little robot that says yes if either of its inputs say yes, and otherwise says no.

You can connect inverters, AND and OR gates together to form more complex logical circuits, teams of little robots, each performing its mindless yes-no operations. Adding more transistors to the network opens up increasingly complex combinatory possibilities. It’s a testament to the ingenuity of human programmers that we’ve found so many versatile uses for AND, OR and NOT operations. You can perform just about any mathematical operation you want if you have enough logic gates. Very large numbers of transistors can combine into a good enough semblance of human thinking to beat grandmasters at chess.

It’s lucky for us that transistors are extremely cheap and getting cheaper. In the early part of the twentieth century when transistors were macroscopic devices wired together one at a time by hand, it seemed idle to speculate on what could be done by networking millions of them together. The transistors in the ENIAC were vacuum tubes, bulky, delicate, expensive and flamboyantly wasteful of electricity. Now machines print transistors with chemicals and lasers into silicon crystals, with ever-better precision. It’s presently possible to fit a million transistors into a square millimeter of silicon chip. Research continues to find ways to make them even smaller. Ultra-tiny electronic components consume less power and can be switched on and off a lot faster than big ones. My laptop’s processor is a thousand times faster than the ENIAC and its memory stores half a million times as many bits, at less than a thousandth of the price. What a world.

One reply on “How transistors think”

  1. Pingback: Quora

Comments are closed.