Home -> Magazines -> Issues -> Articles in this issue -> View
The Layman's Guide to Digital Logic Gates | |
(in one easy lesson)Article from Polyphony, November 1977 |
How many of you out there in the human race wonder where all these people that design and tell us about all those modern electronic circuits get all the brains? We know though, don't we! They stole 99.9% of ours and expect us to know what they are talking about. Are we content to stand back twiddling our thumbs and sing Yankee Doodle while the sun goes down? Heck no! We're going to start catching up in the knowledge department, and since we are getting interested in digital processing of synthesized music, then we night as well start with basic digital theory.
But where to start? I guess that you've all had that nightmare where a 14 legged IC, with the head of a dragon spewing hot solder, attacked your "two transistor-super-duper-do-nothing-circuit". Fear not. Just sharpen your sword... I mean pencil, put on your thinking cap, and we'll conquer that foe.
Let's first talk about the how and why of logic thinking. Even before the age of electronic computers, way back in the eighteen hundreds, an English gentleman by the name of George Boole was working with logic that is today the basis of all digital circuitry. George developed a mathematical system by which a logic statement could be proved to be either true of false. In logic thinking there are only two valid states: right or wrong, true or false, yes or no, etc. The result is that today Mr. Boole's system is with us in the form of Boolean algebra.
Wait now, don't stop reading! Just because I mentioned algebra don't tune me out. If your younger brother or sister is studying Boolean algebra in Jr. High School, and better yet understanding it, then there is still hope for you. The Boolean system relates directly to a mathematical system called binary. In the binary system there are only two possible states, a one or a zero. This system adapted very well to Boole's work and today is used in digital design.
The analogy of a switch seems to fit this idea very well. We can say that if a switch is closed we have a "1" and if it is open we have a "0". It doesn't really matter what type of switch it is as long as it can simulate the same principle of operation. It can be a mechanical one such as a toggle switch or an electronic one using such discrete components as resistors, diodes, and transistors. Let's look at the three basic building blocks found in digital logic: the AND gate, the OR gate, and the Inverter. With these gates, any circuits such as adders, counters, multipliers, dividers, and an entire computer can be constructed. Knowing their operation will give us a solid background from which we can build our digital knowledge.
For the AND gate we can write a Boolean expression and a "truth table". Both are shown in figure 1(c). The expression is usually read as "X equals A and B" or "X equals AB'. The truth table is just a tablature form of stating the value of X for all possible combinations of A and B. The two input AND gate is available in various DIP packages with different switching speeds and power consumption. (Figure 2) shows a 7408 quad 2 input AND gate package. The 7408 only costs about 25 cents from any surplus dealer, so why not buy one and experiment with it to see if I'm telling the truth.
The next gate I would like to talk about is the OR gate. Continuing on with the switch analogy, look at the circuit of figure 3(a). Here we see two switches, A and B in parallel. We know that if we close either or both switches, current will flow through the load resistor and the voltage across it will be +V or a logic 1. Figure 3(b) shows the accepted symbol for a 2 input OR gate while figure 3(c) contains the Boolean expression and truth table. The expression is usually read as "X equals A or B". The + symbol is read as OR and should not be confused with the mathematical addition symbol. The 2 input OR gate is available in a quad package in both CMOS and TTL with the TTL 7432 shown in figure 4.
The third and simplest gate so far is the Inverter or "Not" gate. Two accepted symbols for the Inverter are shown in figure 5(a). The Inverter doesn't really make any decision as do the AND and OR gates. The inverter has only one input and the output X is always the inverse of A. If we apply a logic 1 and A, then the output X will be a 0, while a 0 at A will cause X to be a 1. This is shown in the truth table of figure 5(b) along with its Boolean expression. The equation is read as "X equals A not" or "X equals not A". The Inverter is available as a "six pack" in both CMOS and TTL, with the TTL 7404 shown in figure 6.
Well there you have it, the three digital gates that form the basis for any logic function. I bet you're saying "I don't believe it!". I am sorry, but that is all there is to these gates. Let's see if you have absorbed some of the things I have said, so take a look at the gates in figure 7. Try writing down the name and Boolean expression for each drawing without reading any further. If you have written for (a) 4 input AND and X=ABCD, (b) 3 input OR and X=A+B+C, (c) two inverters and X=A, then you are doing great. If you had any right for that matter, congratulations! See, even you can understand some digital logic. Tomorrow, the world. You see that no matter how many inputs there are, you just expand the expression to fit the extra inputs. For the inverter circuit you can see that by inverting something twice, you arrive right back where you started! This is a very important point and you should try to remember it.
I suppose you have been wondering about the result of combining these gates together. Well, the next two gates I'll talk about, you probably have seen in most logic circuits you've looked at. The first combination we'll look at, shown in figure 8(a) is called a NAND gate. If you think the English language is taking a beating don't worry, because for the sake of brevity, it is an abbreviation for "Not And". Look at figure 8(b) and you will soon understand. The NAND gate consists of an AND gate whose output is inverted, with inversion indicated by the small circle at the output of the gate. The Boolean expression shown has a bar across the top of the equation to represent inversion of the AND function. Looking at the truth table of figure 8(c) we see that the output is similar to the AND gate but everything is inverted. Remember what I said about the inverter? Put an Inverter on the output of a NAND gate as in figure 9(a) and we obtain an output equivalent to the AND gate. Pretty neat, eh! Figure 9(b) shows how to make an Inverter using a NAND gate. With both inputs tied together, the result is that whatever is applied at A is inverted at the output X.
The next combination of gates shown in figure 10(a) is called a NOR gate, for reasons you probably already have deduced. The NOR consists of an OR gate whose output is inverted, this being shown in figure 10(b). The small circle again indicates inversion and is also depicted by the bar in the Boolean expression. The truth table is shown in figure 10(c). As you probably have already guessed the NOR can also be converted to an OR gate by inverting the output (figure 11(a)) and an Inverter with the two inputs tied together (figure 11(b)).
Short Circuit |
Building A Bionic Sax |
The Ins and Outs of Digital Design |
Studio Earthing Techniques - Interconnect (Part 1) |
Multi-waveform LFO |
Short Circuit - Time Machine Revisited |
Studio Project - Going Direct |
Lab Notes: In Pursuit of the Wild QuASH |
A Digitally Addressed Transposer - for Your Analog Keyboard or Sequencer |
Guitar Routing Box (Part 1) |
Modular Effects Rack Project (Part 1) |
Technically Speaking |
Browse by Topic:
Feature by Robert A. Rafuse
Previous article in this issue:
Next article in this issue:
mu:zines is the result of thousands of hours of effort, and will require many thousands more going forward to reach our goals of getting all this content online.
If you value this resource, you can support this project - it really helps!
New issues that have been donated or scanned for us this month.
All donations and support are gratefully appreciated - thank you.
Do you have any of these magazine issues?
If so, and you can donate, lend or scan them to help complete our archive, please get in touch via the Contribute page - thanks!