Digital Decoders

Download Report

Transcript Digital Decoders

Decoder, Encoders and
Displays
Technician Series
©Paul Godin
Decode
Updated Feb 2015
1.1
Decoders
Decode 1.2
Decoder
 A decoder receives one binary value or state and
converts it to another value or state.
 Some decoders accept an input binary value or number
and enable a single output pin based on that value or
number (such as a “3-to-8 decoder”)
 Some decoders provide a full conversion of the input to
an output (such as a “BCD to a 7-segment display”)
 Basic decoders are comprised of combinational logic.
Decode 1.3
Output Select Decoders
Decode 1.4
Output Select Decoders
 An output selection or output enable decoder:
 input a binary number
 provides one active output from an array of outputs
based on that input number
Single output activated
Binary Number
Decode 1.5
Output Select/Enable Decoders
 An example of a 3-to-8 decoder
Input
Output
C B A
Decimal
Y0 Y 1 Y2 Y3 Y4 Y5 Y6 Y7
0 0 0
0
0
1
1
1
1
1
1
1
0 0 1
1
1
0
1
1
1
1
1
1
0 1 0
2
1
1
0
1
1
1
1
1
0 1 1
3
1
1
1
0
1
1
1
1
1 0 0
4
1
1
1
1
0
1
1
1
1 0 1
5
1
1
1
1
1
0
1
1
1 1 0
6
1
1
1
1
1
1
0
1
1 1 1
7
1
1
1
1
1
1
1
0
The output of this device is active low
Note the input decimal value equals the output label
Decode 1.6
Application of a Decoder
 Device selection (enable)
Enable Device #0
Enable Device #1
Enable Device #2
Device
Address
3 to 8
Decoder
Enable Device #3
Enable Device #4
Enable Device #5
Enable Device #6
Enable Device #7
Decoders have a variety of applications, including enabling specific
devices based on an address. A very common application is to enable
a single device on a shared bus.
Decode 1.7
Decoders: Example
 The 7445 is a BCD to Decimal decoder.
 Input a BCD value
 Activate the output pin that corresponds to the BCD
value
 Added feature is high current capabilities.
 Applications include lamp driver, relay driver, motor
driver, etc...
Device
Address
BCD to
Decimal
Decoder
Enable Lamp #0
Enable Lamp #1
Enable Lamp #2
Enable Lamp #3
Enable Lamp #4
Enable Lamp #5
Enable Lamp #6
Enable Lamp #7
Enable Lamp #8
Enable Lamp #9
Decode 1.8
Encoders
Decode 1.9
Encoders
 An encoder receives an active input on one of its
pins and produces a binary number to identify the
pin label.
 Priority encoders will provide a binary number of
the input pin with the highest binary value.
 Priority is an issue if more than one input is active.
Decode 1.10
Priority Encoder
 Outputs a binary number that corresponds to the label of
the active input pin. If more than one input is active,
indicates the one corresponding to the highest value.
Input active state
Binary Number
Decode 1.11
Example: Application of an Encoder
 I wonder which switch was thrown?
0
0
0
1
0
0
0
0
Y0
Y1
Y2
Y3
Y4
Y5
Y6
Y7
C
B
A
0
1
1
(Switch 3)
Decode 1.12
Example: 2nd Application of an Encoder
 I wonder which switch was thrown?
0
1
0
1
0
1
1
0
Y0
Y1
Y2
Y3
Y4
Y5
Y6
Y7
C
B
A
1
1
0
(Switch 6 has the
highest priority)
Decode 1.13
LEDs and Displays
Decode 1.14
LEDs
 Light Emitting Diodes are common in digital electronics
circuits because:











Require relatively little current
Generate very little heat
Sufficient amount of light for most applications (indicators,
illuminators)
May not require additional support circuitry
Inexpensive
Small in size
Variety of colors
Long life
Rugged and vibration resistance
Variety of shapes and configurations
Actively being improved and developed in industry
Decode 1.15
LED
 LEDs are diodes designed to emit light in the visible or
in the non-visible spectrums.
 The electrical properties of LEDs are:
 Current can flow in one direction only.
 Have a voltage drop not related to resistance (VF).
 They require an external resistor to limit current.
Caution: Some LEDs are bright enough to damage eyesight,
and some get very hot.
Decode 1.16
LED diagrams
Anode (+)
Cathode (-)
Logic Diagram
Flat Side -
Long is +,
like a
battery
symbol
-
+
Decode 1.17
LED Voltage Drops
Typical LED Voltage Drops
Color
Bright Voltage (VF)
Infrared
1.4
Red
1.7
√
Yellow
1.9
2.0
√
3.4
Orange
2.0
Green
2.1
√
Blue
3.4
3.4
√
White
Typical maximum current
is from 20mA to 30mA
3.7
3.6
Decode 1.18
Calculating Series Resistor Values
 Apply basic Ohm’s law to calculate resistor voltage.
 Subtract the VF of the LED from the supply voltage.
Decode 1.19
LED Current and Logic Gates
 Most TTL devices are rated to sink much more current than they
can source.
 Example: 7400:
 IOH (output high current)=0.4mA
 IOL (output low current)=16mA
 Many LEDs require 10mA of current or more to be at their
