You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Digital Electronics<br />
Electronics Technology<br />
Encoding, Decoding, and<br />
Seven-Segment Displays
ENCODER<br />
•ENCODER- a digital circuit that produces a<br />
binary output code depending on which of its<br />
inputs are activated.<br />
•There are ONLY ONE INPUT can be active at<br />
any given time (two or more simultaneously<br />
active inputs would produce an undefined<br />
output combination)
Block Diagram<br />
BINARY CODE<br />
OUTPUT<br />
ONLY ONE INPUT<br />
ACTIVATED AT A<br />
TIME<br />
Truth Table<br />
(Active HIGH)
8 to 3 line encoder circuit diagram<br />
D 7<br />
D 6<br />
D 5<br />
D 4<br />
D 3<br />
D 2<br />
D 1<br />
D 0<br />
x<br />
D 4<br />
+D 5<br />
+D 6<br />
+D 7<br />
y<br />
D 2<br />
+D 3<br />
+D 6<br />
+D 7<br />
z<br />
D 1<br />
+D 3<br />
+D 5<br />
+D 7
Ā 0<br />
Ā 1<br />
10 to 4 line<br />
ENCODER<br />
Ō 0<br />
Ō 1<br />
Ō 2<br />
Ō 3<br />
10 line to 4 line<br />
Encoder<br />
Ā 9<br />
Ā 9<br />
Ā 8<br />
Ā 7<br />
Ā 6<br />
Ā 5<br />
Ā 4<br />
Ā 3<br />
Ā 2<br />
Ā 1<br />
Ā 0<br />
Ō 3<br />
Ō 2<br />
Ō 1<br />
Ō 0<br />
1 1 1 1 1 1 1 1 1 0 0 0 0 0<br />
1 1 1 1 1 1 1 1 0 1 0 0 0 1<br />
1 1 1 1 1 1 1 0 1 1 0 0 1 0<br />
1 1 1 1 1 1 0 1 1 1 0 0 1 1<br />
1 1 1 1 1 0 1 1 1 1 0 1 0 0<br />
1 1 1 1 0 1 1 1 1 1 0 1 0 1<br />
1 1 1 0 1 1 1 1 1 1 0 1 1 0<br />
1 1 0 1 1 1 1 1 1 1 0 1 1 1<br />
1 0 1 1 1 1 1 1 1 1 1 0 0 0<br />
0 1 1 1 1 1 1 1 1 1 1 0 0 1<br />
* An ACTIVE LOW ENCODER
10 line to 4 line Encoder<br />
DECIMAL<br />
BINARY (BCD)<br />
8<br />
4<br />
2<br />
1<br />
ENCODER<br />
9 5V<br />
8 5V<br />
7 5V<br />
6 5V<br />
5 5V<br />
4 5V<br />
3 5V<br />
2 5V<br />
1 5V<br />
I9<br />
I8<br />
I7<br />
I6<br />
I5<br />
I4<br />
I3<br />
I2<br />
I1<br />
74147<br />
A3<br />
A2<br />
A1<br />
A0
THE 8421 BCD CODE<br />
• BCD stands for Binary-Coded Decimal.<br />
• A BCD number is a four-bit binary group that<br />
represents one of the ten decimal digits 0<br />
through 9.<br />
Example:<br />
Decimal number 4926 4 9 2 6<br />
8421 BCD coded number 0100 1001 0010 0110
ELECTRONIC ENCODER -<br />
DECIMAL TO BCD<br />
Decimal input<br />
7<br />
5<br />
3<br />
0<br />
Decimal<br />
to<br />
BCD<br />
Encoder<br />
BCD output<br />
0 10 0 1 0<br />
1<br />
• Encoders are available in IC form.<br />
• This encoder translates from decimal<br />
input to BCD output.
DECODER<br />
DECODER- a digital circuit that converts an<br />
input binary code into a single numeric<br />
output.<br />
n input<br />
2 n output<br />
ONLY ONE OUTPUT<br />
ACTIVATED AT A<br />
TIME
Example of 2 to 4 encoder<br />
input<br />
Logic<br />
diagram 2 to<br />
4 encoder<br />
output<br />
Truth Table
3 to 8 encoder<br />
A 0<br />
O 0<br />
A 1<br />
O 1<br />
A 2<br />
DECODER<br />
3 to 8 line<br />
Decoder<br />
O 2<br />
O 3<br />
O 4<br />
O 5<br />
BINARY CODE INPUT<br />
ONLY ONE OUTPUT<br />
ACTIVATED AT A TIME<br />
O 6<br />
O 7<br />
Block Diagram
4 line to 10 line Decoder<br />
DECIMAL<br />
9<br />
BINARY (BCD)<br />
8 0V<br />
4 0V<br />
2 0V<br />
1 0V<br />
DECODER<br />
74LS42<br />
A3<br />
A2<br />
A1<br />
A0<br />
9<br />
8<br />
7<br />
6<br />
5<br />
4<br />
3<br />
2<br />
1<br />
0<br />
8<br />
7<br />
6<br />
5<br />
4<br />
3<br />
2<br />
1<br />
0
Ā 0<br />
Ā 1<br />
Ā 2<br />
Ā 3<br />
10 to 4 line<br />
ENCODER<br />
Ō 0<br />
Ō 1<br />
Ō 2<br />
Ō 3<br />
4 line to 10<br />
line Decoder<br />
(Active LOW)<br />
Ō 9<br />
Ā 3<br />
Ā 2<br />
Ā 1<br />
Ā 0<br />
Ō 9<br />
Ō 8<br />
Ō 7<br />
Ō 6<br />
Ō 5<br />
Ō 4<br />
Ō 3<br />
Ō 2<br />
Ō 1<br />
Ō 0<br />
Truth<br />
Table<br />
0 0 0 0 1 1 1 1 1 1 1 1 1 0<br />
0 0 0 1 1 1 1 1 1 1 1 1 0 1<br />
0 0 1 0 1 1 1 1 1 1 1 0 1 1<br />
0 0 1 1 1 1 1 1 1 1 0 1 1 1<br />
0 1 0 0 1 1 1 1 1 0 1 1 1 1<br />
0 1 0 1 1 1 1 1 0 1 1 1 1 1<br />
0 1 1 0 1 1 1 0 1 1 1 1 1 1<br />
0 1 1 1 1 1 0 1 1 1 1 1 1 1<br />
1 0 0 0 1 0 1 1 1 1 1 1 1 1<br />
1 0 0 1 0 1 1 1 1 1 1 1 1 1
DECODERS: BCD TO<br />
7-SEGMENT DECODER/DRIVER<br />
BCD input<br />
0 01 10 10<br />
BCD-to-<br />
7-Segment<br />
Decoder/<br />
Driver<br />
Decimal output<br />
LED<br />
• Electronic decoders are available in IC form.<br />
• This decoder translates from BCD to decimal.<br />
• Decimals are shown on an 7-segment LED display.<br />
• This IC also drives the 7-segment LED display.
TEST<br />
Q #1- #2- #3- #4- #5- What is the decimal output from the decoder that<br />
appears on the 7-segment display?<br />
Answer: 30<br />
97<br />
6<br />
BCD input<br />
10 0 01 01 1<br />
0<br />
Decimal output<br />
BCD-to-<br />
7-Segment<br />
Decoder/<br />
Driver<br />
?
BCD-TO-SEVEN SEGMENT DECODER DRIVER<br />
V+<br />
5V<br />
74LS47<br />
A3<br />
A2<br />
A1<br />
A0<br />
test<br />
RBI<br />
g<br />
f<br />
e<br />
d<br />
c<br />
b<br />
a<br />
RBO<br />
abcdef g .
TEST<br />
A 0<br />
A 1<br />
A 2<br />
A 3<br />
A 4<br />
ENCODER<br />
O 0<br />
O 1<br />
O 2<br />
O 3<br />
A 5<br />
A 6<br />
A 7<br />
A 8<br />
A 9
TEST<br />
A 0<br />
O 0<br />
A 1<br />
O 1<br />
A 2<br />
A 3<br />
DECODER<br />
O 2<br />
O 3<br />
O 4<br />
O 5<br />
O 6<br />
O 7<br />
O 8<br />
O 9
Question<br />
• IC 74138 is a 3 to 8 decoder. The input is given by a<br />
pin number A, B and C. State the binary code needed<br />
to activate the output device Y 0, Y1, Y5, Y6 and Y7.<br />
A B C Output<br />
Y0 -Dot Matrix<br />
Y2-Laser<br />
Y5-Desk Jet<br />
Y6-Plotter<br />
Y7-Serial<br />
Port
Multiplexer /<br />
Demultiplexer<br />
Digital Electronics
What is a Multiplexer (MUX)?<br />
• A MUX is a digital switch that<br />
has multiple inputs (sources)<br />
and a single output<br />
(destination).<br />
• The select lines determine<br />
which input is connected to the<br />
output.<br />
• MUX Types<br />
2-to-1 (1 select line)<br />
4-to-1 (2 select lines)<br />
8-to-1 (3 select lines)<br />
16-to-1 (4 select lines)<br />
Inputs<br />
(sources)<br />
Multiplexer<br />
Block Diagram<br />
2 N<br />
MUX<br />
N<br />
Select<br />
Lines<br />
1<br />
Output<br />
(destination)<br />
23
Typical Application of a MUX<br />
Multiple<br />
Sources<br />
Selector<br />
Single<br />
Destination<br />
MP3 Player<br />
Docking Station<br />
Laptop<br />
Sound Card<br />
D0<br />
D1<br />
D2<br />
D3<br />
MU<br />
X<br />
Y<br />
Surround Sound System<br />
Digital<br />
Satellite<br />
Digital<br />
Cable TV<br />
B A Selected Source<br />
0 0 MP3<br />
0 1 Laptop<br />
1 0 Satellite<br />
1 1 Cable TV<br />
24
4-to-1 Multiplexer (MUX)<br />
D0<br />
D1<br />
D2<br />
D3<br />
MUX<br />
Y<br />
B A Y<br />
0 0 D0<br />
0 1 D1<br />
1 0 D2<br />
1 1 D3<br />
B A<br />
25
4-to-1 Multiplexer Waveforms<br />
D0<br />
D1<br />
D2<br />
Input<br />
Data<br />
D3<br />
A<br />
B<br />
Y<br />
D0 D1 D2 D3 D0 D1 D2 D3<br />
Select<br />
Line<br />
Output<br />
Data<br />
26
Medium Scale Integration MUX<br />
4-to-1 MUX<br />
8-to-1 MUX<br />
16-to-1 MUX<br />
Inputs<br />
Output (Y)<br />
(and inverted<br />
output)<br />
Select<br />
Enable<br />
27
What is a Demultiplexer (DEMUX)?<br />
• A DEMUX is a digital switch with<br />
a single input (source) and a<br />
multiple outputs (destinations).<br />
• As an electronics switch (data<br />
distributer) to route an incoming<br />
data signal to one of the several.<br />
• The select lines determine which<br />
output the input is connected to.<br />
• DEMUX Types<br />
1-to-2 (1 select line)<br />
1-to-4 (2 select lines)<br />
1-to-8 (3 select lines)<br />
1-to-16 (4 select lines)<br />
Input<br />
(source)<br />
Demultiplexer<br />
Block Diagram<br />
1<br />
N<br />
DEMUX<br />
Select<br />
Lines<br />
2 N<br />
Outputs<br />
(destinations)<br />
28
Typical Application of a DEMUX<br />
Single Source<br />
Selector<br />
Multiple<br />
Destinations<br />
B/W Laser<br />
Printer<br />
X<br />
DEMUX<br />
D0<br />
D1<br />
D2<br />
D3<br />
Fax<br />
Machine<br />
Color Inkjet<br />
Printer<br />
B A Selected Destination<br />
0 0 B/W Laser Printer<br />
0 1 Fax Machine<br />
1 0 Color Inkjet Printer<br />
1 1 Pen Plotter<br />
Pen<br />
Plotter<br />
29
1-to-4 De-Multiplexer (DEMUX)<br />
X<br />
DEMUX<br />
D0<br />
D1<br />
D2<br />
D3<br />
B A<br />
B A D0 D1 D2 D3<br />
0 0 X 0 0 0<br />
0 1 0 X 0 0<br />
1 0 0 0 X 0<br />
1 1 0 0 0 X<br />
30
1-to-4 De-Multiplexer Waveforms<br />
X<br />
S0<br />
S1<br />
Input<br />
Data<br />
Select<br />
Line<br />
D0<br />
D1<br />
D2<br />
Output<br />
Data<br />
D3<br />
31
Medium Scale Integration DEMUX<br />
1-to-4 DEMUX<br />
1-to-8 DEMUX<br />
1-to-16 DEMUX<br />
Select<br />
Input<br />
(inverted)<br />
Outputs<br />
(inverted)<br />
Note : Most Medium Scale Integrated (MSI)<br />
DEMUXs , like the three shown, have outputs that<br />
are inverted. This is done because it requires few<br />
logic gates to implement DEMUXs with inverted<br />
outputs rather than no-inverted outputs.<br />
32
Seeing Is NOT Always Believing<br />
• Our lives are filled with electronic<br />
signs that display the time,<br />
temperature, or ball game score.<br />
However, what we see is not<br />
always what is really happening.<br />
• In fact for most displays, the<br />
individual display segments are<br />
cycled through so that only one<br />
display is on at any given time.<br />
brgprecision.com<br />
• The cycle speed is so fast that the<br />
human eye perceives that all<br />
segments are on.<br />
33
Simple Message: All Segments On<br />
• The circuit to the right uses<br />
four 7-segment displays to<br />
display the word CIAO. In<br />
this circuit all displays are<br />
continuously illuminated,<br />
each displaying one letter in<br />
the word.<br />
• Though this method works, it<br />
is a VERY inefficient use of<br />
power. To illuminate the<br />
simple message CIAO in this<br />
way, 18 segments must be<br />
continuously on.<br />
• Can you think of another way<br />
to display this message that<br />
would use less power?<br />
would use less power?<br />
34 34
TEST<br />
ANSWER THE FOLLOWING QUESTIONS WITH ONE OR MORE<br />
OF THESE WORDS: MUX, DEMUX, ENCODER, DECODER.<br />
A. Has more inputs than outputs.<br />
B. Uses select inputs.<br />
C. Can be used in parallel-to-serial conversion.<br />
D. Produces a binary code at its output.<br />
E. Only one of its outputs is activated at one time.<br />
F. Used to route input signals to one of several outputs.<br />
G. Used to generate arbitrary logic functions.<br />
H. 3 line-to-8 line or binary to octal.<br />
I. Data Selectors are also
TEST (ANSWER)<br />
ANSWER THE FOLLOWING QUESTIONS WITH ONE OR MORE<br />
OF THESE WORDS: MUX, DEMUX, ENCODER, DECODER.<br />
A. Has more inputs than outputs. ENCODER, MUX<br />
B. Uses select inputs. MUX, DEMUX<br />
C. Can be used in parallel-to-serial conversion. MUX<br />
D. Produces a binary code at its output. ENCODER<br />
E. Only one of its outputs is activated at one time. DEMUX, DECODER<br />
F. Used to route input signals to one of several outputs. MUX<br />
G. Used to generate arbitrary logic functions. MUX, DEMUX<br />
H. 3 line-to-8 line or binary to octal. DECODER<br />
I. Data Selectors are also MUX.