The document describes decoders and encoders. It begins by explaining what a decoder is, providing examples of 2-to-4 and 3-to-8 decoders. It then discusses how decoders can be used to implement general logic and combinational circuits using decoders and OR gates. The document proceeds to describe specific decoder chips like the 74x139 and 74x138 decoders. It also discusses using 3-state buffers with decoders and building decoders from smaller decoders. The document then shifts to discussing encoders, 7-segment decoders, truth tables, and K-maps in the design of decoders and encoders. It concludes by discussing priority encoders and the 74x148 priority encoder chip.
4. 4
Design Using Decoder
• Applications:
Implementing General Logic
Any combinational circuit can be constructed using decoders
and OR gates!
F1 = A' B C' D + A' B' C D + A B C D
F2 = A B C' D' + A B C
F3 = (A' + B' + C' + D')
• Example: A‘B’C’D’
A‘B’C’D
A‘B’CD’
A‘B’CD
A‘BC’D’
A‘BC’D
A‘BCD’
A‘ BCD
AB’C’D’
AB’C’D
AB’CD’
AB’CD
AB C’D’
AB C’D
AB C D’
AB C D
F1
F3
F2
A
B
C
D
S2
S1
S0
S3
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
4:16
dec
Enb
5. 5
Active Low
• Decoder with
Active Low Enable
Active Low Outputs
G A B Y0 Y1 Y2 Y3
1 X X 1 1 1 1
0 0 0 0 1 1 1
0 0 1 1 0 1 1
0 1 0 1 1 0 1
0 1 1 1 1 1 0
9. 9
Using 3-State Buffers
Can use 3-state buffers to share a single line for
several devices.
Decoder guarantees
that no two buffers are
on simultaneously.
Some decoders have
hi-Z outputs.
10. 10
Decoders
Can build a decoder by smaller decoders
A
B
C
D
S2
S1
S0
S3
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
4:16
dec
Enb
3:8
dec
O0
O1
O2
B
C
D
Enb
S2
S1
S0
O3
O4
O5
O6
O7
3:8
dec
O0
O1
O2
B
C
D
Enb
S2
S1
S0
O3
O4
O5
O6
O7
A
B
C
D
13. 13
7-Segment Decoder
• Seven-segment display:
7 LEDs (light emitting diodes), each one
controlled by an input
1 means “on”, 0 means “off”
Display digit “3”?
Set a, b, c, d, g to 1
Set e, f to 0
d
a
b
ce
f
g
15. 15
7-Segment Decoder
• 7-Segment Decoder:
Input is a 4-bit BCD code 4 inputs (A, B, C,
D).
Output is a 7-bit code (a,b,c,d,e,f,g) that
allows for the decimal equivalent to be
displayed.
• Example:
Input: 0000BCD
Output: 1111110
(a=b=c=d=e=f=1, g=0)
d
a
b
ce
f g
17. 17
K-maps
a = A + B D + C + B' D'
b = A + C' D' + C D + B'
c = A + B + C' + D
d = B' D' + C D' + B C' D + B' C
e = B' D' + C D
f = A + C' D' + B D' + B C'
g = A + C D' + B C' + B' C
AB
CD 00 01 11 10
00
01
11
10
D
B
C
A
1 0 X 1
0 1 X 1
1 1 X X
1 1 X X
K-map for a
AB
CD 00 01 11 10
00
01
11
10
D
B
C
A
1 1 X 1
1 0 X 1
1 1 X X
1 0 X X
K-map for b
AB
CD 00 01 11 10
00
01
11
10
D
B
C
A
1 1 X 1
1 1 X 1
1 1 X X
0 1 X X
K-map for c
AB
CD 00 01 11 10
00
01
11
10
D
B
C
A
1 0 X 1
0 1 X 0
1 0 X X
1 1 X X
K-map for d
AB
CD 00 01 11 10
00
01
11
10
D
B
C
A
1 0 X 1
0 0 X 0
0 0 X X
1 1 X X
K-map for e
AB
CD 00 01 11 10
00
01
11
10
D
B
C
A
1 1 X 1
0 1 X 1
0 0 X X
0 1 X X
K-map for f
AB
CD 00 01 11 10
00
01
11
10
D
B
C
A
0 1 X 1
0 1 X 1
1 0 X X
1 1 X X
K-map for g
19. 19
Encoder
• Encoder:
the inverse operation of a decoder.
Has 2n
input lines and n output lines.
The output lines generate the binary
equivalent of the input line whose value is 1.
I0
I1
I2
I3
z1
z2
4-2
Binary
Encoder
24. 24
Encoder Design Issues
Only one input can be active at any
given time.
If two inputs are active simultaneously,
the output produces an undefined
combination
(for example, if D3 and D6 are 1 simultaneously, the
output of the encoder will be 111.
A0 = D1 + D3 + D5 + D7
A1 = D2 + D3 + D6 + D7
A2 = D4 + D5 + D6 + D7
29. 29
74x148
• Features:
inputs and outputs are active low.
EI_L must be asserted for any of its outputs to
be asserted.
GS_L is asserted when the device is enabled
and one or more of the request inputs is
asserted. (“Group Select” or “Got Something.” )
EO_L is an enable output designed to be
connected to the EI_L input of another ’148 that
handles lower-priority requests.
It is asserted if EI_L is asserted but no request
input is asserted; thus, a lower-priority ’148 may
be enabled.