Binary Counter with Indicators

advertisement
ECE 2051 Fundamentals of EE II – Practicum
Fall 2001
4 – Binary Counter with Indicators
This assignment is the first phase of the Digital Sequencer project. This project
consists of the design, construction, and testing of an analog/digital circuit that starts,
runs, and stops a small dc motor according to a prescribed timing sequence. The first
time period of the sequence, called the start period, initiates a flashing yellow LED.
The second time period, called the warning period, initiates a warning tone from a
loudspeaker. And the third time period, called the run period, turns on a red LED and
activates a dc motor. At the end of the run period, the timing sequence automatically
terminates and all devices shut off. All time periods are to be synchronized to a
common clock, which has a frequency of 1 Hz (one cycle per second).
Objectives for Today
The objectives are:
1. To design, build, and test LED indicators.
2. To build a binary counter using an SN74LS93 4-bit counter.
3. To integrate the counter with the indicators.
Integrated Circuits and Wiring
The following information is taken from chapter 1 in the text by Wakerly1.
Integrated circuits (ICs) should be properly conditioned before inserting them into the
plug-in strips of a breadboard. The spacing across the gutter of the plug-in strip is 0.3
inch, the same as the spacing between rows of pins of a standard 14-, 16-, or 18-pin
IC dual in-line package (DIP). New ICs are shipped with the pins bent apart from the
vertical to facilitate handling by automatic insertion equipment. Hence, the pins must
be bent back so their spacing is exactly 0.3 in., before it can be inserted in the strip for
the first time.
All ICs should be inserted with the same orientation on the breadboard in order to
facilitate wiring and debugging. It does not pay to reverse the orientation of some ICs
in order to minimize wire lengths. Figure 4-2 shows a standard 14-pin IC. A notch or
marking on the IC locates pin 1. In general, IC ground pins are on the left and power
pins (VCC) are on the right. Thus breadboard ground buses should be wired on the left
and power buses wired on the right. Then all ICs will be oriented on the breadboard
with pin 1 in the upper left-hand corner.
A pair of needle-nose pliers is very useful for inserting and removing wires
especially in tight quarters. A wire stripper is used for cutting wire to length as well
as stripping the insulation. Orienting a wire stripper at a 45-degree angle, for cutting,
will produce a point on the end of the wire making it easier to insert into the plug-in
strips.
In general it is best to run all wires around ICs, and not over them. This clearly
will make debugging easier and allows easy removal of the IC if it is bad. Keep wires
1
Logic Design Projects Using Standard Integrated Circuits by John F. Wakerly, 1976, John Wiley & Sons,
Inc.
533583244
4-1
03/09/16
close to the surface of the breadboard and make them as short as possible – no
antenna loops!
Debugging your circuits will be easier if you follow a wiring color code. As an
example, use
RED
+5 volts power
Black
Ground
White or Orange for signals
Wire the power and ground to each IC on the breadboard first. Next do all the
regular wiring. The importance of neat wiring cannot be overemphasized. Sloppy
wiring invariably leads to troubleshooting nightmares. Even the instructor can not
follow it.
IN LABORATORY
Exercise 1: LED Indicators
Figure 1 shows three identical circuits; each circuit has resistors Rb and Rc, an
LED (light emitting diode) and an npn transistor. Each circuit is referred to as an
LED driver circuit. Each circuit has the property that it turns on or off the LED
according to the value of the input Q. Each input will be a signal that is either 0 volts
or + 5 volts.
The proper operation of an LED driver is as follows. When an input voltage, Q, is
+ 5 volts (called a logic HIGH), the transistor turns on (saturates) and the LED lights
up; when the input voltage Q goes to 0 volts (called a logic LOW), the transistor turns
off and the LED goes out.
Your task is to determine the required resistor values for the circuits.
1. Start a new page in your notebook. Title the page Digital Sequencer Project Part
1. Date the page and put in the page number.
2. Write a short statement of objectives.
3. To start, assume that the transistor has a minimum (beta) β of 30. Assume that the
turn-on voltage of an LED is about 1.5 volts, and that the maximum current
through each LED is 10 mA. To determine the resistor value for Rb you have to
assume that the transistor is in the saturation mode.2
2
The saturation mode means that voltage vCE is about 0.1 V and voltage vBE is 0.7 V. The base current iB
should be selected to be the BODF times iCS (the saturation current of the collector) where BODF is the
base overdrive factor, typically 3 to 10.
4-2
Place in your notebook, all of your design work, the final circuit drawing, and the
nominal values of the resistors.
4. To start construction, I suggest that you orient your breadboard in portrait mode
for convenience. Now wire your breadboard for power (+ 5 volts) and ground.
Remember, place ground on the left and power on the right.
5. Next build the LED indicator circuits at the top right hand side of the
breadboard— arrange them as shown in the schematic. These indicators will be
used to show the outputs of the binary counter, which will be designed later. Note
that the terminal labeled Q0 is the least significant bit (LSB) of the counter.
Pinouts for LED's and transistors are in the Appendix.
6. Set the function generator (FG) for a 0 to +5 V rectangular pulse of 2 Hz. (Zero
volts will be considered logic LOW, and +5 volts logic HIGH.) Adjust the pulse
width for a 75 % duty cycle. Connect the scope across the FG output to display its
output. Have your instructor verify the waveform. This waveform will be used to
test the remaining circuits.
7. Connect the FG output to terminal Q0. The correct operation of the LED
indicator is: when the FG goes HIGH, the LED should light; when the FG goes
LOW, the LED should go out. Verify this operation for Q0.
8. Measure and record the base voltage and the collector voltage when the input Q is
LOW and when the input Q is HIGH.
9. Test the other two indicators. If they all are working, indicate this in your
notebook and proceed to the next exercise.
4-3
Figure 1. Three LED indicator circuits.
Exercise: Binary Counter
Figure 2 shows the integrated circuit (IC) layout for the SN74LS93 4-bit binary
counter chip—hereafter referred to as the 7493. The layout shows the pin numbers –
called pinout. Note the following:





