EECE 280 - Lab #2 Discrete Logic Circuits

Transcription

EECE 280 - Lab #2 Discrete Logic Circuits
EECE 280 - Lab #2
Discrete Logic Circuits
In this lab you will gain experience with:
1.
2.
3.
4.
Using lab equipment including the function generator and oscilloscope.
Designing digital logic circuits.
Designing and measuring a simple oscillator circuit.
Designing a counter circuit and displaying the output on a 7-segment display.
Requirements
1.
2.
3.
Tools & component kit
74HC00 & 74HC04 ICs
LTS-4802BJS-H1 7-segment display (Digikey PN 160-1525-5-ND)
Lab Preparation
1.
2.
Design and build the 4 logic circuits (part B) on your breadboard.
Design the logic and build the 7-segment driver circuit (part D) on your breadboard.
Lab Procedure
A) Lab Equipment
1.
2.
3.
4.
5.
Connect the function generator to channel 1 of your oscilloscope (called a “scope” for
short).
Adjust the function generator and scope so that a 1KHz, 2V p-p sine wave is displayed
such that a single cycle fills the entire screen of the scope.
Adjust the scope so that 10 cycles are displayed and the sine wave only takes up 4 divisions (total).
Repeat steps 2 & 3 using a 50Hz, 5V p-p, square wave.
Repeat steps 2 & 3 using a 1Hz, 1V p-p triangle wave.
B) Logic Circuits: 1 circuit per PAIR
1.
2.
3.
Design the following logic components using only NOT and NAND gates. Write them
in your lab book. You may need to use DeMorgan’s theorem:
a. AND
b. OR
c. NOR
d. XOR
Build all four circuits on your breadboard. Remember to place a 0.1uF bypass capacitor
between the power and ground pins, as close as possible to the power pin, of each IC.
Also connect all inputs of all unused gates to PWR (+5V) or GND. Any floating inputs
will cause NOISE in your circuit.
Verify the operation of each component by connecting one terminal to PWR or GND, the
other to a 1Khz 0-5V square wave (function generator) and the output to your scope. If
you didn’t have a scope, could you verify your circuits using a multimeter? How?
ECE 280 - ECE Laboratory I
Department of Electrical & Computer Engineering, UBC
C) Counter Circuit: 1 circuit per PAIR
1.
2.
On your breadboard, drive a 14-bit counter IC (HCF4020BE) using a 1Khz square wave
from your function generator.
Connect a scope leads to Q10 and Q11. Sketch the output waves. Label the time and
voltage axes.
D) Counter Circuit: 1 circuit per STUDENT
1.
2.
3.
4.
5.
Using only NOT and NAND gates, design and build a circuit that causes a 7-segment display to count up/down by four number, starting from the last digit of your
student number. Use Q10 and Q11 from your counter circuit as its input. One student should design a display that counts up while the other should design a display
that counts down. Note: each counter circuit will require both Q10 and Q11 but both
counters can work simultaneously.
Example: SN #1 = 29292929 and SN #2 = 57575757
• Counter #1 displays 9,0,1,2,9,0,1,2,9,0, ...
• Counter #2 displays 7,6,5,4,7,6,5,4,7,6, ...
Note that the 7-segment display is simply 7 LEDs that share a common anode (positive
terminal). Grounding the lead (setting it to logic 0) of any one of the seven cathodes will
turn an LED on. Look up the data sheet for a complete internal circuit diagram.
Start by writing a truth table for each of the LEDs in the 7-segment display.
Compute and include the correct resistors so that the 10mA is applied to each LED
in the 7-segment display. See “Notes” section for details on how to bias an LED.
Demonstration
1.
2.
3.
4.
Display a randomly selected signal from your signal generator on your scope.
Demonstrate a randomly selected logic circuit.
Demonstrate the 7-segment display counter circuit of student #1.
Demonstrate the 7-segment display counter circuit of student #2.
Notes: How to bias an LED
1.
2.
3.
4.
5.
6.
7.
8.
An LED is a diode that makes light when it is turned on. You will learn all about diodes
and how they work in a future course but this is what you need to know to use them.
A diode only allows current to flow in one direction.
When a diode is on (current is flowing through it), it always has the same voltage across
it, no matter how much current is flowing. Note that this is DIFFERENT FROM HOW
A RESISTOR WORKS. This voltage drop is called the “forward bias” voltage and can
be found in the data sheet for a diode.
If you use a power supply to force a voltage larger than the forward bias voltage across a
diode, you will burn it out.
An LED produces light that is brighter when more current is passed through it, as long as
that current does not exceed the maximum rated current for the device. An more, and the
LED will burn out.
Digital circuits usually produce 5V but diodes typically have a forward bias voltage
close to 1V.
You can use a source voltage that is higher than the forward bias voltage to light an LED
without burning the LED by including a series resistor to drop the additional voltage.
Example:
• Source voltage = 5V
ECE 280 - ECE Laboratory I
Department of Electrical & Computer Engineering, UBC
•
•
Forward bias voltage = 1V
Maximum current = 20mA
V = VD + VR
D
VR = V – VD
V
R
V – VD
VR
5–1 = 200
R = ------ = ---------------- = ------------------–3
IR
IR
20 10
ECE 280 - ECE Laboratory I
Department of Electrical & Computer Engineering, UBC

Documents pareils