WEST VIRGINIA UNIVERSITY COLLEGE OF ENGINEERING AND MINERAL RESOURCES Lane Department of Computer Science and Electrical Engineering Fall 2001 Introduction to Logic Gates LAB 2 (Deadline: One Week) CpE 272: Digital Logic Lab http://www.csee.wvu.edu/classes/cpe72 Introduction to Logic Gates: There are many things in this world that most electrical and computer engineer can do without. Unfortunately logic gates are not one of them. Good working knowledge of logic gates is essential as they are used in almost all electrical circuits in some form or the other. This lab has the following objectives. Understand how to use the breadboard to patch up, test your logic design and debug it. Understand the operation of logic gates such as AND, OR, NOT, NAND, NOR, XOR. Understand how to implement a circuit based on a schematic diagram. Wiring Guidelines: Arrange the IC chips on the breadboard so that only short wire connections are needed. Try to keep the wire as short as possible to avoid a jungle of wires. Try to maintain a low wiring profile so that the pins of the chips can be reached and the chip replaced, if necessary. The best connections are those that lie flat on the board. Put the wiring in a numeric order and identify them with different color to make debugging convenient. Pay extra attention to power and ground. If you find your chips are getting super hot then there is probably a short circuit. Turn off power immediately and wire them correctly. Wiring a Logic Chip: The logic chips used in this class require a power source and ground. The power source (Vcc) is +5V and the ground is 0V, which can be drawn from the breadboard station. Normally, pin 14 of the IC chip is connected to +5V and pin 7 to ground. TODAYS TASKS Basic Logic Gates The AND GATE Insert a 7408 quad (4 in 1 package) 2-input AND gate IC chip into the logic lab breadboard. The 7408 contain four gates inside its package and the pin-numbering diagram is given above. Using the pin diagram, correctly hook up one gate and supply power and ground to the chip. Test 1: Experimentally verify that this AND gate is working properly by determining its truth table. You can do this by connecting the inputs to switches and the output to one of the LED’s on the breadboard. Test 2: Now take the output from the first AND gate you used and connect it to the input of the second AND gate within the chip. Connect a third input into this gate from another switch. Determine the new truth table for the output of this configuration. Also, schematically draw a representation of this circuit in your lab notebook. Show truth tables to the instructor and come up with a reason why test 2 was not a complete waste of time. Tell us what you have built by performing test 2. THE OR GATE Insert a 7432 quad (4 in 1 package) 2-input OR gate IC chip into the logic lab breadboard. Using the pin diagram shown above correctly hook up one gate and supply power and ground to the chip. Test 1: Experimentally verify that this OR gate is working properly by determining its truth table. You can do this by connecting the inputs to switches and the output to one of the LED’s on the breadboard. Test 2: Now take the output from the first OR gate you used and connect it to the input of the second OR gate within the chip. Connect a third input into this gate from another switch. Determine the new truth table for the output of this configuration. Also, schematically draw a representation of this circuit in your lab notebook. Show truth tables to the instructor and come up with a reason why test 2 was not a complete waste of time. Tell us what you have built by performing test 2. THE NOT GATE (Inverter) Insert a 7404 Hex Inverter (6 in 1 package) into the logic lab breadboard. The pin diagram for the 7404 is attached at the end of this lab handout. Choose the first inverter gate and hook its input and output in a similar fashion as the previous 2 chips. Test 1: Experimentally verify that this NOT gate is working properly by determining its truth table. Test 2: Connect the output of the first NOT gate to the input of the second NOT gate. Draw the schematic representation of the circuit and determine the truth table. Show truth tables to the instructor and come up with a reason why test 2 was not a complete waste of time. Tell us what you have built by performing test 2. THE NAND GATE The NAND gate is one of the universal building blocks of digital logic. It may be used to implement any logic function without the need for any other type of gate. Familiarize yourself with the NAND gate operation according to the following steps: Insert a 7400 quad 2-input NAND gate into the logic lab breadboard station. Connect this IC chip to the appropriate switches, LED and power. Verify the NAND gate truth table. Test 1: Verify the function of a single NAND gate and develop the truth table. Test 2: Wire both inputs together and apply only one signal to them. Check the logic at the output and record its truth table. Name the gate you’ve built in test 2. Test 3: Based on the above results, construct an AND gate using only NAND gates. Wire up the circuit and record its truth table. Show truth tables to the instructor and come up with a reason why test 2 was not a complete waste of time. Tell us what you have built by performing test 2 THE XOR (Exclusive OR Gate) The Exclusive-OR (XOR) gate provides an output, which is HIGH if and only if one input is HIGH; otherwise the output is always LOW. Test 1: Insert a 7486 quad 2-input XOR gate into the logic lab breadboard. Verify the truth table for test 1. Test 2: Wire together, both inputs of XOR gate and apply only one signal. Test the output and record the truth table. Show truth tables to the instructor and come up with a reason why test 2 was not a complete waste of time. Tell us what you have built by performing test 2 WIRING SIMPLE NETWORKS Construct the following networks using the gates within the chips. All inputs to the network are to be connected to the switches and the outputs to the LED’s on the breadboard. Ensure that all IC chips are properly powered and grounded. Ensure that all interconnections are correct. Switch on the power and test the network. Circuit Schematic of Network 1: Task 1: Apply test signals to the input of the network and record the values in a truth table. Record all truth tables in your lab notebook. Demonstrate the results and obtain the signature from your lab instructor. PRE-LAB FOR NEXT WEEK. All pre-labs must be done in your lab notebook. We will look at your pre-lab during your lab session. Be aware, we will ask questions about the pre-lab so if you want all your points. Do them yourself. 1) Jim has run out of ‘three-input XNOR’ gates and he desperately needs one to finish his Anti-Homework Bomb. All he has in his lab are NAND gates. How can he make use of these NAND gates to construct a three input XNOR gate? Talk about how might humanity benefit from an XNOR gate (think of an application for XNOR logic). Hint: 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 0 0 1 1 1 1 0 1 1 1 1 1 0 Draw out the schematic for XNOR using NAND in your lab notebook.