Pin 10 is the ground pin3
Pin 5 is the dc power pin4, labeled VCC
Pin 14 is the input pin
Pins 8, 9, and 11 will be the outputs
Pins 4, 6, 7, 13 have no connections (NC)
The complete schematic for the 3-bit binary counter is shown in Figure 3. The
outputs are at pins 9, 8, and 11, and the output at pin 9 is the least significant bit
(LSB).
3
4
Note that this ground pin is NOT on the left of the IC as the wiring notes indicated.
Note that this dc power pin is NOT on the right of the IC as the wiring notes indicated.
4-4
Figure 2. Pinout for the 7493 binary counter.
1. Wire up the counter circuit. The dc supply VCC is + 5 volts. Locate the circuit
on your breadboard to the left of the LED indicators.
2. Connect the Reset Pushbutton to pin 2 [R0(1)] and pin 3 [R0(3)] of the counter as
shown.
3. Connect the counter outputs to the LED indicators.
4. To test the circuit, connect the output of the FG to the input of the counter, pin 14.
Check that the LED indicators are counting properly from 0 to 7 in binary.
5. Now connect CH 1 probe to the input of the counter and CH 2 probe to pins 9, 8,
and 11 (in succession) and use the storage feature of the scope to record the input
waveform and the output waveforms.
6. Record in your notebook, the final schematic and the test results.
7. After testing the operation of the counter, and before proceeding, show the results
to your instructor to obtain a circuit check signature.
POST LABORATORY
Submit the answers and discussions for the following items by the next lab
meeting, which is October 8, 2001.
1. Suppose, in your design of the LED indicator, that you determined that Rb equals
4.7 kohm and Rc equals 470 ohms. And suppose that the transistor actually has a
beta (β) of 120. What effect does this have on the operation of the LED indicator?
Does it still work? Why? Suppose it does not work. Explain why.
2. Refer to the LED indicator circuit again. If the collector is internally shorted to
the emitter in the transistor connected to Q2, explain what happens to the circuit.
4-5
References
 Texas Instruments, The TTL Logic Data Book, 1988, SN74LS93 Data Sheets, pp.
2-277 to 2-281
 Dr. Joseph Kozikowski, ECE 2051 Timing Circuit Design, ECE Dept., Villanova
University, Spring 2000
PARTS LIST
SN74LS93 Binary Counter
Scope with 10 X probes
Resistors: 5 %, ¼ W
LED: red, 3 per bench
Push button switch: 1 per bench
4-6
Figure 3. Binary counter with LED indicators
4-7
APPENDIX
1. Data for 7493 4-bit Counter
Table 1. Reset/Count Function
RESET INPUTS
R0(1)
R0(2)
H
L
X
OUTPUT
QC
QB
QD
H
X
L
L
L
QA
L
Count
Count
L
H = high, L = low, X = irrelevant
Table 2. Count Sequence
Count
0
1
2
3
4
5
6
7
8
9
QA
QB
QC
QD
L
L
L
H
L
L
L
L
H
L
L
H
H
L
L
L
L
H
L
H
L
H
L
L
H
H
L
H
H
H
L
L
L
L
H
H
L
L
H
1
0
L
H
L
H
1
1
H
H
L
H
2. Pinouts for Transistor, Push Button Switch, and LED
Transistor - bottom view
Push Button
Switch - bottom view
LED - bottom view
flat side
flat side
flat side
N
E
B
C
4-8
P
1
2
L
L
H
H
1
3
H
L
H
H
1
4
L
H
H
H
1
5
H
H
H
H
Download