10 T K0 0 'Air  This book is licensed under a Creative Commons Attribution i.o License I ntroduction to Digital Logic with Laboratory Exercises James Feher Copyright @ 2009 James Feher Editor-In-Chief: James Feher Associate Editor: Marisa Drexel Proofreaders: Jackie Sharman, Rachel Pugliese For any questions about this text, please email: drexel(&uga.edu The Global Text Project is funded by the Jacobs Foundation, Zurich, Switzerland This book is licensed under a Creative Commons Attribution i.o License Introduction to Digital Logic with Laboratory Exercises 2 A Global T ext  Preface............................................................................................................... 7 he Itranscior .......................................................................................10... 1Thebradbsosad..... r.............................................................................. 10 The tainetr...................................................................................................... 12 Thistoeayo rdogic ..chips ........................................................................................... 14 Log iclfntions...................................................................................................i6.1 2. Lo Ic gsi .ificati................................................................................. 19 eisorfgacsclaws............................................................................................... 19 Kanghc apbos..................................................................................................20..1 4. g ca fu ct ons.............i..tio................................................................................ 271 3.Lgc--smlfcto ..............................................................................27..1 Input p sla ent ...on ..-map......................................................................................219 ont care a s conditions. ............................................................................................... 292 Ci.cuit lexer..............ebugig....................................................................2 ackMor oundonheim ux"iato...............................................................................27 6. iioa 1 ers d o s. s. ....................................................................................427 Cnloc......... ......................................................................................38..2 Donuntiaramonits.............................................................................................329 5.Mem"1oyx............................................................................................44..3 FlikgrfibdSon.t.e...........................................................................................................45 3 Whsicsautperwhie ment............ns.............................................................49..3 S.Tatetrsaniio di ram...............................................................................50.. 3 Tatei ahin dsicnui.........................................................................................51..3 e o u n c e d s w itc h e s..... ... .. ... ... ... .. ... ... .. ... ... .. ... ... .. ... ... ... .. ... ... .. ... ... .. ... ... ... .. ... ... .. ... ... .. ... .. 5 53 9 . m r s.or e . ..sta te ... ...c . .. ...e s.. ... .. .. ... .. ... .. .. ... .. ... .. ... .. .. ... .. ... .. .. ... .. ... .. .. ... .. ... .. .. ... .. ... . 5 73 hatks are ....unused .....states ........................................................................................... 10. in at'sext.............................................................................................64 3 M e m o . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 9 8.Saestors............................................................................................9 Ctateaci... ...........................................................................................70.. 5 3  This book is licensed under a Creative Commons Attribution 0ices ApedxQ a oeok.......................................................................... 73 Apendix EEqipmenth11st ...................................................................... ee74 Diital trainer............................................................................................................ 74 7400 series families ..................................................................................................... 75 Ap endix F: Solutions ........................................................76 ChapIerlreiiewexercises.......................................................................................... 76 hapter2I'evew exercis.......................................................................................... 78 Ch' pter- review exercises.......................................................................................... 81 Chapter 4 review exercises.......................................................................................... 87 haterr eviewexrcises .......................................................................................90 g Chapter 6 review exercises.......................................................................................... 95 Chapter 7re -Z view exercises.......................................................................................... 98 Chapter 8 rexview exercises........................................................................................ 101 chaterreiew exerc.ises........................................................................................ 104 Introduction to Digital Logic with Laboratory Exercises 4AGlblTx 4 A Global Text  Table 1: NAND table................................................................................. 15 Table 2: NOR table .................................................................................. 15 Table 3:AB +BC ....................................................................................i16 Table 4: XOR table.............................................................................. PPPPPPPP17 Table 5: 4 input K-map............................................................................... 20 Table 6: 2 input K-map .............................................................................. 20 Table 7: 3 input K-map ............................................................................... 20 Table 8: f(A,B,C)..................................................................................... 21 Table 10: h(ABCD)................................................................................. 23 Table 11: h(w,x,y,z) .................................................................................. 23 Table12: Step 3..................................................................................... 23 Table 13: Step 2...................................................................................................23 Table 14: Step 5 .......................................................................................23 Table i5: g(a,b,c).................................................................................... 33 Table 16: g(a,b,c) .................................................................................... 33 Table 17: h(a,b,c,d) .............. ...................3 Table 18: h(a,b,c,d) ............. ...................34 Table 19: NOR SR latch .............................................................................. 44 Table 2o: NAND SR latch ............................................................................ 44 Table 21: JK flip-flop............................................................................. ee*45 Table 22: T flip-flop.............................................................................. eeee45 Table 23: D flip-flop .............................................................................. PPPPPPPP45 Table 24: Truth table.............................................................................PPPPPP5 1 Table 25: Counter truth table........................................................................ 52 Table 26: QiN(x,Qi,Qo) .......................................................................... e*53 Table 27: QoN(x,Qi,Qo)........................................................................... e*53 Table 28: QiN(x,QiQo)= QiN = x' QlQo' + xQlfQo............................................ 5 Table 29: QoN(x,Qi,Qo)= xQlfQo' +xQio. ............... Table 3o: QiN(x,Qi,Qo)= xQlfQo' + x'Qo. ................ Table 31: QoN(x,Qi,Qo)= xQlfQo'+ xQ................. Table 33: TQuNh.table.fos.s.ate.mach...................................................................... 6o 5  This book is licensed under a Creative Commons Attribution a.0 License About the author and reviewers Author: Jares Feher Jim currently teaches computer science at McKendree University in Lebanon, Illinois. He is a huge open source software proponent. His research focuses on the use of open source software in theareas of hardware, programming and networking. His hobbies include triathlon, hiking, camping and the use of alternative energy. He lives with his wife and three kids in St. Louis, MIssouri where he built and continues to perfect a solar hot water heating system for his home. Reviewer: Kumud Bhandari Kumud graduated from McKendree University with degrees in computer science and mathematics. He has worked at internships at the University of Texas and the Massachusetts Institute of Technology. He currently isemployed as a researcher with Argonne National Laboratory. Reviewer: Andrew Van Carp Professor Van Camp is a retired electronics professor. In addition, he has extensive experience working and consulting in industry. He currently resides in central Missouri where he continues his consulting for industry. Introduction to Digital Logic with Laboratory Exercises 6 A Global T ext  This book is licensed under a Creative Commons Attribution a.0 License Preface This lab manual provides an introduction to digital logic, starting with simple gates and building up to state machines. Students should have a solid understanding of algebra as well as a rudimentary understanding of basic electricity including voltage, current, resistance, capacitance, inductance and how they relate to direct current circuits. Labs will be built utilizing the following hardware: - breadboards with associated items required such as wire, wire strippers and cutters - some basic discrete components such as transistors, resistors and capacitors - basic 7400 series logic chips - 555 timer Discrete components will be included only when necessary, with most of the labs using the standard 7400 series logic chips. These items are commonly available and can be obtained relatively inexpensively. Labs will include learning objectives, relevant theory, review problems, and suggested procedure. In addition to the labs, several appendices of background material are provided. Format for each chapter Each chapter is a combination of theory followed by review exercises to be completed as traditional homework assignments. Full solutions to all of the review exercises are available in the last appendix. Procedures for labs then follow that allow the student to implement the concepts in a hands on manner. The materials required for the labs were selected due to their ready availability at modest cost. While students would gain from just reading and completing the review exercises, it is recommended that the procedures be completed as well. In addition to providing another means reenforcing the material, it helps to develop real world debugging and design skills. This manual concentrates on the basic building blocks of digital electronics: logic gates and memory. It focuses on these items from the ground up. The reader will first see how logic gates can be constructed from transistors and then how digital logic functions are constructed using those gates. The concept of memory is then introduced through the construction of an SR latch and then a D flip-flop. A clock is created to be used in a basic state machine design that aims to combine logic circuits with memory. Target audience This text will be geared toward computer science students; however it would be appropriate for any students who have the necessary background in algebra and elementary DC electronics. Computer science students learn skills in analysis, design and debugging. These skills are also used in the virtual world of programming, where no physical devices are ever involved. By requiring the assembly and demonstration of actual circuits, students will not only learn about digital logic, but about the intricacies and difficulties that arise when physically implementing their designs as well. Global Text Prject Education is the most powerful weapon you can use to change the world - Nelson Mandela The goal of this text is to allow more students to gain access to this material by providing it in the Creative Commons as well as specifying inexpensive materials to be used in the labs. For this reason the author chose to Introduction to Digital Logic with Laboratory Exercises 7 A Global T ext  Preface work with the Global Text project to develop this text. The Global Text Project will create open content electronic textbooks that will be freely available from a website. Distribution will also be possible via paper, CD, or DVD. The goal of the Global Text Project initially is to focus on content development and Web distribution, and work with relevant authorities to facilitate dissemination by other means when bandwidth is unavailable or inadequate. The goal is to make textbooks available to the many who cannot afford them. Acknowledgments A work such as this would not be possible without the help of many. First, I would like to thank the Global Text Project for their vision of providing electronic textbooks for free to everyone. Marisa Drexel, Associate Editor at the Global Text Project provided countless suggestions and helpful hints for the document and for the creation of the document using OpenOffice. Andrew Van Camp II, retired professor of electronics provided excellent suggestions for technical review of the content. Kumud Bhandari, currently a research aide at Argonne National Laboratory, provided also provided technical review of the material. My students Evan VanScoyk, Samantha Barnes, and Ben York all provided helpful corrections and review as well as countless diagrams found in the document. I would like tp thank all of the countless open-source developers who produced such fine software as GNU/Linux, OpenOffice, the Gimp, and Dia which were all used to create this document. I am grateful to McKendree University for providing support in the form of a sabbatical to allow me to complete this work. And I certainly wish to thank Sandy who provided excellent review suggestions, support and an extremely patient ear when I ran into trouble trying to incorporate a new feature from OpenOffice or attempted edit a particularly tricky graphic. 8  This book is licensed under a Creative Commons Attribution a.0 License It is nearly impossible to find a part of society that has not been touched by digital electronics Obvious applications such as computers, televisions, digital video reorders and countless other consumer electronics would not be possible without them. The Internet is run on a system of computers and routing equipment built with digital electronics. Yet even outside of some of these obvious applications we find that our cars and utilitarian home appliances such as microwaves, washers, dryers, coffee makers and even refrigerators are all increasingly being designed with digital electronic controls. You likely carry some sort of device designed with them with you nearly all your waking hours whether it is a watch, cell phone, MP3 player or PDA. Indeed, digital electronics provide the foundation upon which we build the infrastructure of modern society. You no doubt have heard stories about some of the first computers. Machines built with mechanical relays and vacuum tubes that filled entire rooms. In the 1940s John Bardeen, Walter Brattain and William Shockley developed the first transistor; it allowed computers to be built cheaper, smaller and more reliable than ever before. The integrated circuit, a single package with several transistors along with other circuit components, was developed in the late 1950s by Jack Kilby at Texas Instruments. This helped to further advance the digital revolution. Advances then became so common that in the 196os Gordon Moore, a founder of Intel, proposed his famous law stating that the capacity of computers we use would double every two years. This observation has held up since then, even being amended to a doubling every eighteen months. The quad core microprocessors of today contain millions of components, but the basic building blocks are digital logic functions combined with memory. Despite the fact that many of these devices are tremendously complex and require vast amounts of engineering in their design, they all share the ubiquitous bit as their fundamental unit of data. In essence it all starts with TRUE and FALSE or o and 1. And so the next chapter starts with the simplest of logic devices, the inverter, built with a single transistor. You then continue your journey into the world of digital electronics by examining the NAND and NOR gates. Remember, the digital revolution would not be possible without these simple devices. Introduction to Digital Logic with Laboratory Exercises 9 A Global T ext  This book is licensed under a Creative Commons Attribution i.o License 1 The transistor and inverter Learning objectives - Use the digital trainer and breadboard. - Assemble a circuit. - Build a logic circuit with discrete components. The transistor A transistor is a three-terminal device that can be used as an amplifier or as a switch. When the transistor is used as an amplifier, it is working in analog mode. When it is being used as an electronic switch, it is functioning in digital mode. The transistor will only be used in digital mode in these labs, which means the transistor will either be on or off. The terms ground, low, zero, zero volts, open switch, and dark lamp are all equivalent to the boolean value false. Likewise five volts, high, one, closed switch, and lit lamp (LED), are equivalent to the boolean value true. We will use false (F or o) and true (T or i) when speaking of the logical states in this manual. Modern computers contain millions of transistors combined together in digital mode to create advanced circuits. Transistors are three pin devices that are similar to valves for controlling electricity. The amount of current that can flow between the collector and emitter is a function of the current flowing through the base of the transistor. If no current is flowing through the base of t h e transistor, no current will flow through the collector and emitter. With the transistor operating in digital mode, it will be configured to carry the maximum (if on) or minimum (if off) amount of current from the collector to the emitter that the circuit will allow. PINS COMPONENT 1 Emitter 2 Base 3 Collector 3 3 2 - -- 2 1'i pn2222 Transistor in TO-92 Packagel 1 3 22 32n2222 Transistor in TO-18 Package1 Exhibit 1.1: Common NPN transistors The transistor used in this lab, the pn2222 or 2n2222, is an NPN, bipolar junction transistor which is sometimes referred to as a BJT. Other types of transistors exist, and while they differ in how they function, they are used in a similar manner in digital circuits. In this lab, a single transistor will be used to create an inverter. The principles used to build this inverter could be applied to other circuits with other types of transistors. Pinouts of the two types of transistors most likely to be used in these labs are shown in Exhibit 1.1. Introduction to Digital Logic with Laboratory Exercises 10 A Global T ext  1. The transistor and inverter - 00000 00000 00 -o-o- - - 0 oooo oGoooo0 o-- - 0-0-0-0-0 00 oo00 oo000 00-00-0 0-00 oe eooo0 00000 00o0o0 0 o-0 e 00 00 S---O S---- 0o 00000 00000 000000 000 00 00000 0004O00 0000 NNN 00 o o 00oo 0- - ---- oo o oooo o--00 00 00o' 0000 o0 00000 00000o-0 * 00 00000o oooo 00 00000 0000 o 000 000o0o0 0 0 00000 00000 00000 00 00000 00000 00 00 " 00-0-00 00 00-0--.- s--p- 00 00000 00000 000 0 0 0 0 00 000000 00OOO00 00000-0. 00000 00 00000 00000 00 0p... 00000 00 00000000000000 00 000000OOO00 00-op- ze- 00 00 00000o@. 00 00000 @00O00 00 0.a..0 S000 00o 000000OOO00 0 00000R o ___ O4 @44 Exhibit 1.2: Breadboard Exhibit 1.3: Common connections The breadboard In order to build the circuit, a digital design kit that contains a power supply, switches for input, light emitting diodes (LEDs), and a breadboard will be used. Make sure to follow your instructor's safety instructions when assembling, debugging, and observing your circuit. You may also need other items for your lab such as: logic chips, wire, wire cutters, a transistor, etc. Exhibit 1.2 shows a common breadboard, while Exhibit 1.3 shows how each set of pins are tied together electronically. Exhibit 1.4 shows a fairly complex circuit built on a breadboard. For these labs, the highest voltage used in your designs will be five volts or +5V and the lowest will be oV or ground. A few words of caution regarding the use of the breadboard: - Keep the power off when wiring the circuit. - Make sure to keep things neat, as you can tell from Exhibit 1.4, it is easy for designs to get complex and as a result become difficult to debug. - Do not strip more insulation off of the wires used than is necessary. This can cause wires that are logically at different levels to accidentally touch each other. This creates a short circuit. - Do not push the wires too far into each hole in the breadboard as this can cause two different problems. - The wire can be pushed so far that only the insulation of the wire comes into contact with the breadboard, causing an open circuit. - Too much wire is pushed into the hole; it curls under and ends up touching another component at a different logical level. This causes a short circuit. - Use the longer outer rows for +5V on one side and ground on the other side. - Wire power to the circuit first using a common color (say red) for +5V and another (black) for ground. 11  This book is licensed under a Creative Commons Attribution ,.o License - Always make sure to have a clearly documented circuit diagram before you start wiring the circuit. +5 Volts 1K Ohm Output LED 1 INPUT SWI r 33K Ohms Exhibit 1.4: Complex circuit Exhibit 1.5: Inverter circuit The inverter The inverter, sometimes referred to as a NOT gate, is a simple digital circuit requiring one transistor and two resistors. The circuit should be connected as in Exhibit 1.5. Make sure to start with a neat diagram in your lab notebook before you start constructing your circuit! The input is connected to a switch and the output connected to an LED. The two resistors are current limiting resistors and are sized to insure that the circuit operates in digital mode. If the inverter circuit is altered slightly with the addition of another transistor placed in series with the current one, it results in one more input and the creation of a NAND gate. Likewise, if another transistor is added in parallel with the transistor in the inverter circuit a NOR gate can be built. These two gates are discussed at greater length in the next chapter. Review exercises 1. Sketch your breadboard. Make sure to indicate which portions of the board are electrically connected in common. 2. Construct a truth table for an inverter with x being the input and !x being the output. 3. Using the color codes, determine the value of each of the resistors. Hint: You may need to review Appendix B if you are unfamiliar with using resistors. (a) red, orange, red (b) brown, black, orange (c) orange, orange, orange (d) brown, black, green 4. What is the symbol used for electrical ground or zero volts? Introduction to Digital Logic with Laboratory Exercises 12 A Global T ext  1. The transistor and inverter 5. Construct a truth table for a NAND gate. 6. Construct a truth table for a NOR gate. Procedure 1. Write the prelab in your lab notebook for all the circuits required in the steps that follow. 2. Obtain instructor approval for your prelab. 3. Draw a diagram of the inverter circuit. 4. With the power off on your digital trainer, construct your inverter. Upon completion of the circuit, you may wish to have your instructor examine it before turning the power on. 5. Turn power on for your circuit and verify the proper operation of the inverter. 6. Demonstrate the proper operation of the inverter for your instructor. 7. Using a 7404 series logic chip, connect one of the inverters to demonstrate its operation. Note that Appendix A contains descriptions of the 7400 series chips used in the labs, including the 7404 inverter chip. Optional exercises 1. Draw a diagram of a NAND inverter circuit using two NPN transistors. 2. Construct the NAND circuit. 3. Verify proper operation of the NAND gate. 4. Demonstrate the proper operation of the NAND for your instructor. 13  This book is licensed under a Creative Commons Attribution i.o License 2. Logic gates Learning objectives - Use 7400 series chips in designing digital logic functions. - Draw complete circuit diagrams. - Construct and debug digital logic circuits using 7400 series chips. History of logic chips Logic gates could be constructed from transistors and resistors just as the inverter was constructed in the last lab. However, using discrete transistors to build logic gates can be time consuming and prone to problems as increasing the number of connections also increases the possible points of failure. Before the advent of the transistor, and today in certain industrial applications, logic gates are created using mechanical relays. Mechanical devices suffer from similar problems along with the added complication that such devices generally cannot be switched from one state to another quickly enough for modern computer applications. The introduction of the integrated circuit in the late 1950s aimed at placing many individual circuit components in a single package that had all of the connections self-contained in silicon. This revolutionized the computing industry and has led to CPUs today that contain millions of components in a single chip. You will use 7400 series logic chips in this manual. This series of chips has been manufactured since the 1960s. These chips were used to design and build computers during that time; however, they are rarely used in computers built today. Despite this, they still have many uses (in addition to just teaching students digital logic). They are still produced, easy to obtain and are fairly inexpensive. The chips come in various packages, but the package used in these labs is a dual in-line package, otherwise know as a DIP as shown in Exhibit 2.1. In order to determine the polarity of the chip, a notch is put on one side of the chip. From a top view, pin one is on the left of the notch with other pins numbered sequentially in a counter clockwise manner. Chips may also have a dot placed near pin one. Pinouts of the chips that will be used in the labs can be found in Appendix A. 14 +5V F8 D&& & & 0 z 7400 7 Exyhibit 2.1: 7,40olNAND DIPJ Chips in the 7400 family are constructed using a variety of different circuit configurations that all have different properties. Some utilize BJT and others, field effect transistors (FETs). The different series (C, HC, L, S, LS, etc. within the 7400 family) are designed with such considerations as the need for low power consumption, switching speed, or reliability under stressful environments that might be incurred in military applications. Consult Appendix E for families that are appropriate for these labs. Introduction to Digital Logic with Laboratory Exercises 14 A Global T ext  2. Logic gates Logic symbols As mentioned in the previous lab, NAND and NOR gates can be constructed with fewer components than AND and OR gates. For this reason, the inverter, NAND and NOR make up four of the seven chips used in all of the labs. Symbols used to represent the NAND, NOR, AND, OR and inverter or NOT are provided along with the truth tables for the NAND and NOR. The truth tables have "o" representing false and "1" representing true. A circuit that can be used to create a NAND gate using two transistors is shown in Exhibit 2.7. Circuit configurations for NAND gates provided by the 7400 series chips, while logically equivalent, vary from this design. A Exhibit 2.2: NAND A B Y o o 1 0 1 1 1 0 1 1 1 0 Table 1: NAND table A By Exhibit 2.3: NOR A B Y o o 1 0 1 o 1 0 0 1 1 0 Table 2: NOR table A ->Y Exhibit 2.4: Inverter B- Exhibit 2.5: AND Exhibit 2.6: OR +5 Volts 1K Ohm A Exhibit 2.8: A' AND B Output LED 1 INPUT swi SW2 Notice that only the small circle is used to indicate the inversion of the AND to produce the NAND instead of using the full inverter symbol in Exhibit 2.2. This shorthand is often used at the input of a gate, shown in Exhibit 2.8 which is equivalent to (A' AND B). 33K Ohms circuit Exhibit 2.7: NAND Since the NAND gate is used more often, how do you obtain a simple AND or OR gate? One way would obviously be to simply combine a NAND gate along with an inverter as in Exhibit 2.9. While this works, as each chip contains more than one gate, if an extra NAND is available, it may be more advantageous to use a spare gate rather than to use an entirely new chip as in Exhibit 2.10. 15  This book is licensed under a Creative Commons Attribution i.o License Exhibit 2.9: NAND inverter yields AND Exhibit 2.1o: NAND NAND to yield AND Logical functions Exhibit 2.11 demonstrates how to implement a simple logical expression using the gates provided. Make sure to use only those gates that are provided in your kit when designing your circuit. This diagram implements the function f(A,B,C) = AB + BC. Since there are three inputs to this function, there are eight possible logical input conditions as shown in the truth table. A BCf 0 0 1 0 0 10 0A 0 1 1 1 B - OUT PUT 1 O O O - C 1 0 1 0 Exhibit 2.11: AB + BC 1 1 0 1 1 1 1 1 Table 3: AB + BC When building a logical circuit, it is important to document the circuit diagram as shown above. However, even this diagram could be made clearer for those attempting to build and debug the circuit. Exhibit 2.12 yields a much more detailed description of how the circuit should be built. You should include a diagram for every circuit that you build in your lab notebook and you should follow the format in Exhibit 2.12. Let us examine the type of information contained here. First, chips are labeled as ICI, IC2 and IC3. Then a legend is included that specifies the type of chip for each of the IC or integrated circuits. The IC numbers should appear in the order that they will appear in your breadboard from left to right or top to bottom, depending upon how the breadboard is A SW 1 configured in your digital trainer. Second, 2 | 1 3 2 OUTPUT the pins used for each connection on the 2 IC2 chip are also given, which makes connecting 4 6 4 5 6 the circuit possible without having to C SW3 5 ICI - 7400 continually consult the datasheet for that IC2 - 7402 logic chip. Third, the switches and LEDs are IC3 - 7404 NOTE: All inverters IC3 labeled in the order that they are used for Exhibit 2.12: Detailed wiring diagram for AB+BC Introduction to Digital Logic with Laboratory Exercises 16 A Global T ext  2. Logic gates the respective inputs and outputs. All of this makes it much easier to construct and demonstrate the circuit. But above all, the greatest benefit comes if the circuit does not work and needs to be debugged! In this case, with all of the pins clearly labeled on your diagram, it is much easier for someone to examine your circuit, compare it to your diagram, trace the various connections and hopefully find and correct any problems in the circuit. LAB NOTEBOOK TIP: In addition to the circuit diagram, always put a truth table in your lab notebook to make it easier to debug and test the operation of your circuit. This circuit would require three different 7400 series logic chips and ten different connections, yet if designed with individual transistors using the inverter from the last lab, as well as the NAND circuit shown in Exhibit 2.7, this would take nine different transistors, fifteen resistors, and many more connections than if just the chips were used. It is no wonder that the decrease in complexity of digital circuits that followed the introduction of the 7400 series chips led to a revolution in the computing industry! Let us examine one more simple circuit. This one is used to implement an exclusive or (XOR), which is represented by the symbol E in logical expressions. The truth table for A XOR B follows along with the gate used to represent it in circuit diagrams. As no XOR chip is provided in the kit, in order to implement this circuit, the XOR must be built by examining the truth table to find the resulting logical function, A'B + AB'. The circuit diagram for the XOR is shown in Exhibit 2.14. Remember, a diagram such as this should be included in your lab manual to ease construction and debugging of the circuit. A B @)A o o 0B o 1 1 Exhibit 2.13: XOR 1 0 1 1 1 0 Table 4: XOR table 1C3 - 7402 AllInverters2lUC2 Exhibit 2.14: Circuit diagram for XOR We will discuss how to build more complicated circuits in the next chapter, as well as how to logically simplify the functions with Boolean algebra. Both circuits designed in this chapter can be simplified significantly with the use of De Morgan's law, also discussed in the next chapter. 17  This book is licensed under a Creative Commons Attribution ,3.0 License Review exercises 1. If a logic function has three inputs, how many rows must the truth table have to contain all possible states? Justify your answer. 2. Repeat the last problem for five inputs. 3. For the following functions, construct a truth table and draw a circuit diagram. 1. y(A,B) = (AB)' + B' 2. y(A,B,C) = (A + B)'C 3. y(A,B,C) = (AC)' + BC 4. y(A,B,C) = (A@ B)C' 5. y(A,B) = A'+ B 6. y(A,B,C) = ((A+B)'(B+C)')' 1. For 3(e) of the previous exercise, design the circuit using 7400 series chips listed in Appendix A. Label the pinouts on the circuit diagram. Make sure to label all of the pinouts, just as in Exhibit 2.14. 2. Repeat exercise 4 using 3(f). Procedure 1. Write the prelab in your lab notebook for all circuits required in the steps that follow. 2. Obtain instructor approval for your prelab. 3. Assemble one single NAND gate from a 7400 chip and verify its operation. 4. Assemble one single NOR gate from a 7402 chip and verify its operation. 5. Build the circuit required for Exercise 4 from the review exercises. Make sure to have your instructor verify that your circuit works correctly before moving on. 6. Build the circuit required for Exercise 5 from the review exercises. Optional procedure 1. Design, construct, and verify the operation of the circuit from Exercise 5 using only NAND gates. Introduction to Digital Logic with Laboratory Exercises 18 A Global T ext  This book is licensed under a Creative Commons Attribution i.o License 3. Logic simplification Learning objectives - Use reduction techniques to obtain minimal functional representations. - Design minimal three and four input logical functions. - Build and debug three and four input logical functions. De Morgan's laws As you observed in the previous lab, managing the number of connections (or wires) in your circuit can become a challenge. This challenge seems to increase exponentially as the number of components in the circuit increases. In order to keep your breadboard as neat as possible and your design as simplified as possible, it is often advantageous to spend time examining the logical function for ways to reduce the complexity of the final design. Reducing the number of gates in a circuit will generally lead to a reduction in the number of connections, resulting in a simpler circuit. Designs with fewer connections and parts have fewer possible points of failure. Less complex circuits are generally easier and cheaper to build and debug. In this chapter, techniques will be introduced that can help to implement complex circuits in the least complex manner possible. It is often possible to implement logical functions correctly in many different ways. The first step in obtaining a logically minimal expression should be a clear understanding of the rules of Boolean algebra listed in Appendix D. De Morgan's laws in particular can be very helpful when attempting to simplify circuit design. De Morgan's laws are listed below. (AB)' = A' + B' (A+B)' = A'B' Given these two equations, it is easy to see the alternate symbols that are sometimes used for the AND and OR gates listed in Exhibit 3.1 and Exhibit 3.2. Applying De Morgan's laws to the functions listed yields the following. (A'+ B')' = (AB')' = AB (A'B')' = ((A + B)')' = A + B YAY BID B Exhibit 3.1: Alternate OR symbol Exhibit 3.2: Alternate OR symbol An example of using De Morgan's laws for simplification can be found by examining the logical function: AB + BC from the previous chapter. This function can actually be implemented with just three NAND gates and one 7400 chip. Examining the equation AB + BC below and applying De Morgan's law demonstrates that the expression can be implemented with only NAND gates. AB + BC ((AB + BC)')' Double Negative ((AB)' (BC)')' De Morgan's law Introduction to Digital Logic with Laboratory Exercises 19 A Global T ext  3. Logic simplification Notice that the first expression exactly matches the function that was built in the previous chapter using two NANDs, one NOR and three inverters. The new circuit shown in Exhibit 3.3 implements the same expression with just three NAND gates. This results in a design using only one 7400 series chip and fewer connections that still yields the same result. Designs with fewer chips and wires generally take less time to build, resulting in less expensive, more robust circuits. Similarly, the circuit that implements the XOR from the last chapter could be built 2 C1 3 with just NAND gates, however as five gates would be 8 OUTPUT required, it still would use two chips, one 7400 and a B SW2_ICl LED 1 7404.410 Karnaugh mapscs 5c 6 Karnaugh maps or K-maps for short, provide anotherIl7 means of simplifying and optimizing logical expressions. This is a graphical technique that utilizes a sum of product Exhibit 3.3: AB + BC (NANDS only) (SOP) form. SOP forms combine terms that have been ANDed together that then get ORed together. This format lends itself to the use of De Morgan's law which allows the final result to be built with only NAND gates. The K-map is best used with logical functions with four or less input variables. As the technique generally becomes unwieldy with more than four inputs, other means of optimization are generally used for expressions of this complexity. While it can be more instructive for students to use Boolean algebra reduction techniques, when minimizing gate circuits using Boolean algebra; it is less obvious for students to recognize when they have reached the simplest circuit configuration. One of the advantages of using K-maps for reduction is that it is easier to see when a circuit has been fully simplified. Another advantage is that using K-maps leads to a more structured process for minimization. In order to use a K-map, the truth table for a logical expression is transferred to a K-map grid. The grid for two, three, and four input expressions are provided in the tables below. Each cell corresponds to one row in a truth table or one given state in the logical expression. The order of the items in the grid is not random at all; they are set so that any adjacent cell differs in value by the change in only one variable. Because of this, items can be grouped together easily in rectangular blocks of two, four, and eight to find the minimal number of groupings that can cover the entire expression. Note that diagonal cells require that the value of more than two inputs change, and that they also do not form rectangles. A'B' A'B AB AB' A' A A'B'A'B AB A 00 01 11 10 0 1 00 01 11 10 CD B' C' 00 ___ ___00 C'D B C 011 1 CD 11 CD' Table 6: 2 input K-map Table 7: 3 input K-map 10 Table 5: 4 input K-map 20  This book is licensed under a Creative Commons Attribution i.o License Examine the expression f(A,B,C) = ABC + ABC' + A'BC + A'BC'. As listed, it requires four three-input AND gates, one four-input OR gate and several inverters. The truth table is copied over to the eight cell K-map below. Notice the square of ones in the center of the K-map. These cells all share the fact that they are true when B is true. And indeed, the expressions shown below are equivalent. A B C f o o o o AB' AB AB AB' 00 01 11 10 o o 1 0 o 1 0 1 o 1 1 0 o 1 1 1 C o 1 1 0 1 0 0 0 1 __ _ 1 0 1 0 11 0 1 B 1 1 1 1 Table 8: f(A,B,C) Exhibit 3.4: K-map of f(A,B,C) ABC + ABC' + A'BC + A'BC' = AB(C + C') + A'B(C + C') Distributive Property = AB + A'B C + C' is always true = (A + A')B Distributive Property = B A + A' is always true Of course, implementing the logical expression B is much simpler than the previous expression! Although rules of logic applied above yield the same result, it is often much easier to note the groupings that result in minimal expressions using the graphical representation of the K-map. Let us examine the equation g(A,B,C,D) given in the truth table in Table 6 with the associated K-map. The expression contains three different terms: A'B', AC, and ABC'D circled in Exhibit 3.5. However, this is not the minimal expression because not all of the largest possible groupings are included. In order to obtain the largest groupings, it is often necessary to overlap some of the terms. This just causes certain terms to be included in more than one grouping as shown in Exhibit 3.6. Notice term ABCD which is actually included in two different groupings, ABD and AC, which is perfectly acceptable. Using the new groupings, we obtain the minimal SOP expression g(A,B,C,D) = A'B' + AC + ABD. This expression contains the same number of groupings or products, but one less term in one of the products. In this case ABC'D from Exhibit 3.5 is replaced with ABD in Exhibit 3.6 yielding a simpler expression. While other techniques exist for finding minimal expressions, with some practice, the K-map can be used effectively for expressions with four or less inputs. Not selecting the largest grouping is a very common error to those just beginning to use K-maps. Remember, always select the largest grouping possible, even if it results in some terms being double covered. Larger groupings result in simpler expressions. Introduction to Digital Logic with Laboratory Exercises 21 A Global T ext  3. Logic simplification A B CDg 0 0 0 0 1 0 0 0 1 1_ O O0 1 0 11 O 0 1 1 1 0 1 0 o0o0 0 1 0 1 O 0 1 01 10 0 1 1 1 0 1 0 o0o0o0 010 0 10 1 0 1 0 1 1 0 1 1 1 1 11010 11 010 1 1 1 0 1 Table 9: g(A,B,C,D) A'B' A'B AB AB' 00 01 n 10 C'D' 0 0 0 00 C'D 01 1 0 E C)1 0 1 1 CD 1 0 1 1 10 I ranC L A'B L AC Exhibit 3.5: K-map of g(A,B,C,D) In summary, the procedure for using K-maps to find minimal logical expressions is given below. 1. Construct the K-map corresponding to the truth table. 2. Circle any 1 that is NOT adjacent (isolated) to any otheri. 3. Find any 1 that is adjacent to only one other 1. Circle these pairs, even if one in the pair has already been circled. 4. Circle any group of eight (octet), even if a 1 in the group has already been circled. 5. Circle any group of four (quad) that contains one or more one i that is not already circled. A'B' AB AB AB' 00 01 n 10 CD' 1 0 0 0 00 C D1 0 1 0 OIL-I 0n11 CD 1 0 1 1 CD' 10 ABD L AB -L 6. Make sure that every 1 is circled. AC 7. Form the OR sum of the terms generated by each grouping. Exhibit 3.6: K-map of g(A,B,C,D) The following example goes through all the steps in order to find the minimal expression for h(A,B,C,D). First, the truth table given in Table 8 is transcribed to fit into the K-map given in Table 5. 22  This book is licensed under a Creative Commons Attribution ,i. o License I I ,, A IB IC FDg O O O 1 1 O O 1 O O O O 1 1 0 0 1 0 0 1 0 1 0 1 1 0 1 1 0o0 0 1 1 1 1 1 0 o0o0o0 1 0 0 1 1 1 0 1 0o1 1 0 1 1 0 1 1 0 0 1 1 1 0 1 1 1 1 1 o0o0 1 1 1 1 0 Table10: h(A,B,C,D) A'B' A'B 00 01 C'D' 0 1 00 C'D 1 1 01 CD o 1 11 CD' o 0 10 AB AB' 11 10 1 0 1 1 o O o 1 C'D' 00 C'D 01 CD 11 CD' 10 00 1 A'B AB 01 11 1 1 AB' 10 0 1 1 1 1 1 o 1 0 0 0 0 0 1 Table ii: h(w,x,y,z) Table 13: Step 2 In step 2, above, the bottom right is shaded. 1 in the A'B' 00 A 0 C'D' 0 00 C'D 1 01 CD o 11 CD o 10 Table 12: Step In step 3, to the left, the pair of L'B AB AB' two is in the second column is 1 11 10 shaded. Note that the bottom item 1 1 0 A'BCD dictates that this group is circled. The top item, A'BC'D has 1 1 1 many different adjacent elements, 1 0 0 but the first i only has one adjacent element. For step 4, no groups of 0 0 1 eight exist, so there is no table. For step 5, two groups of four exist, C'D P 3 and BC'. A'B' AB AB AB' oo0011a10 C'D' 01 CD o 1 o o 11 CD' o 10 Table 14: Step 5 0 0 1 Note that both of these groupings cover elements already covered from step 2 and that both share the group of two, BC'D. This overlap is shaded in green. This is not only perfectly acceptable, but required to obtain the minimal expression. Now, all of the is are covered, yielding the minimal solution. h(A,B,C,D) = AB'CD' + A'BD + BC' + C'D Introduction to Digital Logic with Laboratory Exercises 23 A Global T ext  3. Logic simplification Circuit design, construction and debugging While these techniques are useful in minimizing the logical expression, ultimately the circuits still need to be constructed. As the complexity of the circuits increases, it is important to note some of the techniques that can be useful in building a complete working circuit. DESIGN TIP: The time spent in the design stage can pay huge dividends later! Mistakes made at the beginning of the design phase carry through the entire process and can consume countless hours trying to debug the final product. - Start by making sure that the circuit minimization was correct and copied in your lab notebook. The truth table is helpful when testing the final circuit. Building the wrong circuit serves no purpose at all. - Verify that the pinouts selected are proper for each gate and chip; these are helpful when debugging as well as when building the circuit. Again, time spent here helps cut down on the construction and debugging later. - Remember the tips given in Chapter i regarding the use of the breadboard. - Keep connecting wires neatly and avoid unnecessarily long loops of wire, yet do not spend excessive time cutting wires that are exactly the proper length between spans. It may feel like a work of art, but in the end you want a neat circuit that works properly. And if your circuit does not work properly: - Attempt to reason out the problem. Does the circuit act reliably? - Does it always produce the same wrong result? If so, then the error is likely in the logic. - If it yields different results at different times, a loose connection is very likely. If two output lines are connected together (which should never be done), it can also result in unpredictable outputs. - Test each component of the circuit independently. For example, if you have the expression AB' + ABCD + ABC' built with NAND gates and inverters, first test that the input and output of (AB')' is working correctly. Then move onto each succeeding term. - Verify the circuit has power and ground to all of the appropriate pins for each chip. - Verify that all of the pins are connected properly. - Make sure that they follow what is specified in your circuit diagrams. - Make sure that none of the output pins are tied together. If each of the output pins were to obtain a different value, this could result in a logic high being tied directly to a logic low level. At best, this can result in an indeterminate value. This will result in further problems if this output is then used as an input for another gate. - Remember that often things do not work the first time when you build them. 24  This book is licensed under a Creative Commons Attribution ,.o License DEBUGGING TIP: Do not allow yourself to get frustrated! This is easier said than done, but getting upset does not serve any purpose in effective troubleshooting. If you have done all of the above and things still do not work: - Return to the design phase and verify that your minimization and pinouts are correct. - Sometimes errors come from the components or equipment themselves. Errors such as those listed below can occur, but are very rare. These should be considered as a last resort and other causes of error should be investigated before looking for the following errors: - A pin on a DIP can become bent and curl under the chip so that it does not get inserted into the breadboard. This is difficult to see without taking the chip out and examining its legs. - In general, solid state devices are very reliable when operated under proper temperature ranges, but very occasionally a chip may be faulty. - Connecting wires can be split inside of the insulation. When this occurs, the insulation will cause the wire to look as though it is intact, but if the copper is in two pieces inside the insulation, current will not flow and the wire will actually be open. - Faulty test equipment can adversely effect the circuit being tested and lead one to believe a circuit is malfunctioning when it is not, or give you other false information that leads you down the wrong path in your reasoning. - Ask for help from fellow classmates and your instructor. - Take a break and come back to the problem. No one works at their best when they are totally aggravated. Review exercises 1. Design a 4-input NAND gate using two 2-input NAND gates and one 2-input NOR gate. Hint: Use DeMorgan's law. 2. What are the possible groupings in a 4-input K-map? Sketch their shapes. 3. Construct a truth table for the following functions: (a) f(A,B,C) AB + A'BC' + AB'C (b) g(A,B,C) A'C + ABC + AB' (c) h(A,B,C,D) A'BC' + (A E B)C + A'B'CD' + ABC (d) j(A,B,C,D) A'C'D' + C'D + CD 4. Construct the K-map for each of the functions from the previous problem and determine the minimal expression for each. 5. For 3(b), design the circuit for the minimal SOP expression found in problem 4 using just NAND gates and inverters. Label the pinouts on the circuit diagram. Introduction to Digital Logic with Laboratory Exercises 25 A Global T ext  3. Logic simpification 6. For 3(c), design the circuit for the minimal SOP expression found in problem 4 using just NAND gates and inverters. Label the pinouts on the circuit diagram. 7. Given each of the K-maps, determine the minimal expression associated with it. (a) (b) A'A A'B' A'B AB AB' 0 1 00 01 11 10 B' iCi B' 1 ' 1 1 1 1 0 0 B 10 C 0 0 0 (c) (d) A'B' A'B AB AB' A'B' A'B AB AB' 00 01 11 10 _________ ____ ____ ____00 01 11 10 C'D' 1 1 1 1 C'D' 0 0 0 0 C'D 1 1 1 0 C'D 1 1 0 01 01 CD 0 0 1 1 CD o 1 0 1 11 11 CD' 0 0 1 1 CD' 1 1 0 0 10 10 Procedure 1. Write the prelab in your lab notebook for all the circuits required in the steps that follow. 2. Obtain instructor approval for your prelab. 3. Build the circuit required for Exercise 5 from the review exercises. (a) Make sure to test each of the portions of the expression independently. Meaning, test the output of each of the first level NAND gates to verify that each works before testing the final output. (b) Demonstrate the working circuit for your instructor. 4. Repeat the steps from the last procedure for Exercise 6 of the review exercises. 26  This book is licensed under a Creative Commons Attribution i.o License 4. More logic simplification Learning objectives - Review all possible K-map groupings. - Use "don't care" conditions in minimization. Additional K-map groupings Some of the rectangular groupings allowed for Karnaugh maps, such as the one in Exhibit 4.1, are not obvious. Cells on borders actually are adjacent to cells on the opposite border, which produce groupings that may not appear continuous. This grouping of two cells actually forms a rectangle represented by B'C', even though this rectangle is split. A'B'A'B AB AB' 0 o I o o 1 1 1 o 1 1 B'C' Exhibit 4.1: K-map grouping The possibilities for non-obvious groups increase for K-maps with four-input functions. Exhibit 4.2 shows B'D, a four cell square grouping that is split on the two side borders. In Exhibit 4.3, the eight cell rectangular grouping D' is shown. One of the most non-obvious four cell groupings that contains all four corners is shown in Exhibit 4.4. The interested reader can verify that the minimal expressions for Exhibit 4.2 , 4.3 and 4.4 are B'D+A'D+A'B'C, D'+AB'+A'C' and B'D'+A'BD+A'CD respectfully. A'B AB AB AD o00 ea_ n_10o CD 0 0 0 0 1 11 O 01 1 0 F i H i i ; r CD n 1i 1 0 L B'D A'B' A'B AB AB _E**L*A*P 00 01 U 10 00 CD 1 0 1 01 CD 0 0 0 1 10 DI Exhibit 4.3: 8-element group AWB AB AB AB' 00 01 s1o1 1 0 0 1 00 L" 01 1 1 0 1 Cw1 0 1 i0 : Focr Exhibit 4.4: Four corner group CD Exhibit 4.2: 4-element group Introduction to Digital Logic with Laboratory Exercises 27 A Global T ext  4. More logic simplification Input placement on K-map All of the K-maps shown so far have had the input variables A and B set along the top with the input variables C and D along the side. This does not need to be the case, but it is the convention used here. In addition, the inputs have used the gray code oo -> 01 -> 11 -> 10, which does not need to be the case either. For example, the input sequence could have been oo- >io->11->o1 while still only changing one input at a time. Although altering these conventions will still lead to the exact same minimal expressions, it is discouraged because when verifying results, it can often lead to confusion. By altering the convention, you could cause those trying to assist you to spend extra time when examining your work. The following example does illustrate how the same representation will be obtained D'C' D'C DC DC' Go an -A B' 1 1 0 1 00 A'B' AB1 1 0 0 n 1A LD' 8-input K-map grouping Exhibit 4-5: despite the ordering of the input variables. In Exhibit 4.5 the same function is represented as in Exhibit 4.3. In this case, the region highlighted for D' does not span two boundaries, while the grouping for A'C' does in this format. Again, it can be shown that the same minimal expression is obtained: D' + A'B + A'C'. Don't care conditions While all input cases for a logical function must be considered, in an actual design it often occurs that certain cases never exist. For instance, a particular counter that cycles through the states zero through five would never reach states six (iio) and seven (111). In such cases, it can be advantageous to fill the spots for these cases with a don't care condition (d). The don't care can then be included with a grouping if it helps to minimize the final logical representation, otherwise it can be treated as false. Consider the example in Exhibit 4.6. If only the ones are grouped, the minimal expression is C'D' + A'BC' + BD'. However, if the don't care conditions are allowed to be grouped with ones, the resulting minimal expression is B + C'D'. Remember that the presence of a don't care condition does not require that this cell be covered in the final output. Exhibit 4.7 demonstrates this case. Note, two of the don't cares are included to yield a minimal representation of C'. The don't care along the bottom is not included at all. B' A'B AB AB' 00 1 1 10 ** F C 0 1 d o 01 ~od do n CD' 0 1 1 0 120 1 'D At A'B AB AB' 0 0 1 U 0 d d C 0 d o o n1 Exhibit 4.7: Don't care not covered I B Exhibit 4.6: Don't care conditions 28  This book is licensed under a Creative Commons Attribution ,3.0 License Review exercises 1. Given each of the K-maps, determine the minimal SOP expression. d represents a don't care condition. (a) (b)_I _ I_ I III C' 0 C 1 A'B' A'B AB AB' 00 01 11 10 d o 1 1 1 0 0 d C' 0 C 1 A'B' A'B AB AB' 00 01 11 10 0 0 1 1 1 d d 1 (c) (d) A'B' A'B AB AB' 00 01 11 10 C'D' 0 0 0 1 00 C'D 0 0 1 1 01 CD 1 0 1 1 11 CD' 1 0 0 1 10 A'B' A'B AB AB' 00 01 11 10 C'D' 1 1 0 1 00 C'D 0 1 0 0 01 CD o 1 0 0 11 CD' 1 0 1 10 (e) C' 0 C 1 A'B' A'B AB AB' 00 01 11 10 1 1 0 1 0 1 1 0 A'B' A'B AB AB' 00 01 11 10 C'D' 1 1 0 0 00 C'D 1 1 1 1 01 CD o 0 0 0 11 CD' 1 0 0 10 2. For the functions listed below, construct a K-map and determine the minimal SOP expression. a. f(a,b,c) = a'b'c' + a'bc' + abc' + abc b. g(a,b,c) = ab'c' + abc' + abc + don't cares(a'bc + ab'c) c. k(a,b,c,d) = abc'd + ab'c'd + a'bc'd + a'b'cd' + don't cares(a'b'cd+ a'bcd + ab'cd + abcd) d. m(a,b,c,d) = a'b'cd' + a'bcd' + abc'd' + abcd' + ab'c'd' + ab'cd' + don't cares(a'bc'd + abc'd) Introduction to Digital Logic with Laboratory Exercises 29 A Global T ext  4. More logic simplification Procedure 1. Write the prelab in your lab notebook for all the circuits required in the steps that follow. 2. Obtain instructor approval for your prelab. 3. Build the circuit required for Exercise 2(b) from the review exercises. 4. Demonstrate the working circuit for your instructor. 5. Repeat the steps from the last procedure for Exercise 2(c) from the review exercises. 30  This book is licensed under a Creative Commons Attribution i.o License 5. Multiplexer Learning objective - Use the multiplexer to implement complex logical functions. Background on the "mux" A multiplexer, often just called a mux, is a device that can select its output from a number of inputs. This device is useful in computer systems that use a bus architecture, where several devices share the same communication path. A 2-to-1 multiplexer is shown in Exhibit 5.1. In this case the two inputs are Do and Di. If the select line is low, then the output will reflect the state of Do. Likewise, if the select line is high, the output is the state of Di. Hence, the output is switched between two different devices connected to Do and Di using the select line. In this way, only one device will be active or connected to the bus at any given time. Select DO D1 Exhibit 5.1: 2-to-1 multiplexer With an increase in the number of select lines, multiplexers allow for more than just two input lines. If two select lines are used, then the output can be selected from four different inputs forming a 4-to-1 mux. The 74151 provided in your kit is an 8-to-i mux that uses three select lines to chose from 8 different input lines. A diagram of the 74151 chip is given in Appendix A. The 8-to-i multiplexer can be used to take a byte of parallel data on the input lines and determine which of the input lines to display at the output. This is useful with bus architectures in order to convert the parallel data that most often comes in bytes into a serial stream of bits. Using a multiplexer to implement logical functions Another use for the mux is to implement fairly complicated logic functions without the aid of other logic gates. As an example, examine the following function along with its K-map, and the resulting minimal SOP expression. g(a,b,c) = a'b'c' + a'bc + ab'c' + ab'c + abc' = a'bc + b'c' + ac' + ab' In order to implement the circuit of this function for even the minimal SOP representation, five NAND gates are required. However, a single mux can be used to implement the same expression. The key is to use the input variables for the function as the input for each select line and set the data lines to the value for each of the Introduction to Digital Logic with Laboratory Exercises 31 A Global T ext  5. Multiplexer corresponding outputs. Note that the value of data lines Do, D3, D4, D5, and D6, which also are found on pins 4, 1, 15, 14, and 13 are set to high with the remaining data lines set low. In this manner, any three input logical functions can be built with a single mux. Note that as mentioned previously, the strobe pin is tied low and the order of the inputs from the function differ from the order of the input lines for the 74151 chip. AfBf 00 ct 1 A'B AB 01 11 O 1 1 " f 10 4 +5Volts Pins 1,4,13, 14,15,16 0 Table 15: g(a,b,c) A B Cf 0 0 0 1__ 0 01 0 0 1 00 0 1 1 1 1 001 1 0 1 1 1 1 0 1 1 1 1 0 Table 16: g(a,b,c) 1-D3 | T 2- D2 Vcc - 16 D4 - 15 D5-14 D6-13 3-D1 - 4-DO Out -led 1== 5-Output D7-12 Select A-11 c -switch3 b - switch 2 SelectB 8-10 6- !Output S7 - Strobe ,- a -switch 1 8 - GND Select C - 9 f Ps 2,3,7,8,12 Exhibit 5.2: Circuit for g(a,b,c) When used in this manner, the 74151 is often referred to as a boolean function generator. This circuit could be even more flexible if the data input lines, Do through D7, could be changed. The function that the multiplexer implemented could be changed while the circuit is running with the use of memory chips to store temporary values for the input lines to create a truly programmable boolean function generator. When using the 74151 multiplexer: (i) Make sure to properly select the strobe line. (2) Note that values chosen for A, B, and C may differ from those given in the truth table in Appendix A. Appendix A assumes that C is the most significant input line, which may not be the case in your design. Just as this method of using an 8-to-i mux can be used to implement any 3-input function with just one chip, any 4-input function can be built with a 16-to-i mux. However, the kit provided with this lab only contains the 8-to- i mux. This can present a problem when a complex four input function would require several different 7400 series 32  This book is licensed under a Creative Commons Attribution ,.o License chips to implement, such as the function h(a,b,c,d) found in the K-map and truth table that follow. Two different minimal SOP expressions exist for this function. h(a,b,c,d) = a'bc' + a'b'c + acd' + ab'c'd + a'c'd' h(a,b,c,d) = a'bc' + a'b'c + acd' + ab'c'd + a'bd' Either of the terms at the end of each expression could be used to obtain a minimal expression. Yet, either would require four 3-input NAND gates, one 4-input NAND gate and one 5-input NAND gate, assuming that your kit even provided NAND gates with four or five inputs. It may not be obvious how to use the multiplexer in cases such as this to implement the function. One approach would be to use two mux chips along with some additional gates. One trick is to use two 8-to-i multiplexers along with one 2-to-1 mux as shown in Exhibit 5.1. Each half of the function is implemented with an 8-to-i mux and the output of each is selected using the remaining input as the select line for the 2-to-1 mux. Luckily, a simple trick can be used with an 8-to-i mux. First take the function given in the K-map for h(a,b,c,d) produce the truth table, but add one column for the multiplexer input of each data element. a'b' a'b ab ab' a b c d h(a,b,c,d) Input 00 01 11 10 c'd' 1 1 0 0 o o o o o Do d 00 0 0 0 1 1 Do=d c'd 0 1 0 1 o o 1 o o Di=o 01 O O 1 1 o Di=o cd 1 0 0 0 0 1 0 1 D2=1 11 _____ cd' 1 0 1 1 0 1 0 1 1 D2=1 10 o i i o o D3=d Table 17: h(a,b,c,d) o 1 1 1 1 D3=d i o o o o D4=d Each of the two rows in the sixth column now represent one of 1 0 0 i 1 D4=d the input lines. Instead of the input lines taking just true or false i o 1 0 1 D5=d' to implement the truth table directly, the input lines will take the 1 o i i o D5=d value of true, false, d, or d'. In this way, only one multiplexer 1 1 0 0 1 D6 1 needs to be used along with possibly one inverter gate. As a, b, and 1 1 0 1 i D6=i c are used to select the data line, each set of two rows that share the same input values for a, b, and c are grouped together in the I I1 10D7=0 table. Then by comparing the output value of h for these two rows, I 1 I1 1 D7=0 it can be determined what value the data line should take. For Table 18: h(a,b,c,d) example, since h matches input d for the first two rows, the input value for Do should be tied to input d. The circuit that implements h(a,b,c,d) is given in Exhibit 5.3. It is assumed that the inverse of the input d is available somewhere in the circuit, if not, an inverter would need to be added to this circuit. Introduction to Digital Logic with Laboratory Exercises 33 A Global Text  5. Multiplexer 4 +5Volts 5V - 2,12.13 16 d 1 - D3 Vcc -1l6 2- D2 D4 - 15 D5 - 14 d 3 - D1 d 4 - DO Out - led1 5 - Output D6 -13 D7 -12 Select A - 11 c - switch 3 """6 - !Output "1 7 - Strobe Select B-10 Select C - 9 b - switch 2 a -switch 1 8- GND ___j Gnd -3.,7,8,12 d -switch 4 IC -74151 Exhibit 5.3: h(a,b,c,d) implemented with 8-to-i mux As the mux can implement logical functions directly from the truth table without the need for any logic minimization, it is often tempting to use the mux to implement every function and simply skip the minimization techniques described earlier. Resist this temptation! Often the minimal SOP implementation will require few gates resulting in a simple design without a mux. In addition, when different functions are required for a given circuit, if only multiplexers were used, a mux would be needed for each and every function. However, the minimal SOP expressions for the different functions will sometimes share common logical terms. Examine the two functions below that are required for a given circuit. f(x,y,z) x'yz g(x,y,z) z' + x'yz They share the term x'yz, and this part would only need to be built once and could be used for both functions, saving gates. Sharing of terms in this manner is not possible when using the mux to implement functions. So in order to insure that the simplest circuit is designed to implement the function, the logic minimization techniques described earlier should be examined first before resorting to the mux to implement a function. 34  This book is licensed under a Creative Commons Attribution ,3.0 License Review exercises 1. Construct the truth table and K-map for each of the following functions and determine the minimal SOP expression. (a) fi(a,b,c) = a'b'c' + a'bc' + a'bc + ab'c' (b) f2(a,b,c) = a'b'c + a'bc + abc' + ab'c (c) f3(a,b,c,d) = a'b'c'd' + a'bcd + abcd + ab'c'd' + ab'c'd (d) f4(a,b,c,d) =a'b'c'd' + a'bc'd + abcd + a'b'cd' + a'b'cd + a'bcd' + ab'c'd 2. Design the implementation of expression 1(b) using an 8-to-1 mux. 3. Design the circuit that will implement 1(d) using an 8-to-1 mux chip along with any necessary circuitry. 4. Examine the following four-input functions and design a circuit that will implement each. (a) gi(a,b,c,d) = a'b'c'd + abcd + a'bcd + a'bc'd + ab'c'd + a'b'cd + abc'd + ab'cd (b) g2(a,b,c,d) = a'bc'd + a'b'cd' + ab'cd (c) g3(a,b,c,d) = abc'd' + abc'd + abcd + abcd' + a'bc'd + a'bcd (d) g4(a,b,c,d) = a'bc'd' + abc'd' + abcd' + ab'cd' + a'bc'd + abc'd + abcd + ab'cd Procedure 1. Write the prelab in your lab notebook for all the circuits required in the steps that follow. 2. Obtain instructor approval for your prelab. 3. Build the circuit required for Exercise 2 from the review exercises of the previous chapter. Demonstrate the working circuit for your instructor. 4. Repeat the steps from the last procedure for Exercise 3 from the review exercises. Introduction to Digital Logic with Laboratory Exercises 35 A Global T ext  This book is licensed under a Creative Commons Attribution i.o License 6. Timers and clocks Learning objectives - Review relation between time and frequency. - Construct timer and clock circuits. - Produce a timing digram for a circuit. Timing in digital circuits Timing circuits are often required for various applications. One may need to measure the length of time that a given switch has been on or off. As will be seen in future labs, for more complicated circuits, a clock is often necessary to synchronize the various components. While many different ways exist to build timing circuits, the 555 timer chip has proven to be an industry standard for this purpose. 555 timer The 555 timer chip was first manufactured in the early 1970s and continues to be used in electronic devices. As can be seen in the detailed circuit diagram given in Appendix A for this integrated circuit, it contains two diodes, many resistors and over twenty transistors. All of this is contained in one small dual inline package that can be used in timing and clocking circuits. It is important to note that propagation delays caused by the time it takes for signals to travel through the circuit components prevent it from being used in circuits requiring fast switching times. In this case, fast is considered a few pseconds. The propagation delay varies slightly depending upon the version of the 555 being used. This limitation prevents the 555 from reaching speeds necessary for modern computer systems. However, many applications have less rigorous requirements for which the 555 timer has proven to be the component of choice. Due to mass production, this chip is widely available at a modest price. Timers A timing circuit using the 555 timer is found in Exhibit 6.1. Vcc This circuit is also called a one-shot because it will work once for every time it is triggered properly. After being triggered, it turnsNR on for the specified time and then returns to its stable state of off. It is also often said to be operating in monostable mode because it Trigger 2Output only has one stable state, when its output is low, ground or off. 4 7 -CV THR -4 The circuit is triggered with a voltage below (1/3)Vcc (Vcc is56 the supply voltage for the circuit), at which time the capacitor~GV - labeled C begins charging through the resistor labeled R. At the time when the voltage on the capacitor reaches (2/3)Vcc, the V output will turn low. The voltage across the capacitor is given Exhibit 6.1: Timer circuit below. See Appendix B for more information regarding resistors and capacitors. Introduction to Digital Logic with Laboratory Exercises 36 A Global T ext  6. Timers and cocks V(t) = Vcc( 1 - e-(t/rc)) Setting V(t) equal to (2/3)Vcc and solving for t yields the time when the output will go low (assume three digits of accuracy). t = i.io(RC) Note that the values for resistors and capacitors often vary with a tolerance of ±5 per cent and ±10 per cent respectively. Hence, the time of the timer may not exactly match the calculated value. When it is critical for the application to have a very specific time, either the components used must be measured to insure that they match the time needed or a variable resistor can be used so that it can be adjusted once the circuit is built. Clocks Just as the drummer in a band helps to keep the rest of the members synchronized, so does the clock in a circuit. A clock is used to synchronize a circuit that contains different components that have different propagation delays. Synchronization is required because signal changes take time to travel through a circuit. Internal inductance and capacitance found in the wires of the circuit and the components themselves cause delays. In order to insure that each transition or change has fully propagated through the circuit, the clock can only switch as fast as it takes the slowest part of the circuit to fully register each change. Modern processors have clocks that operate in the gigahertz range and are built with the use of crystals. The 555 timer chip cannot be clocked that fast due to the internal propagation delay within the transistors in the chip, but it can provide a reliable clock pulse for applications that do not require that speed. Clock §Ioikit2 Exhibit 6.2: Clock waveform Clock speeds are given in terms of frequency which uses the unit hertz; this stands for cycles per second. So if a clock is said to have a frequency of 200 megahertz, it transitions from logic high to logic low 200,000,000 times in one second! Another measure often associated with a clock is its period, which is the time it takes for the full clock cycle. The period of the 200 megahertz clock is 5 nanoseconds. T =i/f Mathematically, period (T) and frequency (f) are related inversely. The clock waveform given in Exhibit 6.2 illustrates an idealized waveform. In reality the transitions from low to high or high to low take some time and are not instantaneous as those shown. As another example, a 5 gigahertz clock has a period of 1/5,000,000,000 seconds, which is 0.0000000002 seconds or 0.2 nanoseconds. The clocks built for these labs will be much slower than this. The fastest clock will have a period of one second. 37  This book is licensed under a Creative Commons Attribution ,.o License Exhibit 6.3 shows a clock circuit using the 555 timer. When configured in this manner, it is said that the timer is operating in astable mode. This Vcc means that there is no stable state for the circuit; it just continues to oscillate, going from low to high and back again. In this case, the trigger is R1 tied to the voltage across the capacitor, so that the circuit is triggered by 2TR Q 3 itself. The capacitor is charged through the series combination of R1 and 2 3Output R2 and discharged through R2. The capacitor charges to 2/3*Vcc and then DIS R2 discharges to 1/3*Vcc repeatedly. Using the same method given in the - CV THR previous section, the times to charge and discharge the capacitor along - GND V+ with the equations for the period and frequency are listed below. ti o.693(R1 + R2)C charge time t2 o.693(R2)C discharge time Exhibit 6.3: Clock Circuit T ti + t2 = o.693(R1 + 2*R2)C period f= 1/T= 1.44/((R1 + 2*R2)C) frequency Note that the accuracy of the values of the resistors and capacitors will affect the actual values for the frequency of the clock. Also, this clock will not have a symmetric waveform as it will be charging (on) for a longer time than it will be discharging (off). When measuring the frequency of the clock, count the time for ten full clock pulses and then divide this number by ten to determine the period. This will reduce the effect of timing errors introduced by those taking the measurements. Timing diagrams The graph of the logical transition for a circuit is given in a timing diagram. Timing diagrams provide a visual trace of the circuit functionality. They can also be helpful in determining the maximum possible delay for a given circuit which can then be used to determine the fastest frequency in which the circuit can be clocked. The diagrams display each value in one of three different states: logic high, logic low, and indeterminate. The indeterminate state would occur when a given state cannot be guaranteed to be either high or low. Indeterminate states are usually shown as gray areas that span the entire region from low to high for the duration of the indeterminate period. The transition edges are often not shown to be totally vertical, as they are in Exhibit 6.2. This is to illustrate the point that changes in output are not instantaneous due to delays caused by transition times as well as internal inductance and capacitance in the circuits. The timing diagram shown in Exhibit 6.5 is for the circuit found in Exhibit 6.4. This circuit has three extra points listed: A, B, and C to determine the intermediate states of each of the gates for a given transition. In this case, values for Do is assumed to be logic high and Di is assumed to be logic low with the SELECT line making a transition from logic low to logic high. A is the output of the inverter, B the output of the top AND gate, and C the output of the lower AND gate. The circuit is assumed to be in a stable state with the inputs SELECT, Do, and Di at logic low, high, and low prior to time zero. Assume that the manufacturer specifies that each gate will have a Introduction to Digital Logic with Laboratory Exercises 38 A Global T ext  6. Timers and cocks maximum delay of 10.0 nanoseconds. This may vary depending upon the logic family used, so the data sheet should be consulted for verification DO B when determining the maximum delay for a given Output circuit. Notice that once the SELECT line is brought low, A, B, and the Output all assume an C intermediate value as there is no guarantee of how D1 fast the transition will occur. Once at 10.0 Exhibit 6.4: 2xi Multiplexer nanoseconds, the output of the inverter can be verified to have gone low and the state for A is listed as low. This transition value then ripples through the other gates as the top AND gate now takes another 10.0 nanoseconds to insure that its output has changed from high to low. Output changes may occur faster than the times listed, however as that cannot be guaranteed, the slowest time must be used to determine the fastest frequency in which a circuit can be clocked. If this circuit were to be clocked, since the maximum delay for the entire circuit is 30.0 nanoseconds, this would also be the smallest allowable value for the period of the clock, which would yield a maximum frequency of 33.3 Mhertz. In these labs, the circuits will be clocked at a slow enough rate that delays on the order of nanoseconds will not impact the circuits. However, for circuits where speed is essential, detailed analysis such as this is critical to insure that the circuit is clocked as fast as possible while still allowing enough time for the circuit to stabilize. Output 5ov 5V C B sV o v A v Select sv 0 5 10 15 20 25 30 35 Nanoseconds Exhibit 6.5: Timing diagram Accuracy of answers As this chapter involves answers that go beyond the simple binary, true or false format, a brief discussion of the accuracy of the numbers follows. When answers are provided, it is beneficial to know how accurate those answers are. The precision of any measurement is dependent upon the accuracy of the device that is used to perform the measurement. For example, one would not expect to obtain measurements within thousandths of a second using an ordinary wristwatch or within thousandths of a millimeter using a standard ruler. Once the accuracy of the 39  This book is licensed under a Creative Commons Attribution a.0 License measurements used is understood, it is important to remember the rules that apply to the number of significant digits for any calculation. - Trailing zeros are significant to the number. - Use all digits when performing calculations and round only for the final answer. - When numbers are multiplied or divided, the final answer has the same number of significant digits as the number with the smallest amount of significant digits in the calculation. In this book, the formulas are provided using three digits of accuracy. It may be the case that fewer digits can be obtained for a given measurement or that the components used are known to only within one digit of accuracy. In these cases, the final answers should be rounded accordingly. As mentioned, the tolerances of the components will cause deviation of the measured answer from the theoretical answer. The tolerance of the resistors used in these labs is ±5 per cent while the capacitors have a tolerance of ±10 per cent. This means that for a 1000 ohm resistor, that resistor is guaranteed to be between 950 and 1050 ohms. 1000 - 0.05(1000) < actual value < 1000 + 0.05(1000) Likewise, a 1 mircofarad capacitor is guaranteed to be between o.9 pF and 1.1 pF 1 - .1(1) < actual value < 1 + .1(1) This may cause the measured answer to differ quite a bit from the answer calculated using the formulas. In addition, when the values of the resistors and capacitors are multiplied together, as is the case with the formulas above for the timer and clock, these tolerances are compounded. For example, assume that a 100,000 ohm resistor is combined with a 1oopF capacitor to produce a time of 10.1 seconds. t = 1.10(RC) = 1.1o*100,ooo*o.ooo1 = 11.0 seconds. However, if we take the worst case for each value, we can see that the answer will actually be within ±15%. 1.10(95,000)(0.00009) < actual value < 1.10(105,000)(0.00011) 9.41 < actual value < 12.7 For this reason, it should not be assumed that the final values for the clock and timer will match exactly the values calculated theoretically. The tolerances of the components used will often mean that the theoretical value of the clock or timer may only have one significant digit of accuracy. When the accuracy of the timer or clock is important, either components must be measured before being used to insure their values, components with smaller tolerances should be used (which is more costly), or resistors with adjustable values (potentiometers) can be used and adjusted after the circuits are built. Of course adjusting the potentiometers is time consuming and thus costly. Review exercises 1. What is the period in seconds of the clock with the given frequencies? (a)6.oo Ghertz (b)io Mhertz (c)6ooo RPM (NOTE: 60 seconds are in each minute) 2. For the given period, determine the frequency of the clock in Hertz. Introduction to Digital Logic with Laboratory Exercises 40 A Global T ext  6. Tirers and docks (a)io.o psec (b)o.050o nanoseconds (c)i.oo milliseconds 3. Assume delay for each logic gate is 10.0 nanoseconds for the circuit in Exhibit 3.3 and that input values of A is low and B and C are all at logic high. Draw a timing diagram for a transition at time zero that takes input for C from logic high to logic low. List input A, B, C, and Output as well as values for pins 3, 6, and 10. 4. If the delay for each logic gate is 10.0 nanoseconds, what is the maximum frequency that the circuit from Exhibit 2.14 can be reliably clocked in order to insure proper operation? 5. A 100 pF capacitor is used to build timers. Three timers are to be built with times of 1, 5 and 10 seconds. a. What resistors should be chosen to obtain the times provided? b. Assuming that you are limited to choosing the values provided in the lab, which resistors should be chosen to come as close to the desired values as possible? Recall that when resistors are added in series, the total resistance is the sum of the resistors. c. Draw a schematic of the 5-second timer. d. Given that capacitors have a tolerance of + -10 per cent and resistors have a tolerance of + -5 per cent, what range of values could you expect for your timer? 6. A 100 pF capacitor is used to build clocks. Two clocks are to be built with periods of 1 and 5 seconds. a. Using values of resistors provided in your lab, pick two resistors that yield periods as close to those desired as possible. b. What is the time on and time off for each of the clocks during one period? c. Draw a schematic of the 5-second clock. Procedure 1. Write the prelab in your lab notebook for all the circuits required in the steps that follow. Include all necessary equations and calculations. 2. Obtain instructor approval for your prelab. 3. Build and test the 5-second timer from exercise 5. o How different is the measured value from the calculated value? o Demonstrate the timer for your instructor. 4. Repeat procedure 3 for the 10-second timer from exercise 5. 5. Build and test the 1 second clock from exercise 6. a. How different is the measured value from the calculated value? b. Demonstrate the clock for your instructor. 6. Repeat procedure 5 for the 5 second clock from exercise 6. 41  This book is licensed under a Creative Commons Attribution a.0 License Learning objectives - Review differences between logic circuits and persistent memory. - Review properties for the S-R latch and D flip-flop. - Construct a circuit using a flip-flop. Memory You have often heard the phrase: "In order to know where you are going, you need to know where you have been." While all the circuits discussed in previous chapters are very useful, many applications quite simply cannot be implemented without the use of memory to "remember where they have been". Modern computer systems employ a wide array of different memory storage methods that have different properties. Non-volatile memory used for secondary storage such as hard drives, CD-ROM drives, or solid state memory (i.e. an SD card) retains its value after power is shut off. Volatile, dynamic random access memory (RAM) loses its value when power is shut off and also must have its values continually refreshed with external circuitry. Static, volatile random access memory such as that found in cache memory and CPU registers cannot retain its value when power is not provided, yet it does not need to be refreshed. This chapter will focus upon the static, volatile, electronic memory listed last. All of the logic circuits built in the previous sections are known as combinatorial logic circuits. They depend only upon the state of their inputs at any given time and do not take into account anything that has happened in the past. Often it is necessary for the output of a circuit to take past values into account. Logical circuits that take past output values along with present inputs into account to compute the output values are known as sequential logic circuits. In order to determine the next state of an output, the previous state must be known. Memory is used to store the history of the state(s) of a digital circuit for use in sequential circuits. An example of a sequential logic circuit would be a counter. A computer is nothing more than an advanced sequential logic circuit with memory to store data, programs, and references to the state of programs currently being run. SR latch Two NOR gates can be configured using feedback to produce one bit of memory. The configuration given in Exhibit 7.1 is known as an SR latch. The 5, SET and R, RESET are the inputs and the Q output is provided along with its inverse. The S input is used to set or turn on the latch by setting the output Q high and inverse low. Similarly, the R input is used to reset or turn off the latch by resetting the output to low and the inverse to high. Once the latch is set, Q remains at a logic high while both input lines are off. Similarly, once the latch is reset, the Q output will be set to logic low and will remain that way while both input lines are off. In this way, the latch can store one bit of information indefinitely, or at least as long as it has power supplied to it. The NOR SR latch has active high inputs, meaning that if either input is brought high, it will force a corresponding output condition. Note that setting both input values high must be avoided in order to retain the output values as opposite to each other. Introduction to Digital Logic with Laboratory Exercises 42 A Global T ext  7. Memory Latches can also be built using NAND gates, but the set and reset lines operate in a slightly different manner under this configuration. The transitions for these latches are examined in more detail in the exercises. S R Q o o Q (does not change) o 1 0 1 0 1 1 1 state not used Table i: NOR SR latch The NAND based SR latch is an active low device wit S and R input values are brought low to change the sta input values turned high simultaneously, the S and R fo same time. S RQ o o state not used o 1 1 1 0 0 1 1 Q (does not change) Table 20: NAND SR latch Flip-flops A flip-flop is a latch that has been modified to workN timing for different components in a circuit. The outputo given state, such as high. Exhibit 7.3 is a D flip-flop tha Some flip-flops are designed to examine the inputs when the edge of the clock makes a transition from low to high, called rising or positive edge triggered flip-flops. Similarly, negative edge triggered flip-flops can be designed that only examine inputs when the clock makes a high to low transition. The time in which the inputs can affect a change on the output is reduced with a rising or falling edge triggered device. The speed with which a flip-flop can be clocked is determined by the maximum delay from the gates that are used to construct the device. For this reason, RIQ S Exhibit 7.1: SR latch h a default state of logic high for both S and R inputs. The ite. Just as the NOR based SR latch should not have both r a NAND based SR latch should not be brought low at the S Q R Exhibit 7.2: SR latch with the use of a clock. Clocks are used to synchronize the of the flip-flop will only change when the clock signal is in a t will only change when the clock, C in the figure, is high. D Q Exhibit 7.3: D flip-flop the input to the gate should be stable prior to the clock 43  This book is licensed under a Creative Commons Attribution ,.o License transition and the time before the next clock pulse should last long enough for the output state to stabilize. Manufacture specifications for the device being used should be consulted to determine the maximum clock speed. Since these labs only use clocks with periods no faster than i second, the circuits designed never approach the limits of the maximum clock speed. Exhibit 7.4 uses two D flip-flops. The output of the first is used as the input of the second creating a master-slave arrangement. This results in a positive edge triggered flip-flop. D Exhibit 7.4: Positive edge triggered D flip-flop Circuitry can be added to produce JK, T, or D flip-flops. The JK flip-flop, like the SR latch has two inputs, however all four states are valid for the JK flip-flop. The T is known as a toggle flip-flop because if the input is high, the state of the output toggles. This means that when clocked with an input of one and a current state of high, the output goes low and if it was low, it goes high. The D flip-flop output follows the value of the input while enabled or when clocked, otherwise it remains in the memory state. Both the T and D have only one data input. The tables below list the input of the flip-flop along with the present state, Q, and then the next state, QN. The circuit for a rising edge triggered D flip-flop is provided below. JK flip-flops are very common in many designs. For the sake of simplicity, only the D flip-flop will be used for the designs in this text. J K Q QN o o o o-unchanged o o 1 1-unchanged o 1 o o - reset o 1 1 0- reset 1 0 0 i-set S 1 1 i-set 11 o 1 - toggle S1 1 o - toggle Table 21: JK flip-flop T Q QN o o o -unchanged o 1 1 - unchanged 1 o 1 -toggle S1 o - toggle Table 22: T flip-flop D Q QN 0 0 o -off 0 1 o - off o 1- on 1 1- on Table 23: D flip-flop Exhibit 7.5 shows the symbolic representation of the D flip-flop used for circuit diagrams. The rectangle shown is commonly used for latches and flip-flops. Also note the bubble in front of the CLEAR line to indicate that the Introduction to Digital Logic with Laboratory Exercises 44 A Global Text I- - IV 11-1 --V I- - ".. -,-. v -11- -1 -r-r  7. Memory device can be set to low or "cleared" when this line is set low; for normal operation the CLEAR should be left high. Some devices also come with a PRESET line that can be used to set or turn on the output in much the same manner. These lines can be used to load the flip- flops with specific values, especially when the unit is first powered on. The clock line has a small triangle that denotes that the device is triggered with a rising edge. Falling edge-triggered devices will have a small bubble preceding the triangle. For these labs, the 74175, which provides four rising edge triggered D flip-flops on a single chip, is recommended. Schematics of the 74175 can be found in Appendix A. o CLOCK CLEAR Exhibit 7-5: D flip-flop symbol Review exercises 1. Use the SR latch from Exhibit 7.1. Assuming the values in the table represent values that have just occurred, determine the stable values for the outputs QN and QN'. Recall that the NOR gate is an active high gate, meaning any time either of the input values is high the output is low. The first, fourth, and sixth rows of the table are done for you. The truth table for the NOR is provided. As an example, output for the first row is traced. - S is o and Q' is 1, therefore QN stays o. - R is o and QN is o, therefore QN stays 1. - Stable because Q and Q' retain values. For the fourth row, the outputs toggle. - R is 1, so QN'must be o. A B NOR O 0 1 O 1 0 1 0 0 1 1 0 S R Q Q' QN QN 0 00 1 0 1 0 10 ? ? 0 11 ? ? 1 1 70 0 1 101 0 1 0 1 11 ? ? 1 1 0 ? ? - S iso and QN is ,SOQN' iS 1. - Stable. R is 1, Q is o and not affected by Q'. With S and Q o, Q' stays 1. Tracing the sixth row yields the following. - S is 1, so QN' must be o. - R is o and QN'iS O, So QN is1. - Stable as S is 1, QN' stays o. With R and QN' 0, QN stays 1. To start tracing, recall that if any of the input values to a NOR are 1, the output must be o. 2. Repeat exercise 1 with the latch from Exhibit 7.2 by determining the stable states of all 8 rows of the truth table from the previous problem. While values for QN and QN' are provided in rows 1, 4 and 6 for the last problem, you must work all 8 rows for this problem. Remember that the NAND gate has an output of 1 if either of the input values of the gate is o. 3. Using the D flip-flop below, determine the stable output of each of the NAND gates labeled i through 4 when the values for D, C, and Q first occur. The following trace for the first row serves as an example. 45  This book is licensed under a Creative Commons Attribution ,.o License - Remember the NAND is an active low device, meaning the output will be 1 if either input is o (low). - D and C are o, so NANDi and NAND2 will be 1. - NAND3 is o and NAND2 is 1, making NAND4 1. - NANDi is 1 and NAND4 is 1, so NAND3 will stay o. - Stable as neither NAND3 or NAND4 change state. D CQQ'{ o oo 1 o o 1 0 O 10 1 o i 1 0 1 00 1 1 0 1 0 1 1 0 1 1 1 1 0 1T 2[ 3/QN 4/QNf 1 1 0 1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? D C- 4. Use the data given for the 74175 in Appendix A to determine the value of the output Q after a rising clock edge has been received by the clock pin. D CLEAR Q o o0? O 1 1 o ?___ Procedure 1. Write the prelab in your lab notebook for all the circuits required in the steps that follow. Include all necessary equations and calculations. 2. Obtain instructor approval for your prelab. 3. Construct an SR latch using NOR gates. Verify its operation and demonstrate the circuit for your instructor. 4. Construct one bit of memory using one D flip-flop from a 74175 chip. Verify its operation and demonstrate the circuit for your instructor. roduction to Digital Logic with Laboratory Exercises 46 A Global Text Int I- - IV 11-1 --V I- - ".. -,-. v -11- -1 -r  This book is licensed under a Creative Commons Attribution i.o License 8. State machines Learning objectives - Construct state transition diagrams. - Relate the number of memory bits required for a given state machine. - Build four state, state machines. What is a state machine? A state machine, often referred to as a finite state machine is a sequential logic circuit that has a finite number of defined states that can be represented. A state machine requires the use of memory to store the state of the machine. Combinatorial logic is used to combine the values of the present state along with inputs to the system to determine the next state of the system. An example of a simple state machine could be a counter that counts from from o to I to 2 to 3 and back to o. In this case, the state machine does not have any input at all, it uses the past state and increments the value every clock cycle. An example of a complex state machine would be a computer. In this case, the computer can have many different inputs and has many different states. Input data can come from the keyboard, network, mouse, memory, etc., while the state would normally be associated with the address in memory of the program being run. In this text, the state machines will be like the counter just described and certainly nothing as complex as a computer. State machines are used in more than just computers. Any process that can be defined with a given predictable algorithm can often be represented by an electronic state machine. For example, a coffee vending machine could be automated with a state machine. The states would be: waiting for correct change, select options such as cream or sugar, drop cup, dispense coffee, and dispense options. Inputs could include the cream button, sugar button, correct change indicator, and a timer to determine how long to fill the cup with coffee. State transition diagrams A state transition diagram is a graphical representation of the state machine. Exhibit 8.1 shows the state transition diagram for a counter that starts at o and goes up through 3 and then back again to o. This machine 0 has no input, transitioning from one state to the next at every clock pulse. Each state is marked with a circle that contains the value of the state. The arrows represent the transitions from one state to the next. The state machine shown in Exhibit 8.2.a is also a four state counter, but it uses one input. The input, labeled x, determines whether the counter continues to 3 2 increment the count. When x equals o, the counter counts and when x equals 1, it remains in the current state. The convention followed here is as follows: state values are listed inside of each state bubble and input values Exhibit 8.1: Four state counter that determine the transition are listed next to each arrow. If the state Introduction to Digital Logic with Laboratory Exercises 47 A Global T ext  8. State machines will transition regardless of any input, then no input will be listed next to that arrow. A timing diagram for this four state counter is given in Exhibit 8.2.b. This assumes that the final circuit is clocked at 1.oo seconds and that rising edge triggered flip-flops are used. Note that the values of each bit, Di the most significant bit and Do the least significant bit, only change on the rising edge of the clock, while the input is free to change at any time. This diagram serves a slightly different purpose than the timing diagram shown in a previous chapter. While the previous diagram was used to determine maximum possible delays for a circuit, this one is used to illustrate the traversal of the machine through the various states. The timing diagram, like the state diagram can be helpful when attempting to verify the operation of a constructed circuit. x=1 x=1 x=1 x=1 Exhibit 8.2.a: Four state counter with input Sv Dl ov 5v DO ov I 5v x 0 v 5v Clock 0ov: Seconds Exhibit 8.2.b: Timing diagram for four state counter State machine design In order to design a state machine one would need to recognize the inputs of the system, the states, and how it transitions from one state to the next. This is graphically represented with a state transition diagram. Then, the transition diagram should be used to create a truth table that has the inputs to the system and current state values as inputs in that table. The output of the truth table is the next state of the system. Combinatorial logic is used to implement the functions required to obtain the next state values for the state machine. All of the Boolean logic minimization techniques used in earlier chapters are used at this stage. As memory is used to store the states, the output or next state that results from the truth table is used as the input to the flip-flop storing the state values. 48  This book is licensed under a Creative Commons Attribution ,.o License Finally, the flip-flops will need to be clocked. In these labs we want to observe the states, so the clock used has a slow period such as 2 seconds and a frequency of 1/2 hertz. Example 1: Four state counter The steps that follow outline the design of a four state counter with no input. The four state counter is relabeled in 0 Exhibit 8.3 to show the values taken for the required two bits (Q1,QO) (Q1,00) of memory labeled Qi and Qo. The values of Qi and Qo are given as well, which happen to follow the binary equivalent of the value of the counter. The table below shows how the present state, given by Qi and Qo, transition at the next clock signal to the next state, given by QiN and QoN. o 0 1NI oN (Q1,SQ0) (Q1,IQ0) O O O 1 (1,1) (1,0) o 1 1 0 1 0 1 1 1 1 0 0 Exhibit 8.3: Four state counter with states Table 24: Truth table The next step is to determine the functions that represent values of the next state, QiN and QoN. As these functions only have two variables, they are fairly easy to determine without the use of complex boolean algebra or K-maps. QON is just the inverse of Qo. QiN is the Exclusive OR of the two inputs. As the logic kit does not contain an Exclusive OR gate, the equivalent logic using AND and OR gates is given along with the equivalent logic using NAND gates only. The resulting circuit is shown in Exhibit 8.4. QoN(Q1,QO)= QO' Q1N(Q1,QO) Q1 @ QO =QiQo' +Qi'Qo = ((QiQo')'(Q1'Qo)')' Now, in order to create a fully functional circuit, memory needs to be included. In this case, two D flip-flops from a Q1 74175 chip will be used. Because the 74175 chip provides the output Q as well as its inverse, the design can be simplified by eliminating the inverters from the diagram in Exhibit 8.4. Exhibit 8.4: Counter Logic The full schematic of the circuit is shown in Exhibit 8.5 along with pinouts for each chip. A switch can be used to clock the circuit for test purposes. A clock, such as one designed with a 555 timer from the previous chapter, should be used in any final design. Introduction to Digital Logic with Laboratory Exercises 49 A Global T ext  8. State machines QO LED1 Q1 LED2 CLOCK: IC1,9, Switch1 IC1 - 7400 IC2 - 74175 Vcc - IC1:14, IC2:16,1 Grnd - IC1:1, IC2:1 Exhibit 8.5: Counter Circuit Example 2: Four state counter with input The four state counter given in Exhibit 8.2.a introduces a complexity by adding an external input. The state transition diagram is redrawn in Exhibit 8.6 with the states labeled in binary, Qi being the most significant bit. The truth table using the three items as input: x, Q1 and Q, , and the output given by the next state values QiN and QoN is given in Table 25. X=1 X=1 X=1 X=1 X Q I1 Q0 Q1N QON o o 0 0 1 o o 1 1 0 o 1 0 1 1 0 1 1 0 0 1 0 0 0 0 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 Table 25: Counter truth table in K-maps to determine the minimal SOP expressions. Exhibit 8.6: Four state counter with input The values of the outputs for QiN and QoN are then listed Equivalent expressions using only NAND gates are given. 50  This book is licensed under a Creative Commons Attribution i.o License Q1fQ0? Q01Q0 Q1Q0 00 01 11 10 0 | 1 0 |l 1 Q1N = X'Qi'QO + XQi + QIQO' = ((x'Qi'QoY (xQiY (QiQo')'Y' 0 SX 0 0 1 1 Table 26: QiN(X,Q1,QO) 00 01 11 1 10 1 0 0 1 QON = XQO + X'QO' = ((XQO)' (x'Qo')') 0 x 1 0 1 1 0 Table 27: QoN(X,Q1,QO) QO LED 1 Q1 LED2 CLOCK: IC2,9, Switch 2 IC1, IC3 - 7400 IC2 - 74175 IC4 - 7410 VCC - IC1, IC2, IC4:14, IC2:1,16 Grnd - IC1, IC2, IC3, IC4: 1 Exhibit 8.7: Circuit diagram for four state counter with input The logic is then implemented using the 7400 series chips, as shown in Exhibit 8.7. The output of the logic is used to feed the input of each D flip-flop and the output of each flip-flop is used as input for the logic. Note that the CLEAR line for the 74175 must be tied to Vcc. The CLEAR line can be used on power up to clear or set the flip-flop value to logic zero. However, if the line is kept low, the value of the flip-flop will always remain at logic low. The CLEAR can be left to float, however this makes the flip-flop susceptible to fluctuations in electrical noise. The use of Introduction to Digital Logic with Laboratory Exercises 51 A Global T ext  8. State machines the CLEAR line will be discussed in more detail in the next chapter. For now the CLEAR will just be tied to logic high. For testing purposes, a switch can be used for the clock. However, make sure to read the next section regarding debounced switches before using a switch for this purpose. Debounced switches One word of caution is in order when using switches as the clock source. As a switch is a mechanical device, they can suffer from bounce. Bounce occurs when the metal contacts strike each other and "bounce" before they come to rest. When this occurs, it can look like the switch changes state multiple times even though it has only gone from open to closed. Switches come in a variety of configurations. Two common versions are the single pole double throw, SPDT or the single pole single throw, SPST shown below. -h O- -- Exhibit 8.9: SPST switch Exhibit 8.8: SPDT switch Different approaches exist for "debouncing" switches. Software can be used to test the output of the switch and insure that only vcc one change is registered, instead of the multiple changes that can occur with bouncing. Two common hardware approaches are Logic High Output provided for both types of switch. The values for resistors and capacitors shown should be chosen so that the time is as long as the system bounce is expected to last. Values of 1ooK for the Logic Low resistors and o.1pF for the capacitor would provide a pulse of 1.1 msec, which should be sufficient to debounce the switch in Exhibit 8.11. Of course other circuits can be used to debounce switches and adjustments may need to be made to the values of the Exhibit 8.10: Debounced SPDT switch components to suit the application. The logic kit provided should have at least two debounced switches. EVcC R 2 T 3 Output R DIS -0 - CV THR- -GND V+ - Exhibit 8.11: Debounced SPST switch 52  This book is licensed under a Creative Commons Attribution ,3.0 License Review exercises 1. How could using a regular switch as the clock source affect the operation of the counter? 2. Draw a timing diagram for the machine that uses the state transition diagram found in Exhibit 8.3. Assume that the machine will use a clock with a period of 1.oo seconds, that the flip-flops used for the design are rising edge triggered and that the machine is in state 01 prior to time zero and that the machine goes through 4 clock pulses. 3. Draw the state diagram for a four state counter with one input where the counter counts up in binary when the input is low and counts in reverse when the input is high. 4. How many D flip-flops are required for the counter from problem 3? 5. Determine the logic required for the input of the four state counter from problem 3 and draw a circuit diagram with pinouts. 6. Draw the state diagram for a three-state state machine that counts from 00 -- 01 -- 10 - oo etc. as long as the input is low. When the input is high, the counter does not count and stays at its current state. 7. How many D flip-flops are necessary for the counter from the previous problem? Are all of the possible states for the flip-flops used? If not which ones are not? Procedure 1. Write the prelab in your lab notebook for all the circuits required in the steps that follow. Include all necessary equations and calculations. 2. Obtain instructor approval for your prelab. 3. Build and demonstrate the successful operation of the four state counter found in Exhibit 8.5. Attempt to clock the circuit with both a regular switch and debounced switch. Note the difference in performance. 4. Build and demonstrate the successful operation of the two state counter from Exercise 5 of the review exercises. Optional 1. Build and demonstrate the successful operation of the four state counter from Exercise 6 of the review exercises. Introduction to Digital Logic with Laboratory Exercises 53 A Global T ext  This book is licensed under a Creative Commons Attribution i.o License 9. More state machines Learning objectives - Relate number of states to required amount of memory. - Insure state machines do not enter illegal states. How many bits of memory does a state machine need? The amount of memory or number of flip-flops required for a state machine is directly related to the number of states in the state transition diagram. The number of possible states that can be represented increases by a power of two for each new bit of memory added. One bit of memory can represent 21 or two states, two bits can represent up to 22 or four different states, and three bits up to 23 or eight different states. To reduce the complexity of the design, use the fewest number of flip-flops that would still accomplish the task successfully. If the design required a number of states that is not a power of two, then the smallest number of bits raised to the power of two that is greater than the number of states required should be used. As an example, if three states were required, two bits would be needed, or if six states were required, three bits would be needed. Number of states < 2number of bits What are unused states? A machine that visits the following states in the order listed, ooo -> 001 -> 011 -> 111 -> 110 -> 100 -> ooo, will require three bits of memory. What becomes of the unused states, 010 and 101? Several approaches are common when dealing with the unused states. Note that any legal state moves to another legal state, never visiting the unused states. As the unused states are never visited, these could be considered as don't care conditions in the K- maps for the input to the flip-flops. This can reduce the complexity of the design. In addition, PRESET and CLEAR lines for flip-flops can be used to insure not only that the state machine enters a legal state when powering on, but it also insures that it powers up in a specific initial state. Using PRESET and CLEAR pins As the system powers up, logic levels cannot always be guaranteed. What if Vcc during this time, the system happened to enter one of the unused states? Depending upon the logic that was used, the system may then transition into one of the legal states, or it may get stuck indefinitely in one of the illegal states. In order to guarantee that the system does not enter an illegal state as the system powers up, the CLEAR lines can be held low temporarily to insure that the To Clear memory bits are set to zero or logic low on power up. Exhibit 9.1 has an RC circuit that can be used to power on to keep the CLEAR line low long enough to insure that the bits are set to zero. When power is first turned on, the capacitor will be uncharged and must charge through the resistor. If the time constant, RC, is set at Exhibit 9.1: RC for Power On several clock cycles, then the state machine will be guaranteed to start with all of Introduction to Digital Logic with Laboratory Exercises 54 A Global T ext  9. More state machines the memory bits at zero. The 74175 quad D flip-flop in the logic kit does not offer a PRESET pin. However the same type of RC circuit can be used for other flip-flops that do. Assigning unused states to the system Powering up is not the only time the machine can enter an unused state. At times large transient spikes can occur during storms or when powering on or off other equipment that can cause logic levels to change unpredictably. In cases such as this, the machine can still enter a state that was not planned. Even the RC circuit connected to CLEAR or PRESET pins cannot rescue the state machine in this case. To address this, the designer should add the additional states to the state transition diagram and simply have them transition to a legal state. In this way, even if for some reason a circuit enters an illegal state, it will quickly shift to one that is allowed. Adding the extra states as well as the RC circuit does indeed complicate the circuit, however for a final design that will be used in production, it provides assurance that the circuit will perform reliably even when the unexpected occurs. Example 1: Three state counter The three state counter in Exhibit 9.2 counts up when the input is high and counts down when the input is low. Two flip- flops will be needed to implement this machine which means that four states can be represented by those two bits. The state 11 is not used in this design. What would happen if for some reason, the machine would happen to enter the state ii? The effect of entering this unused or illegal state cannot be known until the circuit implementation is finalized. Instead of waiting to see what happens after the design is completed, it is best to incorporate this state early on in the design phase. Two approaches will be investigated. The first will shift the state 11 to the legal oo state on the next clock cycle. The next approach will be to place don't care conditions for the state 11 and then examine the next state that would follow depending upon the simplest design that results from using the don't care conditions. Approach 1: 11 - oo The resulting state transition diagram assuming that state 11 transitions to oo on the next clock cycle is given in Exhibit 9.3. In all of the cases that follow, unused states will be shown as dotted circles in the state transition diagram. Since state 11 will move to state oo regardless of the input value, it is not written on the diagram. From the K-maps given below, the next state values for Q1 and Q, are listed as QiN and QoN. It is left as an exercise for the reader to determine the circuitry required to implement this state machine. x=1 Exhibit 9.2: 3 state counter x=1- Exhibit 9.3: 3 state counter with unused state 55  This book is licensed under a Creative Commons Attribution i.o License Q1'Qo' Q1'Qo Q1Qo Q1Qo' 00 01 11 10 X 1 0 0 0 0 X 0 1 0 0 1 Q1'Qo' Q'Q Q1Qo Q1Qo' 00 01 11 10 X 0 0 0 1 0 X 1 0 0 0 1 Table 29: QoN(X,Q1,Qo) = XQ1'Q' + X'Q1Q' Table 28: QIN(X,QI,Qo) =QiN = X' Q1'Qo' + XQ1'QO Approach 2: Using don't care conditions The next approach instead places don't care conditions for the state 11 as seen in the K-maps below. By selecting the minimal expressions, the next states for Qi and Qo can be found. The resulting expressions can be found to be less complex than those from the first approach. Q'Qo' Q1'Qo Q1Q 1Qo' OO 01 11 10 Q1'Qo' Q'Q QQo QQo' 00 01 11 10 X', 0 X O d 0 0 1 d* o x o 0 0 x 1 0 Table 31: QoN(XQ1,QO) d** 1 d 0 Table 30: Q1N(X,Q1,Qo) = XQ1Q' + X'QO = XQ11Qo' + XIQ1 The resulting state transition diagram is given in Exhibit 9.4.a. Using the don't care conditions does simplify the logic. Notice that 00 the unused state now goes to two different states depending upon the value of the input. The don't care condition labeled as d*, which is xQ1Qo is grouped with the term xQ1'Qo. This results in a X= 1 X= 1 simpler grouping, xQo, but it does now cause the machine to X=0 transition from 11 to 10 when the input x is a logic high. Similarly, the term d** now causes the state 11 to transition to 01. The O x=0 remaining don't cares are not contained in a group, so the they will transition to o at the next state. It is left to the designer to carefully examine the requirements of the final circuit to determine if indeed these are don't care conditions. If so, then the X=1 x=0 transition diagram should be updated to reflect their use in the logic simplification. Exhibit 94a: 3 state counter with don't cares A sample timing diagram that starts on the unused state 11 and cycles through this new diagram in Exhibit 9.4.a is given in Exhibit 9.4.b. Notice that the first transition at time o is to the state 01. From there the counter counts in reverse as the input is low, transitioning at time i to state oo, at time 2 to state 10, and then back to state 01 at time 3. Somewhere between time 3 and 4 input x goes high, but the state does not change until the next rising clock edge at time 4. From that point on, with the input high, the counter counts up. This assumes that the circuit will use rising edge triggered flip-flops. Introduction to Digital Logic with Laboratory Exercises 56 A Global T ext  9. More state machines D1 5V DO o0v X 0 V Clock 0 V 0 1 2 3 4 5 6 7 Seconds Exhibit 9.4.b: Timing diagram for 3 state counter Example 2: Five state machine The five state machine shown in Exhibit 9.5 has two different loops. One of the loops transitions between ooo and 111 while the other goes from 001 to 010 to 100. This leaves three possible states that are unused. The truth table that follows uses don't care conditions for unused states 011, 101, and 110 given as di, d2, and d3 respectively. The resulting K-maps that follow can be used to determine the minimal expressions. If the unused states were to immediately go to next state ooo, then the minimal expressions can be shown as those listed below. It is left as an exercise to draw the new state transition diagram for this design. Exhibit 9.5: Five state counter 57  This book is licensed under a Creative Commons Attribution .0 License Q2N = XVQ2?Q +o +Q2?Q1Q xjX Q2] Q QOQ2N]Q1NTQON Q1N = XIQ2 1Qo' + XQ2Q1o Q 0 0 0 0 1 1 1 QON Q1Q0 0 0 0 1 0 0 0 o o 1 0 1 0 0 Now, if the don't care conditions are used in the design for the O O 1 1 di di di minimal expressions, the complexity of the results is reduced. 0 1 0 0 0 0 1 Q2N = X'2oQ Q + Q2?Q1 or x'Q2'Q0o + QiQO' 0 1 0 1 d2 d2 d2 Q1N = X'2?QQ1Qo' + XQ2Q O or x'Q2?Q1Qo' + XQ1'QO O 1 1 O d3 d3 d3 0 1 1 1 0 0 0 QON = Q1?Q o 1 0 0 0 0 0 1 The results for QiN Q2Nhave two equally minimal forms. The state 11 transition diagram that uses the first minimal form is given in the 1 0 1 0 1 0 0 1 0 1 1 di di di Exhibit 9.6. Notice that the unused state 011 goes to the legal state 1 1 0 0 0 0 1 100 if the input is logic high and another unused state, 110 when 1 1 0 1 d2 d2 d2 the input is a logic low. To trace where the external states will go, 1 1 1 0 d3 d3 d3 examine di which corresponds to unused state 011. For Q2N, di is 1 1 1 1 0 0 0 part of group Q2'Q1 so Q2N will be 1 regardless of the input at the next state. di is only grouped if x is 1 for QiN and not at all in QON. Table 32: Truth table for 5 state machine It is left to the designer of the machine to determine if these transitions are acceptable given the specifications for the product. Q1'Qo' Q1'Qo Q1Qo Q1Qo' Q1'Qo' Q1'Qo Q1Qo Q1Qo' 00 01 11 10 00 01 11 10 x'Q2' 1 0 di 1 x'Q2' 1 0 di 0 00 00 x'Q2 0 d2 0 d3 x'Q2 0 d2 0 d3 01 01 xQ2 0 d2 0 d3 XQ2 0 d2 0 d3 11 11 xQ2' 0 0 di 1 xQ2' 0 1 di 0 10 10 Table 33: Q2N Table 34: QiN 00 01 11 10 x 2' 1 0 di 0 x'Q2 1 d2 0 d3 xQ2 1 d2 0 d3 11 xQ2' 1 0 di 0 in Table 35: QON Introduction to Digital Logic with Laboratory Exercises 58 A Global T ext  9. More state machines It should be noted that all of the designs shown in this text have used only the D flip-flop. However, it can often be the case that another type can result in a simpler design. JK flip-flops can be used to produce ripple counters with minimal extra circuitry. The JK flip-flop does have two inputs, so the resulting logic minimization must be done for both the J and the K input, doubling the number of K-maps required. In order to reduce the required number of parts for the logic kit, only the D flip-flop was used. Designers should become familiar using all of the different types of flip-flops so that they can be assured that they have chosen the one that truly results in a minimal design. Exhibit 9.6: Five state counter with unused states Review exercises 1. A state machine requires 7 different states. How many flip-flops are required for this machine? (a) If a machine has no external inputs, what size is the K-map for one of the required inputs? (b) If the machine has one external output, how large is the K-map for one of the flip-flop inputs? (c) If the design were to use JK instead of D flip-flops, how many next state inputs must be determined? 2. Repeat Exercise i for a state machine with 14 states. 3. Draw six clock pulses of the timing diagram for the machine that uses the state transition diagram found in Exhibit 9.6. Assume that the clock for the machine has a period of 1.oo seconds, that the machine is in state 011 prior to time zero and that input x is kept at logic high the entire time. 4. A state machine traverses the states listed in this order ooo -> 001 -> 011 -> 111 -> 110 -> 100 -> 000. There is no external input. (a) Draw the state transition diagram for this machine. 59  This book is licensed under a Creative Commons Attribution ,3.0 License (b) What are the unused states? (c) Modify the diagram if the unused states transition to 000. (d) Assuming a state machine were to be built using D flip-flops, determine the value of the next state for each of the flip-flops. 5. The two bit sequence oo -> 01 -> 11 -> 10 -> oo is a Gray code. Gray codes only have one bit change for each transition. (a) Sketch the state transition diagram for the 3 bit Gray code: ooo -> 001 -> 011 -> 010 -> 110 -> 111 -> 101 -* 100 - 000 ... . (b) Assuming a state machine were to be built using D flip-flops, determine the value of the next state for each of the flip-flops. 6. A two bit counter is to be built that will count forward, 00 -> 01 -> 10 -> 11 -> 00, when a logical input is set high and counts in reverse order when it is low. (a) Draw the state transition diagram for this state machine. (b) Assuming a state machine were to be built using D flip-flops, determine the value of the next state for each of the flip-flops. 7. A two bit counter is to be built that will count forward, oo -> 01 -> 10 -> 11 -> oo, when a logical input is set high and as a Gray code when it is low (oo -> 01 -> 11 -> 10 -> oo). (a) Draw the state transition diagram for this state machine. (b) Assuming a state machine were to be built using D flip-flops, determine the value of the next state for each of the flip-flops. Procedure 1. Write the prelab in your lab notebook for all the circuits required in the steps that follow. Include all necessary equations and calculations. 2. Obtain instructor approval for your prelab. 3. Your instructor will pick one or more state machines from the various examples from the review exercises for you to build and demonstrate. Introduction to Digital Logic with Laboratory Exercises 60o A Global T ext  This book is licensed under a Creative Commons Attribution a.0 License Hopefully, this introduction has whetted your appetite for this fascinating subject. Modern technology simply would not be possible without the advances and applications of this subject in the world in which we live. All of the sequential circuits shown in Chapters 8 and 9 are synchronous, meaning they use a clock. However, sequential circuits designed without clocks, known as asynchronous circuits, can be designed. As the clock can often insert added delay for the faster components in the circuit, asynchronous circuits can usually be designed that will respond even faster than synchronous circuits. Timing issues become critical in this case, and the resulting timing analysis can become so complicated that asynchronous circuits are often not chosen over their synchronous counterparts. However, for circuits that require the fastest speed possible, often asynchronous circuits are considered. In addition, while the circuits designed in these labs all used discrete components, for circuits that are used in applications today, nearly all of the components are fabricated on a single chip. Either Programmable Logic Devices (PLDs) can be used to fit entire state machines on a single chip or custom chips can be fabricated for a specific task. Very large-scale integration (VLSI) techniques are used to design entire systems on a single chip; a CPU with cache memory and a graphics processing unit would be an example. Complexities that require additional analysis are when the size of the transistors is decreased, speeds of the circuits are increased, and the desired power consumption is lowered. Hardware description languages such as Verilog can even be used to synthesize and test circuit performance virtually in software before constructing a single device. Any one of these areas can provide a wealth of challenging problems to tackle. It is the hope of this author that the foundation gained from this text will prove useful as you use technology and design applications that require digital logic. Introduction to Digital Logic with Laboratory Exercises 61 A Global T ext  This book is licensed under a Creative Commons Attribution ,i.o License Appendix A:.Cip pinout Vcc 84 A4 Y4 83 A3 y3 7400 [ Inputs j Output L HH H L H HH L Exhibit A.i1: 7400 7402 Inputs Output A 8 L L H H 3Lt__ Exhibit A.2: 7402 7404 Inputs Output L H H L 14 1 3 Fl-1 F-11 10 F91 F81 1 1 F2 31 4 1 51 6 71 Al 81 Y1 A2 B2 Y2 GND Vcc Y4 84 A4 Y3 63 A3 14 21 12 1 14 1 015 9 817 Yi Al Bi Y2 A2 B2 GND Vcc A6 Y6 AS YS A4 Y4 14 13 1F2 1F-110l F9-1 F81 111 121 3 4 1 5 7 . Al Y1 A2 Y2 A3 Y3 GND Exhibit A-3: 7404 Introduction to Digital Logic with Laboratory Exercises 6 lblTx 62 A Global Text  Appendix A: Chip pinouts 7410 Vcc cl F-41 F1131 Y1 C3 83 A3 Y3 Fl212 --1i Fl-101 F-95 F-8] Inputs 0Output A B C y x x L H X L x H L X X H H H H L 121 1 41 1 51 16 1 11 Al 81 A2 82 C2 Y2 GND Exhibit A.4: 7410 1 -D3 2- D2 3- Dl 4 -DO Vc c - 161 D4- 15= D5S-141 D6 -13r D7 -12 -I 5 - Output 6 - !Output "7 - Strobe Select A-li1 Select B - 10 Select C - 9 8l- GND Select A - 11 Exhibit A-5: 74151 63  This book is licensed under a Creative Commons Attribution ,i.o License 74175 Vcc Q4 D4 13 D3 Q3 Q3 CLOCK F91 (4) (2) Dl D2 D3 Qi CLEAR Q1 Q1 D1 D2 Q2 Q2 GND ____ Inputs Outputs Clear Clock D 0 "a L x x L H H H H L H L L H H L x Qo Qo Q2 Q2 Q3 Q3 D4 Q4 Q4 CLOCK, CLEAR Exhibit A.6: 74175 Introduction to Digital Logic with Laboratory Exercises 6 lblTx 64 A Global Text  Appendix A: Chip pinouts 555 Timer Cofitml Voktage TR-Trigger Output-Q 4 R-Reset Discharge-DIS CV-ontolThreshold Voltage TR 7- GND Vcc- oUtrpuT A-7: 555 timer 65  This book is licensed under a Creative Commons Attribution i.o License Appendix B: Resistors and capacitors Resistors Resistors are electronic components that obey Ohm's law: Voltage across a resistor is equal to the current through the resistor times the resistance of the device. V=I*R Resistance is measured in ohms (Q). Current and voltage are related by the resistance of the object, if voltage is kept constant and resistance rises, current will fall. Likewise if resistance decreases, more current will flow, meaning the measure of the current will rise. While many devices have resistance, including the wire used in these labs, the only resistance that we will be concerned with in this manual is the resistance attributed to actual resistors. Manufactured resistors come in various forms, however those used here will be standard 1/4 watt resistors that follow the conventional color code that describes their value. COLOR VALUE MNEMONIC A B C Tolerance Exhibit B.i: Sample Resistor Each resistor has four colored stripes as shown in the figure above. Each stripe corresponds to a number as shown in Table 36. The formula for the value of each resistor is listed below. Generic Formula: A B x 10c Which for this case yields: 2 0 x 103 or 20,000 f2. Yellow 4 Your Gray 8 Goes White 9 West Table 36: Color Codes The first two stripes indicate the numerical value of the resistance, the third the exponent of ten which will be multiplied by the numbers from the first two stripes, and the fourth a tolerance of the resistor. The diagram above illustrates how the first three stripes are used to calculate the value of the resistor as well as the diagram below. The mnemonic is often suggested as a means of remembering the color code. The tolerances will not be utilized in this Introduction to Digital Logic with Laboratory Exercises 66 A Global T ext  Appendix B: Resistors and capacitors lab manual. Another example is provided in Exhibit B.2. Applying the formula to obtain the value for this resistor is left as an exercise for the reader. 10 4 Exhibit B.2: 100,000 Ohm Resistor Capacitors In direct current circuits, capacitors can be thought of as charge storage devices. Electrolytic capacitors will be used in these labs. Electrolytic capacitors appear to 1, , L. I ,. look like a tiny aluminum can with two wires. Beo- 35V 35 V 3! cautious when connecting the electrolytic capacitors as they have a polarity. Insure that the negative terminal of the capacitor is connected properly or the capacitor can malfunction and in some cases explode! The unit of measurement for capacitors is the Farad. Capacitors with higher Farad measurements can store more charge at a given voltage. Exhibit B.3: Capacitors 67  This book is licensed under a Creative Commons Attribution a.0 License AppendixC:eLab Inote"booWfk The lab notebook should be a bound notebook, much like a standard composition notebook. The lab notebook is used to document the experiment or lab procedure. Notebooks can serve many purposes: for the author to review the material, for someone else to replicate the procedure, or even as a legal document for use in patent or court proceedings. The notebook for these experiments will be informal, in that the student will hand write all of the content in the notebook. Do not misinterpret the meaning of informal, because the work should still be neat, legible, well organized, and complete. What follows are some guidelines that should be used to document the labs from this text. Of course your instructor may add or delete from this list. The lab notebook should: - be bound - have two to three pages at the front dedicated to a table of contents - have numbered pages to use in the table of contents (you may number them yourself) Each lab should contain: - name of lab - your name - partner(s) name(s) - date - brief objective of lab (no more than two sentences) - equipment list required - pre-lab including: - any necessary diagrams - any necessary equations and calculations - approval of instructor before you begin the lab exercise - results and observations - conclusion Make sure that you: - Do not erase any items. Cross them out and redo the work. - Write only on the right side of each page. This leaves you room to include any corrections. Introduction to Digital Logic with Laboratory Exercises 68 A Global T ext  Appendix C: Lab notebook While following these guidelines certainly makes it easier for your instructor to review your work, that is not its main purpose. Keep in mind, someone should be able to understand what you did and even replicate your work given your lab notebook. Your lab notebook can be a helpful document for you. In industry, it can also be a helpful document for others. 69  This book is licensed under a Creative Commons Attribution .0 License A ppendix D:, Boolean..... algeIbra Commutative law: x+y=y+x xy = yx Associative law: x + (y + z) = (x + y) + z x(yz) = (xy)z Distributive law: x(y + z) = xy + xz x + (yz) = (x + y)(x + z) Absorption: x + (xy) = x x(x + y) = x De Morgan's law: (x + y)' = x'y' (xy)' = x' + y' Other laws and properties: (''= x X+1=1 (x)o = o x+o=x (X)1 = X x + x =1 (x)x' = o (x)x = x X+X=X Introduction to Digital Logic with Laboratory Exercises 70 A Global T ext  This book is licensed under a Creative Commons Attribution 0 icense Appendilx E:0 Quantity Item 1 Digital Trainer 2 pn2222 transistors 2 1K 1/4 watt resistors 2 33KEI 1/4 watt resistors 2 4.7K 1/4 watt resistors 2 1ooK 1/4 watt resistors 4 7400 4 7402 2 7404 3 7410 3 74151 2 74175 2 555 timer 1 100 pFarad capacitor 1 0.01 pFarad capacitor Description See detailed description below. Other general purpose npn transistors may be substituted. Quad 2 input NAND, see note regarding 7400 series chips Quad 2 input NOR 6 inverters 3, 3 input NAND 8 input multiplexer Quad D flip-flop with CLEAR Digital trainer A digital trainer is a single purpose unit that contains several features that facilitate the construction and testing of digital circuits. Digital trainers can be constructed, but can be found as a unit for a reasonable price. A digital trainer should include: * A breadboard * A 5V power supply which regulates within ±0.25V of 5V * 8 LEDs that are wired to turn on with logic 1 and off with logic o * 6 SPDT switches that are wired to logic high (5V) or logic low (oV) - 2 SPDT debounced switches (consult Exhibit 8.10 if constructing a digital trainer) Introduction to Digital Logic with Laboratory Exercises 71 A Global T ext  Appendix E Euipment tst Several of the 7400 series families are acceptable for use with these labs. The LS (Low Powered Schottky), ALS (Advanced Low Powered Schottky) or HC (High speed CMOS) are all widely available, relatively inexpensive and will all perform acceptably. 72  This book is licensed under a Creative Commons Attribution i.o License Appendix F : " Solutions Chapter 1 review exercises 1. Exhibit 1.3 contains the diagram illustrating the commonly connected pins on the breadboard. 2. X X! 0 1 1 0 3. Resistor color codes are explained in detail in Appendix B. (a) (b) (2 3) x 100 = 2300 Ohms (1 0) x 1000 = 10,000 Ohms 11 (c) (3 3) x 1000 = 33000 Ohms Introduction to Digital Logic with Laboratory Exercises 73 A Global T ext  Appendix F: Solutions (d) (1 0) x 100,000 = 1,000,000 = 1MOhm 4. The ground symbol is given below. 5. The NAND is the opposite of the AND gate. The function has two different variables, each with two distinct answers (T-i or F-o), so there should be four (22) different possibilities for the function. A B (AB)' o o 1 0 1 1 1 0 1 1 1 0 6. A B (A+B)' o o 1 0 1 0 1 0 0 1 1 0 74  This book is licensed under a Creative Commons Attribution ,3.0 License Chapter 2 review exercises 1. A logic function with three inputs has eight rows because each of the three inputs has two possibilities. (number of possible outcomes for each input)(number of inputs)= 23 2. A function with five inputs will have 25 or 32 different rows. 3. Truth tables follow. It is often easier to obtain the final result if some of the intermediate values that might be necessary are obtained first. For example, in 3.a. the third column is AB, the fourth (AB)' and the fifth is B'. These are then used to obtain the final result. (a) y(A,B) = (AB)' + B' (b) y(A,B,C) = (A+B)'C A IB AB (AB)' B' y 00 0 1 1 1 0 1 0 1 0 1 1 0 0 1 1 1 1 1 1 0 A B C A+B (A+B)' y 0 0 0 0 1 0 0 0 1 0 1 1 0 1 0 1 0 0 1 00 1 O 0 1 10 1 O 0 1~ ~ 10 (c) y(A,B,C) = (AC)' + (BC) A B C (AC)' BC y 0 00 1 0 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 00 1 0 1 1 0 1 0 0 0 1 1 0 1 0 1 1 1 1 0 1 1 It may not always be necessary to write every intermediate step. In this case, (AC)' is written directly instead of first writing (AC) and then the inverse. If you find this confusing, make sure not to skip steps like this. Note that many different functions can yield the same result. For example, (AB'C)' is equivalent to the function above. Introduction to Digital Logic with Laboratory Exercises 75 A Global T ext  Appendix F: Solutions (d) y(A,B,C) = (A9B)C' A B C A@B C' y 0 00 0 1 0 0 0 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 1 00 1 1 1 1 0 1 1 0 0 1 10 0 1 0 1 1 1 0 0 0 (e) y(A,B) = A'+ B ABA' y 0 0 1 1 0 1 1 1 10 0 0 1 1 0 1 (f) y(A,B,C) = ((A+B)'(B+C)')' A B ]C A+BJB+C (A+B)' (B+C)' (A+B)'(B+C)' y 0 0 0 0 1 1 1 0 0 01 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 01 1 1 1 0 0 0 1 100 1 0 0 1 0 1 1 01 1 1 0 0 0 1 1 10 1 1 0 0 0 1 1 1 1 1 1 0 0 0 1 Another example of a logic function with a different equivalent, (A + B + C). 76  This book is licensed under a Creative Commons Attribution ,.o License 4. Solution with pinout below. 2' Ar- 1 SW1 3L -' B SW2 Vcc - 14 Gnd - 7 0ut 10 6 IC1 - 7402 5. Solution with pinout below. It is optional to label Vcc and Gnd on the diagram. Most often for a chip, the Vcc is the upper most right pin and the Gnd is the bottom left, however the chip pinout should always be consulted. 1 B OUT -3 IC2 - 7402 IC2 - 7400 4 Introduction to Digital Logic with Laboratory Exercises 77 A Global T ext  Appendix F: Solutions Chapter 3 1. review exercises ((AB)'+(CD)') (AB)" (CD)" (AB)(CD) ABCD Original Circuit De Morgan's law Double negatives cancel Parenthesis not necessary IC1 - 7400 IC2 - 7402 2. Singletons have only one element. Doubles are 2x1 rectangles. Groups of four take two forms, a 4x1 rectangle or a 2x2 square. Finally groups of eight take the form of 4X2 rectangles. Rectangles and squares can be split across borders; further illustrations of this can be found in the next chapter. groupings are shown below. Example A'B' A'B AB AB' 00 01 11 10 C'D' o o o o 00 C'D o o 0 1 01 CD 0 1 0 0 11 CD' 1 0 0 0 10 Three single groups A'B' A'B AB AB' 00 01 11 10 C'D' 1 0 0 1 00 C'D 1 0 0 1 01 CD 0 0 0 0 11 CD' 0 0 0 0 10 Group spanning boundary A'B' A'B AB AB' 00 01 11 10 C'D' 0 0 0 0 00 C'D 0 0 1 1 01 CD 1 0 0 0 11 CD' 1 0 0 0 10 Two 2xi double groupings AfBf 00 A'B AB AB' 01 11 10 1 1 1 C'D' 00 C'D 01 CD 11 CD' 10 1 0 1 1 1 0 o0 1 0 0o 0 Two groupings of four A'B' A'B AB AB' 00 01 11 10 C'D' 1 0 0 1 00 C'D o o o o 01 CD o o o o 11 CD' 1 0 0 1 10 Four corner group A'B' A'B AB AB' 00 01 11 10 C'D' 1 1 1 1 00 C'D 1 1 1 1 01 CD o 0 0 0 11 CD' 0 0 0 0 10 Group of eight 78  This book is licensed under a Creative Commons Attribution L.0 icense 3. Truth tables follow. (a) f(A,B,C) = AB + A'BC' + AB'C A B C AB A'BC'[AB'C f 0 00 0 0 0 0 0 01 0 0 0 0 0 1 0 0 1 0 1 0 1 1 0 0 0 0 1 00 0 0 0 0 101 0 0 1 1 1 1 0 1 0 0 1 1 1 1 1 0 0 1 (b) g(A,B,C) = A'C + ABC + AB' A1B C A'CIABC[AB' g 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 0 0 0 1 1 1 0 0 1 1 00 0 0 1 1 101 0 0 1 1 1 1 0 0 0 0 111 0 1 0 1 c) h(A,B,C,D) = A'BC' + (A @ B)C + A'B'C'D + ABCD A B C D 0 0 0 0 0 0 1 0 0 1 O0 0 0 1 1 0 1 0 O0 0 1 0 1 0 1 1 O0 0 1 1 1 1 0 0 O0 1 0 0 1 1 0 1 O0 1 0 1 1 1 1 0 O0 1 1 0 1 1 1 1 O0 1 1 1 1 A'BC' (A@B) |I(A@B)C |IA'B'C'D |IABCD h o o 0 0 0 0 o o 0 1 0 1 o o 0 0 0 0 o o 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 o 1 1 0 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 1 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 i i , i Introduction to Digital Logic with Laboratory Exercises 79 A Global T ext  Appendix F: Solutions d) j(A,B,C,D) = A'C'D' + C'D + CD A B C D A'C'D' C'D CD j o o 0 0 1 0 0 1 o o 0 1 0 1 0 1 o o 1 0 0 0 0 0 o o 1 1 0 0 1 1 0 1 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 1 0 0 0 0 0 o 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 1 1 4. Minimal expressions given for each map. Notice that quite often, the terms in the original are not found at all in the minimal SOP (Sum Of Products) expression. (a) Original expression: f(A,B,C) AB + A'BC' + AB'C Minimal expression: f(A,B,C) BC' + AC A'B A' AB AB' 00 0 1 i s so 0 1 0 C 0 (b) Original Expression: g(A,B,C) = A'C + ABC + AB' Minimal Expression: g(A,B,C) = AB' + C A'B' A'B AB AB' 00 01 C1 10 0 i 8o  This book is licensed under a Creative Commons Attribution ,.o License (c) Original Expression: h(A,B,C,D) = A'BC' + (A ( B)C + A'B'C'D + ABCD Minimal Expression: h(A,B,C,D) = AB + A'C'D + BCD + AB'C Minimal Expression: h(A,B,C,D) = AB + A'C'D + ACD + AB'C More than one minimal expression exists. In these cases, more than one correct answer exists. A'B' AB AB AB' 00 01 11 10 C'D' 0 0 00 l CD1 1 0 0 01 L CD 0 0 11 0 1 I' n mlD0' 0 1 10 F AW A'B AB AB' 00 01 Ii 10 C'Dw 0 1 0 0 00 CD1 10 0 01 I) 0 1 1 1 e'0 1 0 1 10 1 i (d) Original Expression: j(A,B,C,D) = A'C'D' + C'D + CD AB' AB AB AB 00 O01 11 10 CD'1 00F CD 1 1 1 01 1 C) 1 1 1 1 CD' Minimal Expression: j(A,B,C,D) = D + A'C' 5. g(A,B,C) = AB'+ C This circuit was designed using only NAND gates. This allows the circuit to be implemented with just one chip. DeMogran's law was used to avoid needing a NOR gate. In addition, an inverter was avoided by using the remaining NAND gate left on the chip to invert input A. B 3 5 2 A 13 SWO -A SWi -B SW2 - C 12 8 IC1 - 7400 Introduction to Digital Logic with Laboratory Exercises 81 A Global T ext  Appendix F: Solutions 6. h(A,B,C,D)= A'B + A'C'D + BCD + AB'C 7. As the logic kit does not contain a four input NAND gate, combinations of three and two input NANDs are used. The following justification shows that this is indeed a correct implementation. 8. (a) Minimal Expression: A' + B' [(A'B)' (A'C'D)']' '[(BCD)' (AB'C)']' ')' [ (A'B)' (A'C'D)']' " + [(BCD)' (AB'C)']' [ (A'B)' (A'C'D)']' + [(BCD)' (AB'C)']' [(A'B)" +(A'C'D)"] + [(BCD)" + (AB'C)"] A' A ' A'B + A'C'D + BCD + AB'C' (b) Minimal Expression: C' + A'B Direct implementation from circuit De Morgan's law Double negatives cancel De Morgan's law AW KBAMAB AB - I _ Double Negatives (c) Two different minimal expressions exist for this problem. Minimal Expression: C'D' ±A'C'+BC'+AC Minimal Expression: C'D'± A'C' +AB+ AC 82  This book is licensed under a Creative Commons Attribution ,i.o License A W ArB AB AB' 00 01 1 10 Cr1)' 1 1 1 00 -- 01 CD' 10 o 1I (d) Three different minimal expressions exist for this problem. Minimal Expression: Minimal Expression: A'C'D + A'BD + A'CD' ± AB'D KB' A% AB AB' 00 01 1 0 CD' 0 0 0 0 00 CD 1 1 0 1 01 D H 0111 10 Minimal Expression: A'C'D + NBC + A'CD' ± AB'D KB' A% AB AB' 00 01 In 10 CrD' 0 0 0 00 01F Im 0 1 0 L . Im' 1 1 0 0 10 I LJ B'C'D + A'BD + A'CD' ± AB'D AWB'AB AB AB' 00 01 11 10 00 11 _ 0, 1-1 1: CD0 0 1 1111 1 Me I1 1 0 0 10 :7 Introduction to Digital Logic with Laboratory Exercises 8 lblTx 83 A Global Text  Appendix F: Solutions Chapter 4 review exercises 1. (a) Minimal Expression: B' + AC' (b) Minimal Expression: A + C AB' AB AB AB' 00 01 Al 10 ' d o 1 1 0 C 1 o o d 1 (c) Notice that this solution has one of the groupings that spans the boundaries (B'C). Minimal Expression: AB'+ AD + B'C AB' AB AB AB' 00 01 31 10 C'D' 0 0 1 00 CD 0 0 1 1 01 11 1 0 1 1 CD' 1 0 0 1 10 11L (d) This expression includes the four corner grouping (B'D'). Minimal Expression: B'D' + A'B A' A'B AB AB' 00 01 n 10 CwD 1 1 0 1 00 -AFl CD 0 1 0 0 01 1 O CD 0 1 0 0 CD 1 1 0 1 84  This book is licensed under a Creative Commons Attribution ,.o License (e) Two different minimal expressions exist for this problem. Minimal Expression: B'C' +A'C'+BC Minimal Expression: B'C'+ A'B + BC AB' AB AB AB' 00 01 11 10 1 1 0 1 00 0 1 1 0 (f) Minimal Expression: C'D + A'D' AW A'B AB AB' 00 O0L 31 10 c ' 1 1 0 0 00 C1 1 1 1 01 CD 0 0 11 MW 1 1 0 0 10 2. (a) Minimal Expression: AB + A'C' AB' AB AB AB' 00 01 11 AD 1 1 0 1 0 n 0 1 1 0 I- AB' AB AB AB' 00 01 iI 1 c1: 1 10 c 01 0 0 C 1 (b) Notice that not all don't care conditions need to be covered. Minimal Expression: A I IT - Introduction to Digital Logic with Laboratory Exercises 85 A Global T ext  Appendix F: Solutions (c) Minimal Expression: BD + AD + A'BC (d) Minimal Expression: CD'+± AD' AKBl AB AB AB' 00 01 Il 10 00 CD H0 1a1 1 20 AW AE AB AB' 00 01. In Im 00 c'vD d d0 0IL CD 10 86  This book is licensed under a Creative Commons Attribution ,i.o License Chapter 5 review exercises 1. (a) fi(a,b,c) = AVb'+ ±a'bc' + a'bc + AbVc Minimal Expression: fi(a,b,c) =A bVbc A'A B AB AB 00 01 11 10 00 0L 1L0E0 1 a b c ft o o 0 0 o o 1 0 o i 0 0 o i 1 0 (b) f2(a,b,c)= a'b'c + a'bc + abc' ± ab'c Minimal Expression: f2(a,b,c)= a'c + b'c ±abc' Mw AKB AB AD 00 0m 11 10 0 0(110 10 (c) f3(a,b,c,d)= a'b'c'd' ± a'bcd + abcd + ab'c'd' ± ab'c'd Minimal Expression: f3(a,b,c,d)= b'c'd' ± ab'c' ± bcd a b c ft o 0 0 0 o 0 1 1 1 0 0 0 1 0 1 1 1 1 0 1 a b I-c7 d f3 o 0 0 0 1 o 0 0 1 0 o 0 1 0 0 o 0 1 1 0 o 0 0 0 o 1 0 1 0 o 1 1 0 0 o 1 1 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 0 1 1 0 1 0 1 1 1 0 0 KB! AM AB AB" 00 01 21 10 1 0 0 1 00.j CtD 0 0 0 1 01 Introduction to Digital Logic with Laboratory Exercises 8 lblTx 87 A Global Text  Appendix F: Solutions (d) f4(a,b,c,d)= a'b'c'd' + a'bc'd + abcd + a'b'cd' + a'b'cd + a'bcd' + ab'c'd Minimal Expression: f4(a,b,c,d) =a'b'c + a'cd' + AVb'+ ±abcd + a'bc'd + ab'c'd AB' AM AB AD 00 01 11 10 CD'I 1 1 0 0 0 ajbjcjd fMuxln 0 o 0 0 1 d 0 0 01 0 d 0 0 10 1 1 0 0 11 1 1 0 1 00 0 d 0 1 01 1 d 0 1 10 1 d 0 1 1 1 0 d 1 0 00 0 d 1 0 01 1 d 1 0 10 0 0 1 0 11 0 0 I110 0 0 0 I110 1 0 0 1 110 0 d 1111 1 d The truth table also shows the inputs required for the multiplexer which will be used later when implementing the function with a mux. 2. f2(a,b,c)= a'b'c + a'bc + abc' ± ab'c 4 p+5Vol ts 5V - 1 ,13, 14.16 71- D3 Vcc -16 ~2- D2 D4 - 15 1in1 3- Dl D5 - 14 D6 - 13 4-DO Out- led 1 5 -Output D7 - 12 6 - Output Select A- 11 7 -Strobe Select B- 10 8 -GND Select C- 9 -c - switch 3 b b-switch 2 a a-switch 1 Gnd - 24.7,8.12.15 IC - 74151 3. f4(a,b,c,d)= a'b'c'd' ± a'bc'd + abcd + a'b'cd' ± a'b'cd + a'bcd' + ab'c'd Examine truth table from previous problem to understand why input values are chosen. 88  This book is licensed under a Creative Commons Attribution i.o License 4. (a) gi(a,b,c,d) = a'b'c'd + abcd + a'bcd + a'bc'd + ab'c'd + a'b'cd + abc'd + ab'cd Minimal Expression: gi(a,b,c,d) = d When the K-map is filled out, it can be seen that the minimal solution is simply d. No logic is needed at all! Hopefully, you did not try to write the truth table and implement it with a multiplexer. This illustrates why even though a multiplexer can implement any circuit, the logic should be analyzed first. a'b' a'b 00 01 o0o ab 11 ab' 10 c'd' 00 c'd 01 cd 11 cd' 10 0 0 1 1 1 1 1 1 1 1 0 o o 0 Introduction to Digital Logic with Laboratory Exercises 89 A Global T ext  Appendix F: Solutions (b) g2(a,b,c,d) = a'bc'd + a'b'cd' + ab'cd For this problem, first the K-map shows that this is the minimal expression. Then the truth table is constructed to determine the input values for an 8-to-i mux implementation. c'd' 00 c'd 01 cd 11 cd' 10 a'b' a'b ab ab' 00 01 11 10 o o 0 0 o 1 o 0 o o 0 1 1 0 0 0 a b c d ga MuxInput o o 0 0 0 o o 0 1 0 0 o o 1 1d' o o 1 1 d o 1 o o o d o 1 0 1 1 d o 1 1 1 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 1 0 0 d 1 0 1 1 1 d 1 1 0 0 0 0 1 1 0 1 0 0 1 1 1 0 0 0 1 1 1 1 0 0 +5Volts 5V - IC1(1) IC2(14) (c) g3(a,b,c,d) = abc'd' + abc'd + abcd + abcd' + a'bc'd + a'bcd Minimal Expression: ab + bd The minimal expression is the column ab and the middle square bd. This can be implemented with a single 7400 chip with one NAND gate left over. 90  This book is licensed under a Creative Commons Attribution ,i.o License KB' AD AB AB" 00 01 ni 10 Ow 0 0 001 i I co 0 110 nI 0 1 1 0 ,aD1 0)10 1 0 swo swi SW2 -A 12 IC1 - 7400 (d) g4(a,b,c,d) =a'bc'd' + abc'd' + abcd' + ab'cd' + a'bc'd + abc'd + abcd + ab'cd Minimal Expression: bc' ± ac -All-' AB IA B AR' 00 @OI U 10 00 CD0 1 1 0 01 UD0 0 1 1 ID' 0 0 1 1 2010 1 1 B4 C A B c - swo - swi - SW2 12 IMi - 7400 Introduction to Digital Logic with Laboratory Exercises 9 lblTx 91 A Global Text  Appendix F: Solutions Chapter 6 1. (a) review exercises T = i/f T = 1/(6,ooo,ooo) =0.000000167 sec or 167 nsec (b) T = 1/(io,ooo,ooo) 0.0000001 sec or 100 nsec (c) f= 6000 cycles/min * imin/6osec = 100 Hz T =1/100 =0.01 sec or 10.0 msec 2. (a) f=i/T f= i/(.ooooi) = 100 Khz (b) f= 1/(o.oooooooooo5) = 20.0 GHz (c) f= i/(.ooi) = 1000 Hz 3. Notice that Pin 3 never changes, although the state for Pin 6 and Pin 10 (the output) are indeterminate until it can be verified that the logic has successfully traveled through the required logic gates. 5V Output oV 5V Pin 6 0 V 5 V P7n3 0OV 5V B 0V 5 V A Ov -5 0 5 10 15 Nanoseconds 20 25 30 35 4. The logic circuit from Exhibit 2.14 has eight logic gates. Many of these gates are in parallel, such as the first two inverters or the two NAND chips from IC1. The longest path for the logic to travel is what determines the maximum frequency that the clock can be traveled. So the longest delay is: (ionsec * 5) = 50 nsec f =/T =I/(o.ooooooo5)= 20.0 MHz 92  This book is licensed under a Creative Commons Attribution a.0 License 5. (a) Recall that the timer has a delay of: t - desired R desired R for lab t - actual t = 1.10(RC) 1.0 sec 9100 0 9400 0 1.0 sec Solving for R yields: R = t/(1.1oC) 5.0 sec 45000 0 42400 0 4.7 sec The required values for R are found in the 10. sec 91000 0 100000 0 11 sec table, along with those that are easiest to obtain using the resistors from the lab kit. (b) The first R is obtained by putting two of the 4.7 K resistors in series. The second is by putting two 4.7K resistors in series with a 33K resistor. (c) The schematic should look identical to Exhibit 6.1 with the appropriate values for R and C. (d) Lastly, for the values chosen, the span for the times is calculated below. 1 second timer: 1.10(0.95 * 9400)(0.9 * 100u) < actual <1.10(1.05 * 9400)(1.1 * 100u) .89 < actual value < 1.2 5 second timer: 1.10(0.95 * 42400)(0.9 * ioou) < actual <1.10(1.05 * 42400)(1.1 * ioou) 4.0 < actual value < 5.4 10 second timer: 1.10(0.95 * 100000)(0.9 * 100u) < actual <1.10(1.05 * 100000)(1.1 * 100u) 9.4 < actual value < 13 6. Recall that the period of the clock is given by: T = t1+ t2 = time on + time off = o.693(R1 + R2)C + o.693(R2)C = o.693(R1 + 2*R2)C (a) If R1 and R2 are both 4.7K resistors for the first clock and R1 is 4.7K and R2 is 33K for the second, the resulting times are: T(isec) = 0.693(4700 + 4700)0.0001 + .693(4700)0.0001 = 0.651 + 0.326 = .98 seconds T(5sec) = 0.693(33000 + 4700)0.0001 + .693(33000)0.0001 = 2.61 + 2.29 = 4.9 seconds Introduction to Digital Logic with Laboratory Exercises 93 A Global T ext  Appendix F: Solutions (b) Time on for the 1 second clock is o.65 seconds and off is 0.33, while time on for the 5 second clock is 2.6 seconds and off is 2.3 seconds. (c) The schematic will look exactly like Exhibit 6.3 with the appropriate R and C values inserted. 94  This book is licensed under a Creative Commons Attribution ,3.0 License Chapter 7 review exercises 1. Recall, if either of the input values are 1, the output of the gate is o. While sj R] Q{Q' QN QN' the output values of Q and Q' may change, the input values of S and R will not for this table. So, for any row that has S set to 1, the corresponding value 0 0 0 1 ? ? for QN' must be o and likewise if R is 1, QN must be o. Using this, some values 0 0 1 0 ? ? can immediately be determined with this information. 0 1 0 1 0 ? As the output values may change, the remaining next state values require 0 1 1 0 0 1 1 0 0 1 ? o more examination. _ 1 0 1 0 ? o 1 1 0 1 0 0 1 1 1 0 0 0 Row 1: Q' is 1, causing Q to be o leaving Q' 1. Row2: Q is 1, causing Q' to be o leaving Q 1. 1R1 TTQ S R]Q {Q' QN] QN' For rows 1 and 2, the state of Q and Q' does not change. o o 0 1 0 1 Row 3 & 4: QN and S are o, causing QN'tobe1. QN'atl1 meansQN is o. 0 0 1 0 1 0 For rows 3 and 4, the latch is reset. 0 1 0 1 0 1 Row 5 & 6: QN' and R are o, causing QN to be 1. QN at 1 means QN' iS 0. 0 1 1 O O 1 For rows 5 and 6, the latch is set. 1 0 1 0 1 0 Row 7 & 8: QN and QN' are not inverse values of each other, which explains why these states are not used for the latch.10 Final stable values are provided in the second truth table. 2. For the SR latch constructed with NAND gates, recall that the NAND gate S R Q Q' QN QN' will have an output of 1 if either of the input values is o. In this manner, some of the next state values may be determined immediately. 0 0 0 1 1 1 Now, the remaining undetermined rows are examined.0 0 10 1 1 0 1 0 1 1 ? 0 1 1 0 1 ? 1 0 0 1 ? 1 1 0 1 0 ? 1 1 1 0 1 ? ? 1 1 1 0 ? ? Introduction to Digital Loaic with Laboratory Exercises 95 A Global Text 1 V  Appendix F: Solutions Rows 1 & 2: Both QN and QN' are 1, not inverses of one another. These states are not used. Rows 3 & 4: QN is 1 and R is 1, so QN' will be o. These are the set states. Rows 5 & 6: QN' iS 1 and S is 1, SO QN will be o. These are the reset states. Row 7: S and Q' are 1, so QN will stay o. QN is o and R is 1, so QN' stays 1. Row 8: R and Q are 1, so QN' will stay o. QN' iso and S is 1, So QN stays 1. Rows 7 and 8 are t stable states where the output values do not change. Final values are provided in the second truth table. S R Q Q' QN QN o o 0 1 1 1 o 1 0 1 1 o i 0 1 1 0 o 1 1 0 1 0 1 0 0 1 0 1 1 0 1 0 0 1 1 1 0 1 ? ? 1 1 1 0 ? ? I 3. As the NAND gate is an active low gate, meaning if either input is o, the output will go high, some of the values of the table can be determined immediately (these are bolded). NANDi can be determined by D and C (italic). Where the values of NANDi and C are known, the value of NAND2 can be determined (highlighted in yellow). Where NANDi or NAND2 are known to be o, the corresponding gates NAND3 and NAND4 must be 1 (shown in light blue). Now treat NANDi as the S input and NAND2 as the R input to the NAND SR latch (NAND3 and NAND4) and use the work from the previous problem. Rows 1 & 5: Similar to row 7 from problem 2. Rows 2 & 6: Similar to row 8 from problem 2. The states for Rows 1, 2, 5 and 6 do not change. Row 3: Similar to row 5 from problem 2. Row4: Similar to row 6 from problem 2. D C Q Q' 0 00 1 001 0 1 0 1 0 1 1 0 1 0 0 1 1 01 0 1 1 0 1 I 1 1 0 1 2 3/QN 4/QN t? t? 1 0 1 1 0 ?1 o 1 1? o 1 1? D C Q Q' 1 2 3/QN 4/QN' 0 00 1 1 1 0 1 0 10 1 1 0 0 1 0 1 0 0 1 01 0 1 1 1 0 1 10 1 0 1 1 0 Rows 3 and 4 correspond to the reset state. [11110 0 [_1_ 1 0 Row 7: Similar to row 3 from problem 2. Row 8: Similar to row 4 from problem 2. Rows 7 and 8 correspond to the set state. Note than when C is low, the state of the flip-flop can never change. Also, due to the addition of NANDi and 96  This book is licensed under a Creative Commons Attribution 3.0 License NAND2, there is never a time when the inputs reach a state that should not be used, as with the SR latches that must avoid certain states. So when C is low, the state remains constant and when C is high, the state tracks the D input. The final values are given in the second truth table. 4. When the clear line is low, the value of Q will be low regardless of the D CLEAR Q state of D. When the value of Clear is high, the value of Q will be equal to the value of D at the time of the rising clock edge. 0 0 0 0 1 0 1 0 0 1 1 1 Introduction to Digital Logic with Laboratory Exercises 97 A Global T ext  Appendix F: Solutions Chapter 8 review exercises 1. Because switches suffer from bounce, the circuit could interpret the bounces as clock pulses as well. This would mean that the circuit might be clocked more than once for a given flip of the switch. 2. 5v QO ov -Q1 Jov I- -Clock 0 1 2 3 4 5 Seconds 3. x=o x=o x=o x=o 4. Two flip-flops are needed to represent all four possible states. 5. Q1 Qof Q Qo Q0 Q Q0 00 01 11 10 Q1 Qof QQ Qo Q Q Q0 00 01 11 10 X' 0 0 0 1 X' 1 0 O O 0 0 1 1 x 1 1 0 1 0 x 1 QlN(x,Ql,Qo) QoN(XQlQO) --QO 98  This book is licensed under a Creative Commons Attribution ,.o License The minimal expression for QiN is XQI'QO' + X'Qi'Qo + xQiQo + x'QiQo which is not very minimal. For this reason, the design that follows uses a multiplexer to implement the input for the second flip-flop. The first flip-flop requires a value that can be taken directly off of the flip-flop itself Qo'. Remember to be careful when using the mux, and insure that the Select C line is the most significant bit for the logical expression. 00 LED1 +5Volts I N 1 -D3 2-D2 32 D1 Iil D4 -15" D5 -14 D6 - 13 D7 - 12 VCC - ICI. 2,3,12,15,16 1C2' 1,16 Gnd - ICI. 1.4.7.8,13,14 1C2. B 44-DO Pin 5 IC 2 5- Output 6 - IOutput 7 -Strobe 8 - GND Pin 5 1cl LD LED2 Select A -11 Select B - 10 Select C - 9 00 ASWO 01 IC1 - 74151 IC2 - 74175 --.j I 6. x=O Introduction to Digital Logic with Laboratory Exercises 99 A Global T ext  Appendix F: Solutions 7. The state machine has 3 states so it requires 2 flip-flops. 2' < 3<= 22 The state 11 is not used. The next chapter will discuss the design of systems with unused states. 100  This book is licensed under a Creative Commons Attribution ,.o License Chapter 9 review exercises 1. (a) A state machine that has 7 states will require 3 flip-flops. 22 < 7 <= 23 (b) With no external inputs, only the existing states provide input to determine the next state, so the K- maps will be a 4X2 rectangle. (c) With one external input, there will be 4 total inputs, so the K-maps will be 4x4 squares. 2. (a) A state machine that has 14 states will require 4 flip-flops. 23 < 14 <= 24 (b) With no external inputs, only the existing states provide input to determine the next state, so the K- maps will be a 4x4 rectangle. (c) With one external input, there will be 5 total inputs. The K-maps will be 8x4 rectangles, which are often unwieldy. In this case, alternate minimization techniques should be explored. 3. 5V -X ov 5V Q0 ov 5V Q1 ov 0 1 2 3 4 5 6 7 Seconds 4. (a) Introduction to Digital Logic with Laboratory Exercises 101 A Global T ext  Appendix F: Solutions (b) Of the 8 possible states, 101 and 100 are not represented. (C) (d) Q I'Q0' QIVQ0 Q-Q0 Q.QOf 00 01 11 10 Q I'Q0' QIVQ0 Q-Q0 Q.QOf 00 01 11 10 Q 2 0 Q2 1 0 o 0 o 0 Q 2 0 Q2 1 o i 010 0 0 Q2N(Q21QtQO) - :::QIQO + Q2Qt QtN(Q21QtQO) - :::QIQO + Q21QO 00 01 11 10 0 1 1 1 0 1 0 0 0 Q oN(Q2,QtQO) =Q2fQlf + Q2fQO 5. (a) 102  This book is licensed under a Creative Commons Attribution ,i.o License (b) Q I'Q0' Q-'Q0 Q-Q0 Q-Q0' 00 01 11 10 o 0o 0 QI'Q0' Q-'Q0 Q-Q0 Q-Q0' 00 01 11 10 o 1 1 1 Q 2 0 Q 2 0 Q.2 Q2N(Q2,Q.,QO) = Q.QOV + Q2QO Q2 0 0 0 QtN(Q2,Q.,QO) = Q.Q0' + Q2 VQO QIVQ0' QIVQ0 Q-Q0 Q.Q0' 00 01 11 10 Q2' 0 Q2 1 1 0 0 0 0 1 1 QoN(Q2,Q.,QO) = Q~fQ~f + Q2Q. 6.(a) (b) Q I'Q0' QIVQ0 Q-Q0 Q.QOf 00 01 11 10 QIVQ0' QIVQ0 Q-Q0 Q.QOf 00 01 11 10 0 0 X, 0 0 0 o 0 0 0 1 0 1 X 1 QtN(x,Qt,QO) = x'Q01Q11+xQ11Q0+x'Q1Q. +x'Q1Q.' QoN(XQtQO)= O Introduction to Digital Logic with Laboratory Exercises 10AGlblTx 103 A Global Text  Appendix F: Solutions 7. (a) (b) QiQ ~Q0 Q-Q0 Q-QO' 00 01 11 10 Q I'Q0' QIVQ0 Q-Q0 Q.QOf 00 01 11 10 x' 0 0 0 x, 0 x 1 1 1 0 0 0 1 0 0 1 QtN(XQtQo) = X'Q0 + QL'QO + XQ.Q0 QoN(XQtQO) =X'Q1' + XQ0' 104  This book is licensed under a Creative Commons Attribution a,0 License 555 ...................................................................................................... 7, 37 P.52, 74 7400 series ........................................................................... 7, l3pp., 17p., 20, 33, 54, 74P. Boolean algebra ................................................................................................... 17, 19P. Breadboard .......................................................................................10opp., 16, 19, 24p., 74 Circuit diagram............................................................................. 12, 14, l6pp., 24pp., 46, 56 Clock ............................................................................. 7, 14, 37pp., 42p., 45pp., 55pp., 62 Combinatorial logic.................................................................................................. 44 De Morgan's law ......................................................................................................... 19 Debounced switch ........................................................................................... 55p., 74 DIP.................................................................................................................. 14, 25 Don't care .................................................................................................. 27, 29p., 57pp. Edge triggered............................................................................................45P ,50, 56 Flip-flop ........................................................................... 7, 44P. 50PP., 54, 56pp., 62p., 74 Frequency.................................................................................................37P 42,51 Inverter ........................................................................ 10, l2pp., 17, 20p., 24PP., 40, 52, 74 K-map ......................................................................... 20pp., 25PP., 32, 6,52p., 57pp., 62 Karnaugh map ...................................................................................................... 20, 27 Latch............................................................................................................. 7, 44pp. Multiplexer.................................................................................................... 32pp., 74 NAND ................................................................ 12p., 15, l7pp., 24PP., 32, 34, 45, 47, 52p., 74 NOR ................................................................................. 12p., 15, 18, 20, 25, 44p., 48, 74 Period...................................................................................... 38pp., 42p., 46, 51, A,62 R AM..................................................................................................................... 44 Resistor..................................................................... 7, 12, 14, 17, 37pp., 4lpp., 55, 57, 69p., 74 Sequential logic .................................................................................................. 44, 49 State machine................................................................................... 7, 49pp., 57P., 60, 62p. State transition diagram......................................................................49P. 53, 56pp., 6opp. Timer ........................................................................................ 7, 37pp., 42p., 49, 52, 74 Timing diagram ......................................................................................................... 39 Transistor ........................................................................................ 7, lOpp., 17, 37p., 74 Truth table ............................................................ 12p., l5pp., 2Opp., 24P., 33, 35p., 51, 53, 60 XOR ................................................................................................................. 17, 20 Introduction to Digital Logic with Laboratory Exercises 105 A Global Text