Make: Electronics

Home > Other > Make: Electronics > Page 26
Make: Electronics Page 26

by Charles Platt


  Figure 4-50. The pinouts of the logic gates in a 74HC08chip.

  Background

  From Boole to Shannon

  George Boole was a British mathematician, born in 1815, who did something that few people are ever lucky enough or smart enough to do: he invented an entirely new branch of mathematics.

  Interestingly, it was not based on numbers. Boole had a relentlessly logical mind, and he wanted to reduce the world to a series of true-or-false statements which could overlap in interesting ways. For instance, suppose there is a couple named Ann and Bob who have so little money, they only own one hat. Clearly, if you happen to run into Ann and Bob walking down the street, there are four possibilities: neither of them may be wearing a hat, Ann may be wearing it, or Bob may be wearing it, but they cannot both be wearing it.

  The diagram in Figure 4-51 illustrates this. All the states are possible except the one where the circles overlap. (This is known as a Venn diagram. I leave it to you to search for this term if it interests you and you’d like to learn more.) Boole took this concept much further, and showed how to create and simplify extremely complex arrays of logic.

  Figure 4-51. This slightly frivolous Venn diagram illustrates the various possibilities for two people, Ann and Bob, who own only one hat.

  Another way to summarize the hat-wearing situation is to make the “truth table” shown in Figure 4-52. The rightmost column shows whether each combination of propositions can be true. Now check the table in Figure 4-53. It’s the same table but uses different labels, which describe the pattern you have seen while using the NAND gate.

  Boole published his treatise on logic in 1854, long before it could be applied to electrical or electronic devices. In fact, during his lifetime, his work seemed to have no practical applications at all. But a man named Claude Shannon encountered Boolean logic while studying at MIT in the 1930s, and in 1938 he published a paper describing how Boolean analysis could be applied to circuits using relays. This had immediate practical applications, as telephone networks were growing rapidly, creating complicated switching problems.

  Background

  From Boole to Shannon (continued)

  Figure 4-52. The hat-wearing possibilities can be expressed in a “truth table.”

  Figure 4-53. The truth-table from Figure 4-52 can be relabeled to describe the inputs and outputs of a NAND gate.

  A very simple telephone problem could be expressed like this. Suppose two customers in a rural area share one telephone line. If one of them wants to use the line, or the other wants to use it, or neither of them wants to use it, there’s no problem. But they cannot both use it at once. You may notice that this is exactly the same as the hat-wearing situation for Ann and Bob.

  We can easily draw a circuit using two normally closed relays that creates the desired outcome (see Figure 4-54), but if you imagine a telephone exchange serving many thousands of customers, the situation becomes very complicated indeed. In fact, in Shannon’s time, no logical process existed to find the best solution and verify that it used fewer components than some other solution.

  Figure 4-54. This relay circuit could illustrate the desired logic for two telephone customers wanting to share one line, and its behavior is almost identical to that of the NAND schematic shown in Figure 4-48.

  Shannon saw that Boolean analysis could be used for this purpose. Also, if you used an “on” condition to represent numeral 1 and an “off” condition to represent numeral 0, you could build a system of relays that could count. And if it could count, it could do arithmetic.

  When vacuum tubes were substituted for relays, the first practical digital computers were built. Transistors took the place of vacuum tubes, and integrated circuit chips replaced transistors, leading to the desktop computers that we now take for granted today. But deep down, at the lowest levels of these incredibly complex devices, they still use the laws of logic discovered by George Boole. Today, when you use a search engine online, if you use the words AND and OR to refine your search, you’re actually using Boolean operators.

  Essentials

  Logic gate basics

  The NAND gate is the most fundamental building block of digital computers, because (for reasons which I don’t have space to explain here) it enables digital addition. If you want to explore more try searching online for topics such as “binary arithmetic” and “half-adder.”

  Figure 4-55. Ann and Bob attempt to overcome the limitations of Boolean logic.

  Generally, there are seven types of logic gates:

  AND

  NAND

  OR

  NOR

  XOR

  XNOR

  NOT

  Of the six two-input gates, the XNOR is hardly ever used. The NOT gate has a single input, and simply gives a negative output when the input is positive or a positive output when the input is negative. The NOT is more often referred to as an “Inverter.” The symbols for all seven gates are shown in Figure 4-56.

  Figure 4-56. American symbols for the six types of two-input logic gates, and the single-input inverter.

  I’ve shown the American symbols. Other symbols have been adopted in Europe, but the traditional symbols shown here are the ones that you will usually find, even being used by Europeans. I also show the truth tables, in Figure 4-57, illustrating the logical output (high or low) for each pair of inputs of each type of gate.

  Figure 4-57. Inputs and corresponding outputs for the six types of logic gates (note that the XNOR gate is seldom used). The minus signs indicate low voltage, close to ground potential. The plus signs indicate higher voltage, close to the positive potential of the power supply in the circuit. The exact voltages will vary depending on other components that may be actively connected.

  Essentials

  Logic gate basics (continued)

  If you have difficulty visualizing logic gates, a mechanical comparison may help. You can think of them as being like sliding plates with holes in them, in a bubblegum machine. Two people, A and B, can push the plates. These people are the two inputs, which are considered positive when they are doing something. (Negative logic systems also exist, but are uncommon, so I’m only going to talk about positive systems here.)

  The flow of bubblegum represents a flow of positive current. The full set of possibilities is shown in Figures 4-58 through 4-63.

  Figure 4-58.

  Figure 4-59.

  Essentials

  Logic gate basics (continued)

  Figure 4-60.

  Figure 4-61.

  Essentials

  Logic gate basics (continued)

  Figure 4-62.

  Background

  The confusing world of TTL and CMOS

  Back in the 1960s, the first logic gates were built with Transistor-Transistor Logic, abbreviated TTL, meaning that tiny bipolar transistors were etched into a single wafer of silicon. Soon, these were followed by Complementary Metal Oxide Semiconductors, abbreviated CMOS. Each of these chips was a collection of metal-oxide field-effect transistors (known as MOSFETs). The 4026 chip that you used earlier is an old CMOS.

  You may remember that bipolar transistors amplify current. TTL circuits are similar: they are sensitive to current, rather than voltage. Thus they require a significant flow of electricity, to function. But CMOS chips are like the programmable unijunction transistor that I featured previously. They are voltage-sensitive, enabling them to draw hardly any current while they are waiting for a signal, or pausing after emitting a signal.

  The two families named TTL and CMOS still exist today. The table in Figure 4-64 summarizes their basic advantages and disadvantages. The CMOS series, with part numbers from 4000 upward, were easily dama
