EGR 277 – Digital Logic

advertisement
Lab #1
EGR 270 – Fundamentals of Computer Engineering
EGR 270
Fundamentals of Computer Engineering
Presentation for Lab #1
Instructor: Paul Gordy
Office: H-115
Phone: 822-7175
Email: PGordy@tcc.edu
• Office hours
• Related documents for Lab #1:
o Lab #1
o Lab Report Format/Sample Lab
o Pinouts (Lab Reference Sheets)
o Lab #1 Presentation
1
Lab #1
EGR 270 – Fundamentals of Computer Engineering
Overview of EGR 270 Lab
The EGR 270 lab will expose the student to a wide range of digital circuits and software,
including:
• Discrete digital circuits – circuits built using basic logic gates, including AND, OR,
NOT, NAND, NOR, and XOR, as well as Small- to Medium-scale Integrated Circuits
devices (SSI to MSI), including decoders and multiplexers.
• Programmable logic devices (PLDs) – devices containing hundreds to millions of
logic gates where interconnections are programmed using software. Digital designs
will be specified and PLDs will be programmed in this course using the software Aldec
Active-HDL. This can be done by:
• Drawing schematics
• Writing HDL (Hardware Description Language) programs
• Using Aldec’s state diagram editor
• Microprocessors – digital designs can also be implemented using a microprocessor.
The MicroStamp11 microprocessor, a 68HC11-based system, will be used in this course.
The microprocessor will be programmed using assembly language. (Note that the
MicroStamp11 is programmed using C in the EGR 262 lab.) The following related
software will be introduced:
• Mini-IDE – a freeware assembler for the 68HC11 (converts assembly language into
machine code)
• Wookie Simulator – a freeware assembler for the 68HC11 for testing programs
2
• MicroLoad – for downloading machine code into the MicroStamp11
Lab #1
EGR 270 – Fundamentals of Computer Engineering
Logic Gates
Logic gates will be introduced shortly in the lecture portion of this course. A few
basic logic gates are introduced here that will be used in Lab #1.
Inverter (NOT gate)
Truth table
A'  A  " NOT A"  " A NOT"
A
A’
AND gate
AB = AB = “A AND B”
AB = 1 if A = 1 and B = 1
A
AB
B
A
A’
0
1
1
0
Truth table
A
B
AB
0
0
0
0
1
0
1
0
0
1
1
1
3
EGR 270 – Fundamentals of Computer Engineering
Lab #1
OR gate
A+B = “A OR B”
A+B = 1 if A = 1 or B = 1 or both
A
A+B
B
XOR gate
AB = “A Exclusive-OR B”
Definition for two inputs only:
AB = 1 if A  B
Definition for two or more inputs:
AB = 1 if the input has odd weight
where weight = number of inputs equal to 1
A
B
Truth table
A
B
A+B
0
0
0
0
1
1
1
0
1
1
1
1
Truth table
A
B
AB
0
0
0
0
1
1
1
0
1
1
1
0
AB
4
Lab #1 EGR 270 – Fundamentals of Computer Engineering
Logic Gate Technology
Logic gates can be implemented using many technologies. Logic families (and
subfamilies) vary in voltage levels, current levels, propagation delay, power
dissipation, noise margin, and more. These terms will be discussed in a later lab.
Some integrated circuit technologies include:
CMOS (Complementary Metal Oxide Semiconductor)
- 4000 Series IC’s (Example: 4071 Quad 2-input OR gate)
- Also available in some 7400 series (see under TTL subfamilies)
- Static sensitive, low-power consumption, wide range of voltages
ECL (Emitter Coupled Logic)
- 10000 Series IC’s (Example: 10H101P Quad 2-input OR gate)
- Extremely fast, but increased power dissipation
TTL (Transistor-Transistor Logic)
- 7400 Series IC’s (Example: 7432 Quad 2-input OR gate)
- Inexpensive, wide assortment of functions
- Older, slower technology, but still good for experiments
- PSPICE EVAL library has a wide assortment of 7400 series devices
- Many subfamilies (see next slide)
5
Lab #1
EGR 270 – Fundamentals of Computer Engineering
TTL Subfamilies
- 7400 Series (Standard TTL) – Example: 7432
- 74H00 Series (High speed TTL) – lower propagation delay
- 74S00 Series (Schottky TTL)
- 74LS00 Series (Low-power Schottky)
- 74ALS00 Series (Advanced low-power Schottky)
- 74C00 Series (CMOS device with 7400 series pin connections)
- 74HC00, 74HCT00 Series (CMOS, speedy, low power)
- 74F00 Series (fast TTL) – lower propagation delays
- etc
So purchasing an OR gate may not be so simple! Which of the following do
you buy? 4071, 10H101P, 7432, 74H32, 74S32, 74LS32, 74ALS32, 74C32,
74HC32, 74HCT32, 74F32, etc. For simple projects and experiments, it
may not matter. When speed, power consumption, noise immunity,
temperature range, and other factors need to be considered, more care should
be taken.
In this course we will primarily use 7400, 74LS00, and 74HC00 devices.
6
Lab #1
EGR 270 – Fundamentals of Computer Engineering
IC Packaging
IC’s and other electronic devices are available in a variety of packages. The table
below was taken from a Jameco Electronics catalog. Most of the IC’s that will be
used in lab will be DIP (Dual In-line Packages).
7
Lab #1
EGR 270 – Fundamentals of Computer Engineering
IC Packaging - Two IC packages will be discussed below:
Surface mount
• For use on soldered boards without needing to drill holes for pins
• Pins may be on two sides or 4 sides
SOIC Surface mount IC
(Small Outline Integrated Circuit)
Surface mount IC on a flash drive
(reference: Wikipedia)
DIP (Dual In-line Package)
• Two rows of pins
• Commonly available with 8, 14, 16, 20, 24, 28, 40 pins and more
• For use in breadboards or on soldered boards with drilled holes for pins
• We will use DIP packages in lab since we will breadboard circuits.
8
EGR 270 – Fundamentals of Computer Engineering
Lab #1
DIP Packaging Pin Numbering
• DIP packages have a dot or a small semicircular cutout on one end.
• If the dot or cutout is on your left (top view), then:
 Pin 1 is at the lower left.
 Numbering continues counterclockwise around the IC.