maximum designed brightness.
 LEDs should therefore be configured to turn on with an output
logic low.
Vcc
Driver circuit
Decode 1.20
LED Testing
LEDs have a higher voltage drop than the 0.3 or 0.7 volts of a
typical diode.
Meters may not produce sufficient voltage to overcome the VF of
the LED.
Use a power supply with a series resistor for a visual check
(except infrared). Use a voltmeter to test for open/short.
Did you know you can use the active display
of a digital camera to see the operation of an
infrared LED? Try your TV remote control
on your web cam!
Decode 1.21
Exercise – In-class
 Given a red LED with a VF of 1.7 volts, a 5 volt
output and a maximum output current of 5mA,
calculate the series resistance value.
 Calculate the current of a series LED circuit where
the LED has a VF of 2.0 V, the resistor is 220Ω and
the output voltage is 5V.
 What does the voltage at point A equal, given a 5
volt output from the gate?
A
Decode 1.22
Decoders – Logic Conversion
Decode 1.23
7-Segment Displays
 Seven Segment displays are a set of LEDs within a
single, specially-configured package.
 The two basic configurations are
 Common Anode (connected to Vcc)
 Common Cathode (connected to ground)
Common
Anode (+)
Common
Cathode (-)
a
b
c
d
e
f
g
dp
a
b
f
e
g
d
c
dp
a
b
c
d
e
f
g
dp
Decode 1.24
Decoders – Logic Conversion
 Some decoders convert from a BCD input to an
output that is compatible with a 7-segment display.
a
BCD
Input (A to D)
BCD to 7
Segment
Decoder
b
f
Resistor
Decoded
Output (a to g)
Pack
e
g
d
c
dp
Decode 1.25
Display Drivers
 Display drivers include the 7447 and the 4518. All
share similar characteristics:
 Input a BCD value (A, B, C and D). The LSB is A.
 Output segments a, b, c, d, e, f and g.
 May have other features such as:
 LT (Lamp Test). If active makes all outputs “on”, to test
the LEDs
 Enable/disable output
 Memory capabilities
Decode 1.26
Display Drivers
 BI/RBO and RBI: Ripple Blanking Input or Output
 Ripple Blanking refers to making displays blank out
(nothing displayed) if their value is zero and they either
precede or follow a non-zero value.
 Example: The value 034.250 would have the first and
the last value 0 blanked, appearing as 34.25
 Dealing with Blanking
 Read the specification sheet for more details
 Leave disconnected if not using ripple blanking
Decode 1.27
BCD to 7-Segment Decoder
Other issues:
 The decoder’s active output (active high or active low) needs to
match the display.
 There must be a resistor to limit current for each segment.
The LEDs in 7-segment displays are especially sensitive to
damage from too much current.
 Many digital device outputs are not capable of driving much
current. Design for active low output if connecting LEDs to
outputs without a driver.
 EWB seems to have trouble with the non-decoded display. Best
to use the decoded display.
Decode 1.28
Questions
 On a 7-segment display, why not use a single resistor at
the common to limit current for all LEDs?
 The following is known as a ½ display. What are some
applications for ½ displays?
b
c
dp
Decode 1.29
LCD Displays








very low power requirement
very compact
low voltage
sharp image (no focus or
distortion problems)
scalable
integrate with digital circuits
display much more data that
discrete LEDs
use standard ASCII codes and
instruction sets
photo PRGodin
 LCDs have significant
advantages over other forms of
displays:
Display salvaged from a VCR
New product
development strives to
improve LCDs
LCD Displays
 Use an ASCII input to produce an output character
 Has an instruction mode input





Move the cursor
Flash the cursor
Set the display parameters (for instance, how many lines)
Clear the display
others…
 Built-in processor takes care of almost everything
 Requires an input edge to read the applied input
Decode 1.31
LCDs
Pin configuration of a standard LCD Display Board (viewed from the top)
1
16
A
K
Pin #
1
2
3
4
5
6
7-14
15-16
Symbol
VSS
VDD
VO
RS
R/W’
E
DB0~DB7
A-K
Function
Ground
5 Volts
Display contrast input
Data (H) or Instruction (L)
Read from (H) or Write to ( L)
Enable (clocking edge)
Data/Instruction Bus
Backlight LED (not used)
Decode 1.32
Example: Input Sequence to LCD
RS
Action
DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
I
Clear the display and home position
0
0
0
0
0
0
0
1
I
Set the display to 2 lines
0
0
1
1
1
1
0
0
I
Set cursor to blink
0
0
0
0
1
1
1
1
D
Enter the character A
0
1
0
0
0
0
0
1
I
Go to the second line
1
1
0
0
0
0
0
0
D
Enter the character x
0
1
1
1
1
0
0
0
Decode 1.33
VFD Displays & Graphic Displays
 Vacuum Fluorescent Displays (VFDs) are commonly used in
electronics where a display is needed that is selfilluminated. Same pinouts as most LCD displays. Caution:
on-board high voltage generator.
 Graphic displays have pixels that need to be individually
addressed through coded values.
7-segment LED displays(top);
VFD matrix display (bottom)
Source: wikipedia
Decode 1.34
END
©Paul R. Godin
prgodin°@ gmail.com
Decode 1.35