6 Binary Counter and Indicators

advertisement
ECE 2051 Fundamentals of EE II – Practicum
6 – Binary Counter with Indicators
This assignment is the first phase of the Digital Sequencer project. The project
consists of the design, construction, and testing of an circuit that consists of analog
components and digital componentsit 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 small dc motor while activating a red LED. 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 2 Hz.
Objectives
1. To design, build, and test LED indicators,
2. To build a binary counter using an SN74LS93 4-bit counter, and
3. To verify the counter operation with the LED indicators.
Parts List
Binary counter: SN74LS93
Resistors: 5 %, ¼ W
LED: red, three per bench
Push button switch: 1 per bench
Bipolar transistor: 2N2222A or equivalent, three per bench
Notes on Wiring and Integrated Circuits
Please read this first!
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 on the breadboard with the same orientation 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 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
1
Logic Design Projects Using Standard Integrated Circuits by John F. Wakerly, 1976, John Wiley & Sons,
Inc.
106762768
6-1
10/7/02
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 on the breadboard.
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
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:
Black:
White or Orange:
+5 volts power
Ground
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.
Exercise 1: LED Indicators
Figure 1 shows three identical circuits; each circuit consists of a base resistor Rb, a
collector resistor Rc, an LED (light emitting diode), and an npn transistor. Each
circuit is referred to as an LED indicator circuit. The input to each circuit will be a
voltage signal that is either 0 volts (referred to as logic LOW) or + 5 volts (referred to
as logic HIGH).
The operation of an LED indicator circuit is as follows. When the input signal Q
is + 5 volts , the transistor will turn on, i.e., go into saturation, and the LED will light
up. But when the input signal Q goes to 0 volts, the transistor will turn off, i.e., go
into cutoff, and the LED will go out.
1. Your first task is design the LED indicator circuits. As part of your design
process, you may assume the following:
- typical LEDs require 10 mA for normal brightness
- the voltage drop across the LED in the “on” condition is about about 1.6 volts
The npn bipolar junction transistor (BJT) will be operated in the cutoff and the
saturation modes. A BJT is considered to be in the saturation mode when the
base-emitter junction and the collector-base junction are both forward biased. If
we let the collector current, in saturation, be denoted iCs, then you should select
6-2
the base current iB to be higher than iCs/β by a factor of 2 to 10 (called the over
drive factor [ODF]). The Appendix lists data for the transistor.
The result of your design should be a final circuit drawing with resistors labelled
with their nominal values.
2. To start construction, I suggest that you orient your breadboard in portrait mode.
Next wire your breadboard for power (+ 5 volts) and ground. Remember, place
ground on the left and power on the right.
3. Next build the LED indicator circuits at the top right hand side of the breadboard.
Pinouts for LED's, switches, and transistors are in the Appendix.
Hint: Lay out your circuit as shown in the schematic—this will be helpful for
troubleshooting purposes. These indicators will be used to display the outputs of
the binary counter, which will be wired later. Note that the terminal labeled Q0
will be consisered the least significant bit (LSB) of the counter.
4. Now test the indicator circuits by grounding the input (this is logic LOW) and
then placing +5 V on the input (this is logic HIGH). To verify your design,
measure the base voltage and the collector voltage, for each circuit, when the
input is LOW and when the input is HIGH.
5. For a running visual display of your indicator circuits, set the function generator
(FG) for a 0 to +5 V rectangular pulse of 2 Hz where zero volts will be considered
logic LOW, and +5 volts logic HIGH. Adjust the pulse width for a 50 % duty
cycle.
6. Connect the output of the FG to terminal Q0. Check for correct operation of the
corresponding LED indicator. Repeat for the other two indicators.
7. If all of the indicators are working, demonstrate the working circuit to your
instructor for a circuit check. Then proceed to the next exercise.
6-3
Figure 1. The LED indicator circuits.
Exercise 2: Binary Counter
Figure 2 shows the pin layout for the SN74LS93 4-bit binary counter chip—
hereafter referred to as the 7493. Note the following:





Pin 10 is the ground pin2
Pin 5 is the dc power pin3, labeled VCC
Pin 14 is the input pin
Pins 8, 9, and 11 will be the outputs with pin 9 the least significant bit (LSB)
Pins 4, 6, 7, 13 have no connections (NC)
The complete schematic for the 3-bit binary counter is shown in Figure 3.
2
3
Note that this ground pin is NOT on the left of the IC as the above wiring notes indicated.
Note that this dc power pin is NOT on the right of the IC as the above wiring notes indicated.
6-4
Figure 2. Pinout for the 7493 binary counter.
1. Figure 3 shows the schematic for the counter circuit along with the LED
indicators counnected. Wire up the circuit, locating the circuit on your
breadboard to the left of the LED indicator circuits. The dc supply VCC will be
+5 volts.
2. Connect the counter outputs to the LED indicators.
3. To test the circuit, connect the output of the FG to the input of the counter and
check that the LED indicators are counting properly from 0 to 7 in binary.
4. If desired, the waveforms of the input and the three outputs can be observed by
connecting scope probes to these points.
5. After testing the operation of the counter, and before proceeding, show the results
to your instructor.
6. You are advised to place all design calculations, schematics, and results in your
notebook.
6-5
Figure 3. Binary counter with LED indicators
6-6
Reference:
Texas Instruments, The TTL Logic Data Book, 1988, SN74LS93 Data Sheets,
pp. 2-277 to 2-281
Appendix
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
6-7
1
0
L
H
L
H
1
1
H
H
L
H
1
2
L
L
H
H
1
3
H
L
H
H
1
4
L
H
H
H
1
5
H
H
H
H
Appendix 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
P
N
E
B
C
Appendix 3. Data for the 2N2222A npn Transistor4
Symbol
hFE (β)
VCE(sat)
VBE(sat)
4
Parameter
DC Current Gain
IC = 500 mA, VCE = 10 V
Min
Max
40
300
C-E Saturation Voltage
(IC = 150 mA, IB = 15 mA)
(IC = 500 mA, IB = 50 mA)
B-E Saturation Voltage
(IC = 150 mA, IB = 15 mA)
(IC = 500 mA, IB = 50 mA)
0.6
Data from National Semiconductor.
6-8
Unit
0.3
1.0
V
V
1.2
2.0
V
Download