Académique Documents
Professionnel Documents
Culture Documents
Decoder
A decoder is a multiple-input, multiple output combinational circuit that converts binary information from n input lines to an 2n unique output lines. Applications:
Microprocessor memory system: selecting different banks of memory. Microprocessor I/O: Selecting different devices (printer) Microprocessor instruction decoding: Enabling different functional units. Memory: Decoding memory addresses (e.g. in ROM).
Sushanta K. Mandal EC402 Digital Electronic Circuits Spring 2011 2
Sushanta K. Mandal
1-2-line Decoder
A 0 D0 1 D1 0 1 D0 1 0
D1
D0 = A D1 = A
Sushanta K. Mandal EC402 Digital Electronic Circuits Spring 2011 4
2-to-4-Line Decoder
D0
A1 A0 D3 D2 D1 D0 0 0 1 1 0 1 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0
Sushanta K. Mandal
2-to-4-Line Decoder
A1
A1 A0 D0
A0 0 1 0 1
D3 0 0 0 1
D2 0 0 1 0
D1 0 1 0 0
D0 1 0 0 0
0 0 1 1
D1
D2
D 0 = A1 A 0 D1 = A1A 0 D 2 = A1 A 0 D 3 = A 1A 0
D3
Sushanta K. Mandal
D0
Sushanta K. Mandal
En A1 A0 D3 D2 D1 D0 0 1 1
D1
X 0 0 1 1
X 0 1 0 1
0 0 0 0 1
0 0 0 1 0
0 0 1 0 0
0 1 0 0 0
1 1
D2
D 0 = En A1 A 0
D3
Sushanta K. Mandal
3-to-8-Line Decoder
Sushanta K. Mandal
10
3-to-8-Line Decoder
Outputs D3 D4 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0
0 0 0 0 1 1 1 1
Binary Inputs 0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
D0 1 0 0 0 0 0 0 0
D1 0 1 0 0 0 0 0 0
D2 0 0 1 0 0 0 0 0
D5 0 0 0 0 0 1 0 0
D6 0 0 0 0 0 0 1 0
D7 0 0 0 0 0 0 0 1
If the input corresponds to minterm mi then the decoder ouputi will be the single asserted output.
Sushanta K. Mandal
11
D4 D5 D6 D7
1 1 1
Sushanta K. Mandal
12
4-to-16-Line Decoder
When w = 0, the top decoder is enabled and the bottom is disabled. Top decoder generates 8 minterms 0000 to 0111, while the bottom decoder outputs are 0s.
When w = 1, the top decoder is disabled and the bottom is enabled. Bottom decoder generates 8 minterms 1000 to 1111, while the top decoder outputs are 0s.
Sushanta K. Mandal EC402 Digital Electronic Circuits Spring 2011 13
Z Y X
A0 3-to-8 A1 A2
F1
-line D2 decoder
F2
Sushanta K. Mandal
15
MSI 74x138
Sushanta K. Mandal
16
MSI 74x138
Sushanta K. Mandal
17
MSI 74x138
Sushanta K. Mandal
18
Sushanta K. Mandal
19
Sushanta K. Mandal
20
Sushanta K. Mandal
21
N3
22
D0
D0 D1 D2 D3
Sushanta K. Mandal
25
M-to-N-Line Encoder
Sushanta K. Mandal
26
4-to-2 Encoder
D1 D0 For A0 00 01 11 10 D3 D2
00 D3 0 0 0 1 D2 0 0 1 0 D1 0 1 0 0 D0 1 0 0 0 A1 0 0 1 1 1 0 1 A0 01 11 10 X 0 X 1 0 X X X X X X X 1 X X X
A0 = D1 + D3 or D2D0
D1 D0 For A1 00 01 11 10 D3 D2
00 01 11 10 X 1 X 1 0 X X X X X X X 0 X X X
A1 = D2 + D3 or D1D0
Sushanta K. Mandal EC402 Digital Electronic Circuits Spring 2011 27
Example 1 of an Encoder
Only point to one single reading at a Sushanta K. Mandal EC402 Digital Electronic Circuits time. Spring 2011
29
Priority Encoder
The encoder defined in the last slide has the limitation that only one input can be active at any given time. If two inputs are active simultaneously, the output produces an undefined combination. Example: if D3 and D6 are 1, the output of the encoder will be 111. z = D1+ D3+ D5+ D7 y = D2+ D3+ D6+ D7 x = D4+ D5+D6+ D7
Sushanta K. Mandal EC402 Digital Electronic Circuits Spring 2011 30
Priority Encoder
This does not represent either binary 3 or binary 6. To resolve this ambiguity, encoder circuit must establish an input priority to ensure that only one input is encoded.
Sushanta K. Mandal
31
Priority Encoder
A priority encoder is an encoder circuit that includes the priority function. The operation of the priority encoder is such that if two or more inputs are equal to 1 at the same time, the input having the highest priority will take precedence.
Sushanta K. Mandal
32
Priority Encoder
Valid bit indicator (V) is set to 1 when one or more inputs are equal to 1. If all inputs are 0, there is no valid inputs and V is equal to 0. Timing analysis
Sushanta K. Mandal EC402 Digital Electronic Circuits Spring 2011 33
Priority Encoder
Sushanta K. Mandal
34
Sushanta K. Mandal
35
Sushanta K. Mandal
36
Design Problem
Design a 4-input priority encoder in which D0 having the highest priority and input D3 the lowest priority.
Sushanta K. Mandal
37
Design Problem
Sushanta K. Mandal
38
Design Problem
Sushanta K. Mandal
39
Multiplexers (Mux)
A multiplexer is a combinational circuit that selects binary information from one of 2 n input lines and directs it to a single line. There are n selection lines.
Sushanta K. Mandal EC402 Digital Electronic Circuits Spring 2011 40
Multiplexers (Mux)
Sushanta K. Mandal
41
A0 A1 A2 A3
0 0
4-to-1 Mux
S1 S0
1 1 0 0 1 1
S1 0 0 1 1
Sushanta K. Mandal
S0 0 1 0 1
F A0 A1 A2 A3
EC402 Digital Electronic Circuits Spring 2011 42
2-to-1 Mux
S0
2-to-1 Mux
S1
I2 I3
0 1
2-to-1 Mux
S0
Sushanta K. Mandal
43
4-to-1-line Mux
F = S1S0A0 + S1S0A1 + S1S0A2 + S1S0A3
S1 S0 A0 F
A1
A2
A3
Sushanta K. Mandal EC402 Digital Electronic Circuits Spring 2011 44
4-to-1 Mux
S1 S0
Functionality: Selection of a particular input Route 1 of N inputs (A) to the output F N log Require 2 Selection bits (S) En(able) bit can disable the route and set F to 0
Sushanta K. Mandal EC402 Digital Electronic Circuits Spring 2011 45
A1
A2
A3 En
Sushanta K. Mandal EC402 Digital Electronic Circuits Spring 2011 46
A[3:0]
En A3-0
B[3:0]
B3-0
F[3:0]
En 0 1 1
SEL X 0 1
Sushanta K. Mandal
47
Sushanta K. Mandal
48
SEL B0 B1 B2 B3 En
Sushanta K. Mandal
49
8-to-1 Mux
S 2 S 1 S0 A B C
Sushanta K. Mandal
50
C C 0 1
Vdd
A0 A1 A2 A3
A
F
B 0 1 0 1
F C C 0 1
51
4-to-1 Mux
S1 A S0 B
0 0 1 1
Sushanta K. Mandal
C 0 1 0 1
F 0 A 1 A
En
0
F
A1 A2 A3
4-to-1 Mux
S1 B S0 C
0 1 1
Sushanta K. Mandal
52
B 0 0 1 1 0 0 1 1
Ci 0 1 0 1 0 1 0 1
S 0 1 1 0 1 0 0 1 Ci Ci Ci Ci Ci Ci Ci Ci
53
0 4-to-1 Mux
S1 A S0 B Sum
0 0 1 1 1 1
Sushanta K. Mandal
B 0 0 1 1 0 0 1 1
Ci 0 1 0 1 0 1 0 1
Co 0 0 0 1 0 1 1 1 0 0 Ci Ci Ci Ci 1 1
54
0 4-to-1 Mux
S1 A S0 B Carry
A1 A2 A3
0 0 0 1 1 1 1
Sushanta K. Mandal
1. Complete the truth table from the SOP. 2. The first n 1 variables in the table are applied to the selection inputs of the multiplexer. 3. For each combination of the selection variables, we evaluate the output as a function of the last variable. 4. Apply these values to the data input in proper order.
Sushanta K. Mandal EC402 Digital Electronic Circuits Spring 2011 55
Sushanta K. Mandal
56
MSI 74x157
Sushanta K. Mandal
57
MSI 74x157
Sushanta K. Mandal
58
MSI 74x157
Sushanta K. Mandal
59
MSI 74x151
Sushanta K. Mandal
60
Demultiplexers (DeMux)
A0 A1 A2 A3
D0
4-to-1 Mux
S1 S0
1-to-4 DeMux D2
S1 S0 D3
D1
Sushanta K. Mandal
61
Demultiplexer Operation
S1 0 0 D0 A 1-to-4 DeMux D2 S1 S0 D3 D1 1 1 S0 0 1 0 1 D3 0 0 0 A D2 0 0 A 0 D1 0 A 0 0 D0 A 0 0 0
D 0 = S1 S0 A D1 = S1S0 A D 2 = S1 S0 A D 3 = S1S0 A
Sushanta K. Mandal
62
Demultiplexer Operation
S1 D0 S0 D1
S1 0 0 1 1
S0 0 1 0 1
D3 0 0 0 A
D2 0 0 A 0
D1 0 A 0 0
D0 A 0 0 0
D2
D 0 = S1 S0 A D1 = S1S0 A D 2 = S1 S0 A D 3 = S1S0 A
D3
A
Sushanta K. Mandal
63
En
Sushanta K. Mandal
A
EC402 Digital Electronic Circuits Spring 2011 64
65
BCD-to-7-Segment Decoder
Another kind of decoder
A B C D
BCD-to-7Segment Decoder
a b c d e f g
a b c d e f g
Sushanta K. Mandal
66
BCD-to-7-Segment Decoder
Another kind of decoder
A B C D
BCD-to-7Segment Decoder
a b c d e f g
a b c d e f g e f
a b
g c
Sushanta K. Mandal
67
BCD-to-7-Segment Decoder
Decode 2 and show
0 0 1 0
A B C D
BCD-to-7Segment Decoder
a b c d e f g
1 1 0 1 1 0 1
a b c d e f g e f
a b
g c
Sushanta K. Mandal
68
BCD-to-7-Segment Decoder
Decode 4 and show
0 1 0 0
A B C D
BCD-to-7Segment Decoder
a b c d e f g
0 1 1 0 0 1 1
a b c d e f g e f
a b
g c
Sushanta K. Mandal
69
BCD-to-7-Segment Decoder
BCD-to-7-segment decoder/driver driving a commonanode 7-segment LED display
Notice the current limiting resistors, required to prevent overdriving the LED display
Sushanta K. Mandal
70
BCD-to-7-Segment Decoder
Common-anode: All the anode connections of the LEDs are joined together to Vcc, LED ON when input signal (Output) is LOW Common-cathode : All the cathode connections of the LEDs are joined together to GND. NO VCC , LED ON when input (Output) is HIGH
Sushanta K. Mandal
71
BCD-to-7-Segment Decoder
TTL and CMOS devices are normally not used to drive the common-cathode display directly because of current (mA) requirement. A buffer circuit is used between the decoder chips and common-cathode display
Sushanta K. Mandal
72
Sushanta K. Mandal
73
AB
CD
00 1 0 0 1
01 0 1 0 1
11 1 1 0 0
10 1 0 0 0
00 01 11 10
a = A BD + ACD + ABD + A BC
Sushanta K. Mandal
AB
CD
00 1 1 0 1
01 1 0 0 1
11 1 1 0 0
10 1 0 0 0
00 01 11 10
b = BC + A B + ACD + ACD
Sushanta K. Mandal