The problem with simple transistor circuits is that any circuit with a transistor in it isn’t all that simple. And frankly, I don’t know how much you know about circuits; I’m guessing it ranges from “nothing at all” to “teach your grandmother to suck eggs why don’t you.” At the risk of boring the latter crowd we’re going to give this a slow and superficial treatment. Let’s start with a circuit that’s just about as simple as I can make it. So simple it doesn’t even have a transistor in it!
Nothing too difficult here. Flip the switch, the loop completes, and the LED gives off light. One thing to note, the diode symbol is pointing in the wrong direction. Back when ol’ Ben Franklin was at the forefront of electricity research he proposed a convention to distinguish the two types of charge. He arbitrarily assigned one of them the term “positive”, and one of them “negative”. Much later we figured out that it’s actually the electrons that do the work as they move around the circuit, and that they’re associated with the negative charge. By then the way we draw circuit diagrams was pretty well ossified. As a result diodes and transistors point the way they would if current flowed from positive to negative.
Okay, batteries, resisters, these things aren’t that complicated. Let’s look at a circuit with transistors in it.
This is an amplifier. How does this thing work? First thing, pretend that everything on the left side of the circuit is gone. Suppose you cut out the transistors and just stuck a wire across. You’d have a circuit that consists of your battery, a speaker, and a single resistor. Which… really wouldn’t do anything interesting. The fun stuff happens when you use the transistors to vary that signal.
Next thing to note there are no numbers on the drawing. Sorry ’bout that. The two vertical resistors on the left are much stronger than the horizontal one. That means that whatever signal is coming in from the plus sign on the left is going to dominate. Okay, but what about those transistors in the middle? It’s something called a Darlington Amplifier; sequencing those two transistors allows you to control a much bigger current than one transistor alone.
Control? Yeah, that’s the whole point of transistors. You put a weak signal source on that plus sign on the left, and you get a strong signal out of your power source on the right. A weak signal like what? The tiny signals I get by plunking my sweet electric guitar on the left get amplified into something that entertains the whole neighborhood! Bum-bah-Bah! Bum-bump bad-dah! Bum-bump bah-da bahm-bahm.
You could also hook up a piezolelectric sensor, to make tiny tiny currents out of sound waves and amplify my awful, awful singing. The less said about that the better. Okay, next circuit.
Those pairs of vertical lines? Those are capacitors. Capacitors will build up charge until they’ve reached their limit, then current will stop flowing. If you then remove the power source the capacitor discharges. You’ve built up power in it and it’ll drive the circuit backwards for a bit. One interesting interaction between capacitors and resistors, it takes time to fill a capacitor. The bigger your resister, the more time it takes. If you’re clever about it you can use that to make a timer.
What this circuit does, and it’s hard to suss out just looking at the diagram, it’ll alternately fill and discharge the capacitors. As long as you’re filling the capacitor on the right the then the transistor on the left has current at the base. That’s the middle wire which turns the switch on. The vanilla section of the ice cream sandwich if you recall. As long as that wire has power then the leftmost line of the circuit can run, and the red light is on.
Once that capacitor fills though, it starts running in the opposite direction. The left capacitor starts to fill, and that turns on the right transistor. The right transistor causes the blue LED to light up, and incidentally discharges the capacitor on the right. Once the capacitor on the left is full the transistor switches off again, the blue light winks off, the red LED turns on again, and you’re back where your started.
What you have there is called an oscillator, because it shifts back and forth. Confusing, no? Here’s an animation that might help you follow. If you hooked this circuit up you’d see the lights blinking back and forth. The rate that they blink depends on the size of the capacitors and resistors you use. Red and blue blinking lights. Reminds me of something. Almost as if someone phoned in a noise complaint…. Moving along.
This is a bit different. I’m not actually showing you full circuits, but rather sections of one. No resistors or LEDs or such to cloud what’s going on. The line on the top is a five volt source. The dotted lines in and out indicate signals in and out. Let’s take a closer look at the leftmost circuit.
If the signal comes in (line on the left) the transistor comes on. The five volt source gets shunted to ground, and nothing happens. If there’s no signal coming from the left the transistor shuts down and you get signal out on the right. What you have is called a “NOT” gate. Let’s say that the presence of a voltage is a “1” and the absence of voltage is a zero. You can use this circuit to express that NOT 1 = 0, or conversely that NOT 0 = 1.
Neat, huh? Let’s look at the next two. The middle circuit is an OR gate; if either of the transistors are getting a 1 then the result is 1. If neither gets a signal then the signal out is zero. The one on the right is an AND gate; you need to give the top and the bottom transistors a 1 before you get a 1 out. These are three basic logic gates. There are more, but they build off the ones you already know. An example; what happens if you feed the output of an AND gate into a NOT gate? You get the opposite of an AND gate, or a NAND gate. These things are so useful that they get their own set of meta symbols. Expect to see more of these Logic Gates in future episodes. If you want to skip ahead the comic Tales of the Questor discussed the implications, only talking about enchanting swords.
When they tell you that computers run on ones and zeros this is what they mean. Five volts and zero volts. The logic, the math, it all happens with these transistor circuits. Logically the next step in this series would be binary logic and building things like a basic adder, but I’m going to hold off on that for a time. We’re going to go back to the wafer fabs and discuss how exactly you draw your circuits on silicon. Join us next week for “A Smattering of Patterning” or “All my Circuits are Plaid”.
This is part six of my ongoing series on building a computer, the “it’ll put hair on your chest” way. You may find previous parts here: 1 (silicon) 2 (crystallography) 3 (doping) 4 (diodes and transistors), 5 (fundamental chemistry) or all of them under the tag How to Build a Computer. This week’s post has been brought to you by the Rhody Balzer Boxley Booze Fund. Remember, with other charities you pay for overhead, but the RBBBF makes no bones about it’s guarantee: Every penny you donate goes straight to our booze fund.Published in