Pages created and updated by Terry Sturtevant Date Posted: May 12, 2017

# PC/CP120 Digital Electronics Lab

## Digital Logic Lab

### Objective:

• Construct a circuit using a 7400 Quad NAND logic gate and connect power and ground to the gate.
• Learn how to read a schematic design for a circuit.
• Hook up an LED to provide output.
• Use a dip switch to provide input.
• Check functions of the gates on a chip and derive the truth table for the component.

### Background:

#### DIP Switches

A Dual Inline Package, or DIP switch can be used to select between 0 and 5 volts at some point in a circuit. Since the dip switch does not have any power or ground connectors this must be done externally.

• When the switch is turned on (in the "closed" position) it means that the connection between the top and bottom is connected and the input signal will pass to the other side (output).
• When the switch is turned off (in the "open" position) there is no signal and the output may float from 0 volts to 5 volts, and anything in between.

In our case we want a high (5V) when then switch is turned on, so each input pin we are using must be connected to power. When the switch is off we want a low (0V); but remember when the switch is off it is in a floating state. To resolve our floating pins issue we need to add a resistor to the output pins. Since we are using 8 switches, using 8 individual resistors would be rather tedious, so it is fortunate that we have a device called a resistor array which makes this convenient. The particular resistor array (10x-1-102) which we will use has several resistors in it which all have one end in common. In our circuit we connect the common pin of the resistor array to ground.

#### Light Emitting Diodes

Light Emitting Diodes, or LED's for short, emit light when an electric current is passed through them. The amount of current must be limited, however, or the diode will be destroyed. Usually a current of 10 mA is sufficient to light a diode, so if a 5 volt supply is being used, a 500 resistor placed in series with the diode will provide the right current. Note that the diode has one long pin, called the anode, and one short pin, called the cathode. The longer pin is connected to the higher (i.e., more positive) voltage, and the short pin goes to ground.

#### 7400 IC

For this lab we will be using the 7400 Quad NAND gate IC. This chip contains four 2-input NAND gates. The pin numbers associated with each input and output of this chip are listed above the input and output of the NAND gates in the diagram above. You can also find the pin and operating specifications on the datasheet.

In this lab you will create a circuit which will turn an LED (light emitting diode) on or off depending on the selected input. The LEDs will give a visual indication of a 1 (LED lighted) or a 0 (LED dark). We connect the DIP switch to select between 1 (high voltage +5v) and 0 (low voltage).

#### Parts List

• resistor array (10x-1-102)
• NAND gate (7400).
• four 510 Ohm resistors
• 8 switch dip switch
• four LEDs
• Wires

#### Modular design and debugging

When building a circuit with several components, it's easier to debug if you build it in a modular fashion. This circuit will be in three modules:
• output
• logic
• input
You'll build them one at a time, and as each module is known to work, use it to help test the others.
1. At one end of the breadboard, wire up the 4 LEDs with their resistors. Test each one to see that the LED lights up when the other end of the resistor attached to an LED is connected to Vcc (i.e. power). This is the output module.
If the LEDs are very dim, try using a lower resistor; down to 100 Ω or so should be fine.
2. Once the LEDs are working, wire up the chip and connect the chip outputs to the LED resistors.
For each gate, see that grounding both inputs turns the associated LED on, and putting both inputs to Vcc turns the LED off. This is the logic module.
3. Now connect the DIP switch and the resistor array, and connect the inputs to the gate. Since you have already verfied that the gates work, if the DIP switches have been wired correctly everything should work. This is the input module.
4. Verify the operation of each of the gates to show that the DIP switch inputs perform as expected.

Demonstrate your results to the lab demonstrator.

## Resources

If you need to update a browser, you might try Firefox which is
• free
• open source
• available for several platforms

Since this page uses cascading style sheets for its layout, it will look best with a browser which supports the specifications as fully as possible.

If you are looking for an office package, with a word processor, spreadsheet, etc., you might try OpenOffice which is
• free
• open source
• available for several platforms

Go to the main page for the Department of Physics and Computer Science.

Wilfrid Laurier University