Digital Logic Lab CS421 – Dr. Shaffer Due: September 7, 2011 1

advertisement
Digital Logic Lab
CS421 – Dr. Shaffer
Due: September 7, 2011
1
1.1
The power supply
Introduction
Digital logic-based circuits use fixed voltage levels to indicate logic state. Depending on the semiconductor technology being
used, the logic true state is normally represented by a positive voltage of anywhere between 2.7V and 5.5V, while logic false
is normally ground. We will use the standard 5V true since all of the parts we are using function properly with this voltage.
In addition to needing 5V to represent a true state, we will need it to power our semiconductor-based integrated circuits
(IC’s).
The standard wall-mounted transformer, or “wall wart”, does not supply a stable enough voltage to be used as a power
supply so we will use a device called a Linear Voltage Regulator to take the power provided by our wall wart and turn it into
a stable 5V supply. The regulator we will use is the standard LM7805 which can convert the unregulated 9V supplied by
our wall wart to a very stable 5V but with some limitations. The most important of these is that it can only supply about 1
Amp of current. We will have to keep a “current budget” to make sure that none of our circuits exceed this.
1.2
Construction
Begin with an empty breadboard and construct the circuit in Figure 1. This circuit will be a permanent part of your
breadboard so please do a nice, neat job constructing it. Trim all wires and component leads to the required length and do
not use any unneeded wires. Try not to obstruct unused holes in your breadboard.
Figure 1: Regulated power supply
Some notes:
1
• Cut the barrel connector off the end of the wall wart, strip about 1/4 inch of wire from the end. Separate the wire from
the stranded white insulator and twist the wire. Use a Digital Multimeter to determine the positive wire and connect
it to the green post of your breadboard. Connect the ground wire to the black terminal of your breadboard. These are
your +9V and ground posts correspondingly.
• I recommend placing the switch and the LED in the upper left corner of your breadboard and placing the 7805 on the
other side of the center gap.
• GND is the blue “ground rail” of your breadboard. Be sure all ground rails are connected.
• Connect the “output” pin (pin 3 of the 7805) to all red rails of your breadboard. This makes it easy to get 5V anywhere
you need it.
• 0.1µF capacitor is labeled “104”
• 0.22µF capacitor is labeled “22k”
• The actual resistor value may differ from the one in this diagram. Just use the supplied resistor.
• Connect the ground post of your breadboard (the one with the wall wart ground wire connected to it from the last lab)
to the ground rail of the breadboard.
• Connect the 9V post of your breadboard (the one with the wall wart 9V wire connected to it from the last lab) to pin
3 of your switch.
1.3
Testing your power supply
I recommend that you ask me to check your circuit before you plug in your wall wart. Once you are confident
that you’ve correctly wired your circuit, ensure that your power switch is in the off position and plug in the wall wart. If you
smell anything funny, notice that any of the parts are especially hot, or the room lights dim, unplug it immediately. With
the power switch still in the off position, use a Digital Multimeter (DMM) to measure the voltage across the power posts. If
you measure less than 9V, this could indicate a short circuit, unplug the wall wart and check your circuit.
Once you are getting 9V to 12V from the wall wart, it is time to measure the output of the voltage regulator. To measure
the voltage on your power rails, insert a test wire in each one (two separate wires!!!!). Turn your power switch to the “on”
position (the LED should light, if it doesn’t try turning it around). Use the DMM to measure the voltage across those wires.
If you are seeing significantly below 5V, unplug your wall wart and check your circuit. (Note: With no “load” on the circuit,
the 7805 may produce errant voltages, if you are seeing anywhere between 4 and 7 Volts, that’s fine.)
2
Indicators
We will need logic indicator lights in several of our projects so let’s add them to the breadboard now. The circuit in Figure
2 includes four indicator inputs: I0 through I3 which can be connected to a digital output to provide an indication of the
output’s logic level. The LEDs in this circuit are the 5mm (larger) clear-cased “super bright” LEDs. After you construct
this circuit, test your indicators by connecting the inputs the +5V rail (the indicator should light) and then separately to
the GND rail (the indicator should not light).
The 100Ω resistor is brown, black, brown gold. If you would like your LEDs to be dimmer, use the 200Ω resistors (red, black,
brown, gold).
2
Figure 2: Indicator LEDs
Note: Make a mental note that these indicators require about 20mA each to light. We can light all of them using only
80mA, which isn’t a concern as far as our voltage regulator goes (1A max) but we need to check that whatever device is
“driving” the indicator can supply the desired current.
3
The 74HC00 quad two-input NAND gate
The 74HC00 provides a simple introduction to digital integrated circuits. The 74HC00 has four identical two-input logic
gates. Each of these gates has inputs A and B and produces an output Y determined by Y = ¬ (A · B) (the “not” of the
“and” of A and B hence NAND).
Open the datasheet for the 74HC00 Quad two-input NAND gate and read the “Pin configuration” diagram and related table.
Note that the IC includes a dot (or notch) to establish the orientation of the chip. Find your 74HC00, locate the dot/notch
and place the chip on your breadboard so that pin one is on the left and positioned properly on the breadboard so that we
can make connections to each pin.
Digital IC’s require a power source, separate from their digital inputs. The power supply and ground pins are normally
labeled VCC and GND respectively. Find these pins on your 74HC00 and connect them to the +5V and Ground rails.
We will use NAND gate 1 (inputs 1A, 1B and output 1Y ). Connect inputs 1A and 1B to +5V. This corresponds to logic
true on each input. Connect the pin corresponding to 1Y to indicator input I0 . Plug in and turn on your system. When
output 1Y is true (5V), the LED will light and when it is false, the LED will not light. The LED should not light since
¬ (true · true) = f alse. Try the other three combinations of inputs and verify that your NAND gate is operating properly.
You should flip your power switch to the off position while making wiring changes.
Note: As we mentioned above, we should check that the 74HC00 can provide the required current to light the indicator
light. Look at the data sheet on page 5 and note the row labeled IO in the Limiting Values table. The 74HC00 is capable
of supplying 25mA max per output...just a bit more than needed so we are OK. Note also the row labeled ICC which is the
maximum current the IC can draw from the power supply. Only 50mA so while we can safely use this chip to light two
indicator lights, sustained use lighting more than two of the LEDs is likely to result in the failure of the IC.
3
3.1
A logic inverter (not)
NAND is a relatively versatile operation (especially when compared to AND or OR). NAND gates can be combined or their
inputs can be tied together to produce other common logic operations. Create a NOT gate (called an inverter ) which takes
a single input and produces the NOT of that input on its output. Draw your logic gate diagram below.
Use your 74HC00’s gate 2 to wire your NOT gate. Move your indicator LED so that it shows the output of your NOT gate
and verify that it works correctly for both values of the input.
3.2
AND gate
Based on your work in the previous sub-section, you should be able to create an AND gate by combining two NAND gates.
Draw your logic gate diagram below.
Use your 74HC00’s gates 1 and 2 to create the AND gate that you drew in your diagram. Make sure that your indicator
LED so that it shows the output of your AND gate. Verify that all four combinations of input give the correct output.
3.3
OR gate
As above, create and OR gate. Draw your logic gate diagram below. Wire the circuit and test it.
4
Finishing up
Remove the 74HC00 and all wires associated with it. Leave your voltage regulator and indicator circuits intact as we will
use these throughout the semester.
4
Download