ged by static electricity but were valuable because of their meager power consumption. The TTL series, with part numbers from 7400 upward, used much more power but were less sensitive and very fast. So, if you wanted to build a computer, you used the TTL family, but if you wanted to build a little gizmo that would run for weeks on a small battery, you used the CMOS family.

  From this point on everything became extremely confusing, because CMOS manufacturers wanted to grab market share by emulating the advantages of TTL chips. Newer generations of CMOS chips even changed their part numbers to begin with “74” to emphasize their compatibility, and the functions of pins on CMOS chips were swapped around to match the functions of pins on TTL chips. Consequently, the pinouts of CMOS and TTL chips are usually now identical, but the meaning of “high” and “low” states changed in each new generation, and the maximum supply voltages for CMOS chips were revised downward. Note I have included question marks beside two categories in the CMOS column, as modern CMOS chips have overcome those disadvantages—at least to some extent.

  Here’s a quick summary, which will be useful to you if you look at a circuit that you find online, and you wonder about the chips that have been specified.

  Where you see a letter “x,” it means that various numbers may appear in that location. Thus “74xx” includes the 7400 NAND gate, the 7402 NOR gate, the 74150 16-bit data selector, and so on. A combination of letters preceding the “74” identifies the chip manufacturer, while letters following the part number may identify the style of package, may indicate whether it contains heavy metals that are environmentally toxic, and other details.

  Figure 4-64. The basic differences between the two families of logic chips. In successive generations, these differences have gradually diminished.

  TTL family:

  74xx

  The old original generation, now obsolete.

  74Sxx

  Higher speed “Schottky” series, now obsolete.

  74LSxx

  Lower power Schottky series, still used occasionally.

  74ALSxx

  Advanced low-power Schottky.

  74Fxx

  Faster than the ALS series.

  Background

  The confusing world of TTL and CMOS (continued)

  CMOS family:

  40xx

  The old original generation, now obsolete.

  40xxB

  The 4000B series was improved but still susceptible to damage from static electricity. Many hobby circuits still use these chips because they will run from relatively high voltages and can power LEDs and even small relays directly.

  74HCxx

  Higher-speed CMOS, with part numbers matching the TTL family, and pinouts matching the TTL family, but input and output voltages not quite the same as the TTL family. I’ve used this generation extensively in this book, because it’s widely available, and the circuits here have no need for greater speed or power.

  74HCTxx

  Like the HC series but matching the TTL voltages.

  74ACxx

  Advanced version of HC series. Faster, with higher output capacity.

  74ACTxx

  Like the AC series but with the same pin functions and voltages as TTL.

  74AHCxx

  Advanced higher-speed CMOS.

  74AHCTxx

  Like the AHC series but with the same pin functions and voltages as TTL.

  74LVxx

  Lower voltage (3.3v) versions, including LV, LVC, LVT, and ALVC series.

  As you can see, these days you have to interpret part numbers very carefully. But which family and generation of chips should you use? Well, that depends! Following are some guidelines.

  What you don’t need:

  1. Speed differences are irrelevant from our point of view, as we’re not going to be building circuits running at millions of cycles per second.

  2. Price differences are so small as to be inconsequential.

  3. Lower-voltage (LV) CMOS chips are not very interesting for our small experimental circuits.

  4. Try to avoid mixing different families, and different generations of the same family, in the same circuit. They may not be compatible.

  5. Some modern chip varieties may be only available in the surface-mount package format. Because they’re so much more difficult to deal with, and their only major advantage is miniaturization, I don’t recommend them.

  6. In the TTL family, the LS and ALS series cannot handle as much output current as the S series and the F series. You don’t need them.

  What you should use:

  1. The old 74LSxx series of TTL chips was so popular, you’ll still find schematics that specify these chips. You should still be able to buy them from sources online, but if not, you can substitute the 74HCTxx chips, which are designed to function identically.

  2. The old 4000B series of CMOS chips are still used by hobbyists because their willingness to tolerate high voltages is convenient. While TTL or TTL-compatible chips require a carefully regulated 5 volts, the 4000B chips would handle 15 volts—and also delivered enough power to energize LEDs or even very small relays. Some hobbyists also have a nostalgic affection for the 74Cxx series of chips, which had the same pin connections as the TTL chips but could still tolerate higher voltages and higher output current. The trouble is, some of the 74Cxx chips are almost extinct, and while the 4000B chips are still available, they are considered almost obsolete.

  Background

  The confusing world of TTL and CMOS (continued)

  Bottom line: I suggest you use the 4000B chips only if you want to replicate an old circuit, or if a modern equivalent is unavailable (which is why I specified the 4026B chip for the reaction timer—I could not find a modern equivalent that will drive seven-segment numeric displays directly, and I didn’t want you to have to deal with more parts than necessary).

  If you check online suppliers such as Mouser.com you’ll find that the HC family is by far the most popular right now. They are all available in through-hole format (to fit your breadboard and perforated board). They have the high input impedance of CMOS (which is useful) and they have the same pin identities as the old 74LSxx series.

  Abbreviations

  When looking at data sheets, you are likely to encounter some or all of these abbreviations:

  VOH min: Minimum output voltage in high state

  VOL max: Maximum output voltage in low state

  VIH min: Minimum input voltage to be recognized as high

  VIL max: Maximum input voltage recognized as low

  Background

  Logic gate origins

  The 7400 family of integrated circuits was introduced by Texas Instruments, beginning with the 7400 NAND gate in 1962. Other companies had sold logic chips previously, but the 7400 series came to dominate the market. The Apollo lunar missions used a computer built with 7400 chips, and they were a mainstay of minicomputers during the 1970s.

  RCA introduced its 4000 series of logic chips in 1968, built around CMOS transistors; Texas Instruments had chosen TTL. The CMOS chips used less power, thus generating much less heat and enabling flexible circuit design, as each chip could power many others. CMOS was also tolerant of wide voltage ranges (from 3 to 15 volts) but prohibited switching speeds faster than around 1MHz. TTL was 10 times faster.

  Design tweaks gradually eradicated the speed penalty for CMOS, and TTL chips have become relatively rare. Still, some people retain a special nostalgic loyalty to “the logic gates that went to the moon.” A hardcore enthusiast named Bill Buzbee has built an entire web server from TTL-type 7400 chips, currently online at http://magic-1.org. Figure 4-65 shows just one of the ha
ndmade circuit boards that Bill assembled to run his computer.

  Figure 4-65. Hobbyist Bill Buzbee built himself a web server entirely from 7400 series logic chips, the oldest of which was fabricated back in 1969. The web server can be found online at http://magic-1.org, displaying pictures of itself and details of its construction. The picture here that Bill took shows just one of the circuit boards of this remarkable project.

  Fundamentals

  Common part numbers

  Each 14-pin chip can contain four 2-input gates, three 3-input gates, two 4-input gates, one 8-input gate, or six single-input inverters, as shown in the following table.

  2 input

  3 input

  4 input

  8 input

  AND

  7408

  7411

  7421

  NAND

  7400

  7410

  7420

  7430

  OR

  7432

  744078*

  NOR

  7402

  7427

 

‹ Prev