# Transistor Gates

At the bottom of the stack, computers are built out of transistors. How transistors become computers capable of performing math is quite interesting to me.

The point of these pages is to build up a computer from a series of transistors, to show how it’s done. And not just to show circuits and let you know that it may work, but to actually build the systems themselves.

For most of thesse pages we use the quite popular 2N3904 NPN transistor. That’s because they’re cheap in bulk (\$6 for 100 at Amazon), and for what we’re building, we’re going to need thousands of these.

It’s possible to build these same circuits using PNP transistors, NMOS transistors and PMOS transistors. CMOS circuits are built using NMOS and PMOS transistors, and has the nice property of using far less power than NMOS, PMOS, NPN or PNP transistor circuits.

And as soon as I have access to these transistors and build the sample circuits, those pages will be posted.

As to how transistors work, there are plenty of tutorials on the Internet which give a good overview.

For our digital circuits, we are using transistors as switches, alternating between cut-off mode (where a transistor does not conduct any current), and saturation (where the transistor conducts current freely). This, combined with a resistor, and our NPN transistor operates as a switch, either allowing the voltage to be pulled up through the resistor to VCC voltage (which, in our examples, is +3 volts), or pulled down through the transistor to GND (or 0 volts).

When we use transistors as switches, the relationship between “on” and “off” to binary logic should be clear: if the power is off, we represent this in binary as ‘false’ or ‘0’, and when on, the binary as ‘true’ or ‘1’.

This becomes important as we start building circuits that can do simple math, such as addition or subtraction. This also becomes important as we build counting circuits.