Boolean Logic
I think it was in seventh grade that I did those truth table things. If I'm hungry or thirsty, or if it's not true that there is a thermonuclear device and it's armed, then I will go to the fridge. Therefore, different possibilities for hunger, thirst, military surplus, and imminent nuclear holocaust determine whether or not it is true that I will go to the fridge. Five years later I learn of an actual use for such a thing, and it doesn't include nuclear holocaust.
It got me an easy 100 average for that unit, but slightly more important is that it forms the basis for something that forms the basis for all electronics, and that something is Boolean logic. It was developed by George Boole about a century before it was applied to electronics. Perhaps it was then about as useful as my seventh grade truth tables were, but that's not the point. The point is that it consists of three basic components called logic gates. Artistic representations of these components are presented in pre-formatted text form below:
The NOT Gate The AND Gate The OR Gate
_ _____
|\ | \ ___\ \
___| \o___ ___| \__ \ \___
| / | / ____/ /
|/ ___|_/ /____/
Now, those are suppose to be a triangle, a D shape, and a sideways V shape, respectively. Each has at least one input, and only one output; input is on the left, output on the right, if you couldn't guess.
The logical NOT gate has only one input (that line on the left), and it simply inverts that for the output. If you put in a True, you get a False out. If you put in a False, you get a True. Note the 'o' on its output; the bubble is what actually represents the inverse. If you put a NOT gate to the right of the AND gate, you would invert the AND gate's output, but rather than have both gates in series, you would simply tack that o onto the end of the AND gate.
_
___| \
| |o__
___|_/
The AND gate has an output of True only if all of its inputs are True. The diagram above shows two input lines, but there can be more. Whether it's two, eight, sixty-four, or five-hundred twelve inputs, the output will always be False unless all of the inputs are True. Five-hundred eleven True inputs and a single False input will yield an output of False.
The OR gate has an output of True if any one of its inputs are True. Again, the diagram shows two inputs, but five-hundred twelve inputs would work the same way. There is an output of False only if all of the inputs are False. Five-hundred eleven False inputs and a single True input will yield an output of True.
That's really all there is to the three basic components. These can be combined, though, to make four other types of gates: NAND, NOR, XOR, and XNOR. NAND and NOR are simple enough. They're just the respective AND and OR gates, but with a NOT gate tacked on the end; or rather, a bubble is drawn on the output line. If all inputs are True, a NAND gate outputs False. If all inputs are False, a NOR gate outputs True. Simple enough. XOR is a little different. XOR, "exclusive OR," is just like an OR gate, but it will output True if one, but not both of the inputs are True. Behold, the XOR symbol, and accompanying truth table:
The XOR Gate ---> Input 1 | Input 2 | Output The XNOR Gate
___ -------------------------- ___
1 ___\\ \ False False | False ___\\ \
\\ \__ False True | True \\ \o__
2 ___ // / True False | True ___ // /
//__/ True True | False //__/
XNOR, as the N implies, is an XOR with a NOT tacked on the end.
And presto, thus are the seven Boolean logic gates. Or five, or three. It really doesn't matter. Though it's applied to electronics, Boolean logic is an independent entity. The inputs can be trues and falses in some complex, logical gate map representing what must be true for thermonuclear holocaust, or they can be binary digits that determine when a motor turns or when a digital counter increases another digit. Of course, for the latter there has to be some way to make real, physical gates like these. And wouldn't you know it: the transistor was developed in 1947 (or earlier actually, but 1947 will do), which allowed for just the kind of control over electricity that allowed these gates to be built. These gates can all be represented with electrical schematics full of resistors and transistors and whatnot. Maybe later.
So now there are transistors. Physical gates can be made. The next step is to get some real kind of input: voltage, of course. Finally, we come to the real deal, the world of binary. True or false, on or off, high or low, one or zero. Have five volts or so represent a binary one. Have zero volts or so represent a binary zero. This is the basis for digital logic, and digital logic allows for all kinds of things. Combine enough transistors and you have some kind of gate. Combine enough gates and you can add those binary digits. Start adding enough binary digits and you'll have decimal arithmetic. Enough of that makes a basic calculator, or any number of other mechanisms and devices, but that's another issue.
For today, this is just plain of Boolean logic. However applied, it's seven gates. Simple. Until you see a schematic like this.
Sweet.
Back to the Main Page