ENG 100 Electric Circuits and Systems Lab 6: Introduction to Logic Circuits Professor P. Hurst Lecture 5:10p 6:00p TR, Kleiber Hall Lab 2:10p 5:00p F, 2161 Kemper Hall LM741 Operational Amplifier Courtesy of Wikimedia Commons, the free media repository Submitted Friday, March 13, 2015 by Justin K. Duhow Mechanical Engineering, 2016 University of California, Davis Lab Partner: Matthew Escalante Mechanical Engineering, 2016 University of California, Davis
Introduction On older television remotes, a popular feature that was implemented was a last channel button. When the button was pressed, the television would switch back to the previously selected channel, making flipping between two specific channels very easy. The remote s circuit has some way of remembering the selected channel and saving it to a state. The remote circuit most likely had a logic circuit (also called flip-flops) that recalls past states and ultimately holds a form of data. In this lab, a similar logic circuit was examined and explored. First a simple LED circuit was created and voltage and currents through a resistor and LED were measured. Next, a Dual In-line Package Switch was implemented to mechanically generate logic signals, and the same circuits were examined at different switch states. Thirdly, a NAND gate circuit was built to generate truth tables for two circuits. Lastly, two unique logic functions using NAND gates were created and truth tables were examined. Theory NAND gates are logic gates that produce an output that is false if and only if all inputs are true. NAND gates are schematically represented with the following diagram and truth table: A B Q 0 0 0 0 1 0 1 0 0 1 1 1 Invert (NOT) Gates are also logic gates that invert an input signal. Invert gates are schematically represented with the following diagram and truth table: A Q 0 1 1 0 Alternatively, NAND gates can also function as NOT Gates when the inputs are connected in specific ways. Both of the below schematics show NAND gates that operate as NOT gates.
Experimental Details To construct the circuits the following components were used A Resistor is an electrical component that employs resistance in a circuit. They restrict current by releasing some of the electrical energy as heat and thereby lowering voltages Light Emitting Diodes (LEDs) are electrical components that act as a one way valve for current while also giving off part of that energy in the form of light. These devices are made from gallium arsenide, and photons are emitted when enough current passes through the diode. In this lab, the state of the LED (on/off) was used to visually represent the output value. A Mechanical Switch is an electrical component that serves as a mechanical circuit short and open. When the switch is open, the switch leads are not making contact with each other, thus making current unable to flow. When the switch is open, the switch physical makes contact with the rest of the circuit leads, allowing current to flow. In this lab, a Dual In-Line Package (DIP) switch was used to serve as mechanical logic inputs. Logic Gates are electrical components used in digital circuits that implement Boolean operations on more or more inputs to yield an output. The particular logic gate used in this lab is the 74LS00 NAND gate. The schematic representation and the input/output pins are described below. Breadboards (or protoboards) are platforms that facilitate rapid prototyping with circuit components. They allow components to be easily connected together, facilitating circuit analysis.
Experimental Procedure and Results 1. Light Emitting Diode (LED) The following circuit was built on the breadboard Experimental Setup Sketch The voltage drop across the LED and across the Resistor was measured with a Digital Multimeter. The current flowing through the LED was then calculated. The same circuit was built with a resistor instead of a resistor and the same voltage drops were measured. The LED was disconnected from ground and that lead was connected to. The current flowing through the LED was measured to be. No current was flowing through the LED and the LED state was off.
2. Dual In-Line Package Switch Two switches in a DIP switch package were connected on the breadboard as shown on the following schematic. Experimental Set-up Sketch The output of one of these circuits was measured with the digital multimeter when the switch is open (position off ) and when it is closed (position on ). 3. NAND Gate Leaving the DIP switch connected, the 74LS00 IC was connected to the output of the former circuit. The components were connected as shown: Experimental Set-up Sketch
Using the multimeter, the gate input and output were measured to verify the NAND gate truth table, and a table of the input and output voltages for the 4 possible input cases were made. Switch State Input Voltage Input Signal Output Voltage Output State LED State 1 2 1 2 1 2 OFF OFF 5 V 5 V 1 1 0.16 V 0 OFF OFF ON 5 V 0 V 1 0 3.10 V 1 ON ON OFF 0 V 5 V 0 1 3.10 V 1 ON ON ON 0 V 0 V 0 0 3.09 V 1 ON Notice how this truth table match the same for a NAND gate. A resistor with an LED was connected to the NAND gate output, but the shorter LED lead from ground was connected to the NAND gate output instead. When all 4 input combinations were applied, the truth table was inverted. The reason why this was the case is because the LED is a diode, meaning that is restricts current flow in one direction. In this case, the LED was reversed, so therefore the output states would be inverted. 4. Other Logic Functions Using NAND Gates The 2 input NAND gate was wired as an inverter, and an LED with a connected to the NAND gate output as shown in the following schematic. resistor was Experimental Setup Sketch The two possible input values to the inverter gate were applied and the resulting truth table was created by observing the LED. Switch State Input Signal Output Signal LED State OFF 1 0 OFF ON 0 1 ON These results match the output of an inverter circuit.
Then using DeMorgan s theorem, a circuit with 2 input NAND gates that implements an OR operation was built. The DIP switch was used to control inputs and the output truth table was recorded. Experimental Setup Sketch Switch State Input Voltage Input Signal Output State LED State 1 2 1 2 1 2 OFF OFF 5 V 5 V 1 1 1 ON ON OFF 0 V 5 V 0 1 1 ON OFF ON 5 V 0 V 1 0 1 ON ON ON 0 V 0 V 0 0 0 OFF This truth table matches the same truth table as an OR gate. Experimental Error There were a few sources of error, mainly due to the limits of human accuracy. One possible error could be the result of dialing in the correct voltage on the power supply, despite the multimeter giving us a supposed correct reading of. Also, circuits and electrical components are not 100% efficient, as there are small losses to do wire resistance and heat. The electrical components themselves possibly could have been a bit faulty or their supposed values might have varied over the years of being used by students. All of the above are reasons that might have caused the calculated values to deviate from the measured values.