8
7
6
5
1
2
3
4
8-pin DIP IC
14
13
12
11
10
9
1
2
3
4
5
6
14-pin DIP IC
8
7
9
Lab #1
EGR 270 – Fundamentals of Computer Engineering
Pinouts
• A “pinout” is a diagram showing the connections for an IC.
• See the document Lab Reference Sheets (Pinouts.doc) for pinouts of ICs
used in lab. You can cut and paste the pinouts into your lab reports.
• What do the terms dual, triple, quad, and hex mean?
1K
1Q
1Q
Gnd
2K
2Q
2Q
2J
16
15
14
13
12
11
10
9
14
13
11
12
10
9
8
Vcc
CLR
•
•
•
•
Dual:
Triple:
Quad:
Hex:
PR
K
Q
J
CK
Q
7427
CK
J
Q
K
7476
PR
Q
CLR
Gnd
1
2
1CK 1PR
3
4
5
6
1CLR
1J
Vcc
2CK
7
8
2PR
2CLR
13
12
11
10
9
2
3
4
5
6
7
7427 Triple 3-input NOR
7476 Dual JK Flip-Flop
14
1
8
Vcc
14
13
12
11
10
9
5
6
8
Vcc
7408
7404
Gnd
1
2
3
4
5
6
7408 Quad 2-input AND
7
1
2
3
4
7404 Hex Inverter
7
10
Lab #1
EGR 270 – Fundamentals of Computer Engineering
Lab Equipment
Before beginning Lab #1 next week, let’s take some time to become familiar
with some of the equipment in the lab. Refer to handouts on equipment.
Agilent 34401 Multimeter
Use to measure voltage, current,
resistance, frequency, and more.
PS280 DC Power Supply
Two 0-30V variable supplies and one
fixed 5V supply.
Breadboard
Circuits will be constructed
on solderless breadboards
11
Lab #1
EGR 270 – Fundamentals of Computer Engineering
Agilent 34401 Multimeter
12
Lab #1
EGR 270 – Fundamentals of Computer Engineering
PS280 DC Power Supply
0-30V
0-30V
5V
13
Lab #1
EGR 270 – Fundamentals of Computer Engineering
PS280 DC Power Supply
14
Lab #1
EGR 270 – Fundamentals of Computer Engineering
Breadboard
SK-10 Solderless Breadboard (or equivalent)
A
B
Internal Connections on the SK-10 Solderless Breadboard
Notes: 1) Lines indicate which holes are connected under the breadboard.
2) To connect two or more wires together, plug them in the same row of holes.
3) Holes A and B are connected on some breadboards (as well as the similar holes on
the other horizontal rows).
15
Lab #1
EGR 270 – Fundamentals of Computer Engineering
Example: Building a resistive circuit on the SK-10 solderless breadboard.
5.6 kW
10 V
+
_
3.3 kW
1.0 kW
2.2 kW
1.5 kW
Connections to
10 V power supply
Jumper
+
_
Jumper
16
EGR 270 – Fundamentals of Computer Engineering
Lab #1
Example: Building a digital circuit on the SK-10 solderless breadboard.
Jumper
OFF
7408
7432
ABC
ON
Jumper
+
_
7805
Switch_A
Switch_B
13
U1
9V
Battery
11
12
+
6–35V
_ in
+
5V
_ out
7805 5V Regulator
12
U2
Switch_C
13
11
LED
17
Lab #1
EGR 270 – Fundamentals of Computer Engineering
Resistor Color Code
The resistance of carbon resistors is indicated by colored bands on the resistor. The first three
bands (A,B,C) indicate the value of the resistance and the last band (D) indicates the tolerance.
Values for Bands
A, B, and C
R is calculate using:
ABCD
R = AB x 10C
or
A = First Digit
B = Second Digit
C = Number of Zeros
D = Tolerance Code
Values for Band D
Gold – 5% tolerance
Silver – 10% tolerance
None – 20% tolerance
Examples:
Yellow, Violet, Brown, Silver: R = 47 x 101 = 470 W, 10% tolerance
Brown, Black, Orange, Gold: R = 10 x 103 = 10 kW, 5% tolerance
18
Lab #1
EGR 270 – Fundamentals of Computer Engineering
Resistor Color Code – Carbon resistors
typically have 4 color bands that indicate
their value and tolerance. You can
determine the value of resistance and
tolerance using the handy online Resistor
Color Code Calculator shown to the
right. It is available at:
www.electrician.com/resist_calc/
resist_calc.htm
19
EGR 270 – Fundamentals of Computer Engineering
Lab #1
Diode
A diode is a semiconductor device that acts somewhat like a voltage controlled
switch. The symbol for a diode is shown below. The positive terminal of the
diode is called the anode and the negative terminal is the cathode.
anode
cathode
+
V
_
Diode Symbol
anode
cathode
_
+
V
Diode Appearance
Pictures of diodes
(Reference: www.allelectronics.com)
20
EGR 270 – Fundamentals of Computer Engineering
Lab #1
LED (Light emitting diode)
LED’s are diodes that emit light when they are forward biased (a positive voltage
placed across the LED from anode to cathode as shown below). The amount of
light produced is proportional to the current through the LED
Luminous
intensity
anode
destruction
cathode
+
V
_
Forward-biased LED
anode
(long)
cathode
(short)
LED: Physical appearance
I (mA)
12
20
Typical LED characteristics
Pictures of LEDs
(Reference: www.allelectronics.com)
21
Lab #1
EGR 270 – Fundamentals of Computer Engineering
LED (Light emitting diode)
The resistance of an LED is sufficiently low such that if a few volts is placed
directly across an LED, it will be destroyed. Therefore, a current-limiting resistor
should always be used with an LED. The resistor must be chosen to yield a
current such that an appropriate brightness is obtained.
Common values for current-limiting resistors:
200 W, 220 W, 270 W, 330 W
220 W
LED lights when
output is HIGH
LED and current-limiting resistor used to indicate output logic level
22
Lab #1
EGR 270 – Fundamentals of Computer Engineering
DIP Switches
• DIP switches are groups of simple slide switches in DIP packages.
• DIP switches are commonly used on circuit boards to select options. You may
have seen them used in printers, modems, remote for garage door openers, etc.
• DIP switches are commonly available with 2-12 switches (poles).
• DIP switches usually have OFF or ON marked next to one switch position,
where
• ON = closed switch
• OFF = open switch
12-pole DIP Switch
4-pole DIP Switch
(Reference: www.allelectronics.com)
(Reference: www.jameco.com)
23
Lab #1
EGR 270 – Fundamentals of Computer Engineering
DIP Switches
1
2
3
4
4-pole DIP Switch: Schematic
4-pole DIP Switch: Appearance
(Reference: www.jameco.com)
Slide switch to ON position to close.
24
Lab #1
EGR 270 – Fundamentals of Computer Engineering
Using DIP Switches to provide HIGH and LOW inputs
Since a DIP switch simply makes or breaks a connection, a resistor needs to be
used to in order to use it to provide either a HIGH or LOW input to a logic gate.
+5 V
Discuss how this switch works:
2.2 k
switch
output
ON or closed (LOW)
DIP
switch
OFF or open (HIGH)
25
Lab #1
26
EGR 270 – Fundamentals of Computer Engineering
Using a 4-pole DIP switch to provide 4 circuit inputs
+5 V
2.2 k
+5 V
2.2 k
+5 V
+5 V
2.2 k
2.2 k
A
B
F
C
D
F = AB + CD
DIP
Switch
OFF = Open Switch = HIGH input
ON = Closed Switch = LOW input
Note: Look again at the
example of the digital
circuit on the breadboard
shown earlier and closely
study the DIP switch
connections.
Lab #1
EGR 270 – Fundamentals of Computer Engineering
Drawing schematics with PSPICE
• PSPICE has a schematic editor that is easy to use.
• The EVAL library contains a wide variety of 7400 series devices.
• Most devices in PSPICE use exact pinouts and labeling.
• Simple logic gates are an exception. For example, rather than showing four
2-input AND gates if a 7408 part is used, only a single 2-input AND is used.
However, exact pin numbers for the 14-pin 7408 can be used by referring to
the 4 gates on the IC as A, B, C, and D as follows:
14
Vcc
13
12
11
10
9
8
6
Gnd
7
C
D
7400
A
1
2
B
3
4
5
27
EGR 270 – Fundamentals of Computer Engineering
Lab #1
Example: Implement F1 = AB + CD + EF + GH using the 7408 and 7432
IC’s in PSPICE.
Since four 2-input ANDs and three 2-input Ors are needed, only two ICs are
required. By default PSPICE uses seven IC numbers U1A – U7A. However,
if U3A below is changed to U1C, the corresponding pin numbers change!
U1A
A
1
B
2
U1A
A
1
B
2
3
3
U5A
U2A
1
1
7408
3
7408
3
2
2
U2A
C
U1B
1
C
7432
4
7432
3
D
6
D
2
5
U7A
7408
1
U3A
2
U2C
7408
9
U1C
10
3 F1
E
E
1
3
F
8 F1
9
7432
8
7432
F 10
2
U6A
7408
1
U4A
2
U2B
7408
4
U1D
5
3
G
G 12
1
3
H
6
7432
11
7432
H 13
2
7408
PSPICE schematic
using 7 ICs (U1 – U7)
7408
PSPICE schematic
using 2 ICs (U1 – U2)
28
Download