CIS 451 Lab 1: Introduction to Digital Logic

Author: Greg Wolffe, modified by Zack Kurmas, further modified by Andrew Kalafut


Objective: The purpose of this lab is to provide a simple introduction to basic electronics, and to investigate the principles of Boolean algebra. Please pay special attention to terminology, safety issues, and standard lab practices.

Deliverables:Please turn in the answers to all questions in the lab, in hardcopy. Only one copy per group is necessary.


This project should preferably be done in groups of 2. If there is sufficient equipment, you may work alone.


Equipment

Familiarize yourself with the following components of your lab equipment toolbox:

Guidelines

Some important guidelines when working with CMOS:

To use integrated circuits with a breadboard:


Creating a Simple Circuit

Before creating your first circuit, there is something you need to understand about LEDs: Normal, incandescent light bulbs produce light by resisting the flow of electricity. This resistance produces heat, which causes the filament to glow. When you drain a flashlight battery, most of the energy in the battery has been converted to heat.

In contrast, LEDs produce light by exciting electrons causing them to release photons ("light particles"). This process uses use very little energy. Consequently, LEDs do not resist the flow of electricity. When there is nothing to resist the flow of electricity, the amount of current (think "number of electrons per second") increases. You may remember the following formula:

V = IR

Or, in other words, voltage equals current (in amps) times resistance (in Ohms).

  1. Suppose you hooked up a red LED with a resistance of 1 micro Ohm (1x10-6 Ohms) directly to a 5 volt battery. Using the formula above, how much current will be drawn from the battery?

That much current will damage the LED and (more importantly) the breadboard. Therefore, always add a resistor as shown in Figure 1.1 to limit the amount of current through the diode to about 10mA.

  1. LEDs typically use a fixed amount of energy, referred to as the "voltage drop". A red LED has a voltage drop of 1.7V, leaving 3.3 volts to "push" the current through the resistor. How strong of a resistor should you add to the circuit to limit the current to 10mA?
  2. What value resistor should you use for a green LED with a voltage-drop of 2.1 volts?
  3. What are the color codes for the resistors in the preceding questions?

Now that you understand the importance of using resistors, construct the circuit shown in Figure 1-1 and described below.

Simple LED

Using Integrated Circuits

Integrated circuits typically contain multiple logic gates and hence provide multiple input and output connections (called pin outs). Find an IC labeled 74HCT08 - this is a quad 2-input AND gate. That means there are four AND gates within the chip, each of which takes two inputs. Each AND gate implements the Boolean AND function.

If the chip is positioned with the notch to your left, then pin number 1 in the lower-left corner. The remaining pins are numbered sequentially and counterclockwise.

Integrated circuits need power in order to open and close the transistors that implement the gates they contain. Pin 14 (in the upper-left corner) is called VCC. This is where you connect the source voltage. Pin 7 (in the lower-right corner) is where ground voltage is applied. In other words, Pin 14 must be connected through a breadboard terminal and power distribution strip to the positive terminal of the battery. Likewise pin 7 must be connected to the negative terminal of the battery. Never place a load (current and voltage) onto a pin unless the chip is also powered through pins 7 and 14.

The figure below shows the pinout for chip 74HCT08 --- a chip containing four 2-input AND gates. Pins 1 and 2 are the input to the first of the four AND gates, pin 3 is the output. Likewise, pins 4 and 5 are inputs to an AND gate with output pin 6, pins 9 and 10 (input) connect with pin 8 (output), and pins 12 and 13 (input) go with pin 11 (output).

AND pinout

Your kits also include the following integrated circuits:

Designation Operation
74HCT00 NAND
74HCT02 NOR
74HCT08 AND
74HCT32 OR
74HCT86 XOR

They are all quad 2-input ICs - meaning there are four gates within each chip, where each gate takes two inputs. The course web page provides links to several pages showing the pinouts for these chips.

To investigate the operation of an integrated circuit that implements the AND function, construct the following circuit (Figure 1-3 gives the schematic):

AND gate and LED Perform the following:
  1. Construct a truth table from your observations.
  2. Take the wires attached to pins 1 and 2 and leave the other ends floating in the air. Describe the effect of having these "floating inputs". (To get some more interesting behavior, grab the floating ends with your fingers and wiggle them.)

Switches

You may find it convenient to use switches to control whether an input wire has a "1" or a "0" on it; however, as you noticed, floating inputs can cause erratic behavior. Professor Kurmas's page Using Switches explains how to correctly use the two types of switches in your kit.
  1. Add switches to the circuit you built (the one shown in Figure 1-3). You may use either dip switches or momentary switches. Demonstrate to me that your circuit works correctly. Draw a diagram showing how you incorporated the switches.

Experiment

  1. Get a random IC from me. Replace your 74HCT08 with the new chip. Construct a truth table from your observations. Identify the type of gates the chip contains. (Your writeup needs to include the letter on the chip.)

Creating a more complex combinational circuit

Digital logic is implemented by using basic logic gates as building blocks to create more complex circuits. A combinational circuit is a set of gates whose output function depends only on the values of its current inputs (i.e., there is no storage or feedback involved in the system). The following circuit is a common combinational circuit.

You will need 2 quad NAND IC's (74HCT00), 2 resistors, and 2 LEDs to construct it. I suggest using DIP switches in the "pull-down" configuration to control the values of A and B. Remember to use 4.7K ohm resistors for your switches.

  1. Determine the truth table from observation.
  2. Using your observations as a guide, describe what simple operation this circuit implements. (Hint: Place the LED for output y to the left of the LED for output x.)
  3. Either (1) demonstrate your circuit to the instructor, or (2) add the chip and pin numbers you used to Figure 2-3 below.
Mystery circuit