Professional Documents
Culture Documents
Decoding
Decoder Examples
Chapter 3 11
Decoder Examples
2-to-4-Line Decoder
Note that the 2-4-line made up of 2 1-to-2-line decoders and 4 AND gates.
1-to-2-Line Decoder
A
D0 D1
A0
D0 5 A
0
1
1
0
0
1
D1 5 A
(a)
(b)
A1 A0
D0 D1 D2 D3
A1
0
0
1
1
0
1
0
1
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
D0
=A 1 A 0
D1
=A 1 A 0
D2
=A 1 A 0
D3
=A 1 A 0
(a)
(b)
Chapter 3 12
Decoder Expansion
Chapter 3 13
3-to-8-line decoder
Number of output ANDs = 8
Number of inputs to decoders driving output ANDs = 3
Closest possible split to equal
2-to-4-line decoder
1-to-2-line decoder
2-to-4-line decoder
Number of output ANDs = 4
Number of inputs to decoders driving output ANDs = 2
Closest possible split to equal
Two 1-to-2-line decoders
4 2-input ANDs
8 2-input ANDs
D0
A0
D1
A1
D2
D3
2-to-4-Line
decoder
D4
D5
A2
D6
1-to-2-Line decoders
D7
Chapter 3 16
Chapter 3 17
Decoders
4-to-16-line decoder
3-to-8-line decoder
4-to-16-line decoder
Application
BCD input
01
00
1 01
Chapter 3 19
BCD-to7-Segment
Decoder
EN A 1 A 0
0
1
1
1
1
X
0
0
1
1
X
0
1
0
1
D 0 D 1 D2 D 3
0
1
0
0
0
(a)
0
0
1
0
0
0
0
0
1
0
D1
0
0
0
0
1
D2
D3
(b)
Chapter 3 21
0
0
1
1
0
1
0
1
Q0 Q1 Q2 Q3
1
0
0
0
0
1
0
0
0
0
1
0
Q0
Q1
Q2
Q3
0
0
0
1
= A B
= A B
= A B
=AB
Approach 1:
Find the truth table for the functions
Make a connection to the corresponding OR from the
corresponding decoder output wherever a 1 appears in
the truth table
Approach 2
Find the minterms for each output function
OR the minterms together
Chapter 3 23
Decoder-based Adder
3-to-8 decoders implement
C(X, Y, Z) = m(3, 5, 6, 7)
and
S(X, Y, Z) = m(1, 2, 4, 7)
0 + 1 + 1 = 10
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
1
1
0
1
1
0
1
0
0
1
C(X,Y,Z) = m(3,5,6,7)
S(X,Y,Z) = m(1,2,4,7)
1 + 1 + 1 = 11
Signal Naming
Be Careful!
S1
S0
Q0
Q1
Q2
Q3
1
1
1
1
0
0
1
1
0
1
0
1
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
(S1 S0)
(S1 S0)
(S1 S0)
(S1 S0)
=
=
=
=
Y1
Y2
Y3
Active-Low Decoders
Q3
Q2
Q1
Q0
Y0
S1 + S0
S1 + S0
S1 + S0
S1 + S0
Y0
Y1
Y2
Y3
0
0
Y0
Y1
Y2
Y3
= (S1 + S0) + G
= (S1 + S0) + G
= (S1 + S0) + G
= (S1 + S0) + G
Summary of Decoders
n
Overview
Encoding
An encoder has 2n (or fewer) input lines and n output lines which
generate the binary code corresponding to the input values
Typically, an encoder converts a code containing exactly one bit
that is 1 to a binary code corresponding to the position in which
the 1 appears.
Chapter 3 36
Binary Encoders
An encoder is a digital function that performs the inverse operation
of a decoder
Chapter 3 37
Octal-to-Binary Encoder
This encoder has eight inputs, one for each of the octal digits.
Three outputs that generate the corresponding binary number.
D7
D6
A2
D5
D4 8 to 3 A1
D3 Encoder
A0
D2
D1
D0
Octal-to-Binary Encoder
Encoding - Example
Octal-to-Binary Encoder
It is assumed that only one input has a value of 1 at any given
time, so that the table has only eight rows with specified output
values.
For the remaining rows, all of the outputs are dont cares.
A0 = D1 + D3 + D5 + D7,
A2 = D4 + D5 + D6 + D7
A1 = D2 + D3 + D6 + D7
Chapter 3 41
Encoder - Example
A decimal-to-BCD encoder
Inputs: 10 bits corresponding to decimal digits 0
through 9 (D0, , D9)
Outputs: 4 bits with BCD codes
Function: If input bit Di is a 1, then the output
(A3, A2, A1, A0) is the BCD code for i,
Chapter 3 42
Chapter 3 43
BCD Output
Decimal input
01
0
00
11
A0
O0
A0
O0
A1
O1
A1
O1
A2
O2
A2
A3
7
5
3
Decimal
to
BCD
Encoder
ENCODER
O2
DECODER
O3
A4
O4
A5
O5
A6
O6
A7
O7
Encoder - Problem
But!
Chapter 3 46
Chapter 3 47
Priority Encoders
This ambiguity is resolved if priority is established so that only one
input is encoded, no matter how many inputs are active at a given point
of time.
The priority encoder includes a priority function.
The operation of the priority encoder is such that if two or more inputs
are active at the same time, the input having the highest priority will
take precedence.
Priority Encoders
Chapter 3 49
Priority Encoder
A priority encoder is a combinational circuit that implements a priority
function
51
53
Priority encoder with 5 inputs (D4, D3, D2, D1, D0) - highest priority to most
significant 1 present - Code outputs A2, A1, A0 and V, where V indicates at
least one 1 present.
Outputs
No. of MinInputs
terms/Row D4 D3 D2 D1 D0 A2 A1 A0
V
1
16
1
X
X
X
X
1
0
0
1
Xs in input part of table represent 0 or 1; thus table entries correspond to
product terms that are not minterms. The column on the left shows that all 32
minterms are present in the product terms in the table
Chapter 3 54
Chapter 3 55
Chapter 3 57
Overview
Multiplexers (MUX)
Chapter 3 58
Multiplexers (MUX)
Multiplexers (MUX)
Chapter 3 60
Multiplexers (MUX)
Chapter 3 63
Multiplexers - Representation
0
MUX
Y
0
1
2
3
Chapter 3 64
Multiplexers - Representation
Chapter 3 65
2-to-1-Line Multiplexer
Since 2 = 21, n = 1
The single selection variable S has two values:
S = 0 selects input I0
S = 1 selects input I1
The equation:
Y = S I0 + SI1
The circuit:
Enabling
Circuits
Decoder
I0
Y
S
I1
Chapter 3 66
Chapter 3 67
4 to 1 Multiplexer
Function Table
1-to-2-line Decoder
2 Enabling circuits
2-input OR gate
Select Inputs
S1
S0
0
0
0
1
1
0
1
1
Output
Z
I0
I1
I2
I3
Z = S1 S 0 I 0 + S1S 0 I1 + S1 S 0 I 2 + S1S 0 I 3
Chapter 3 68
Chapter 3 69
10
4 to 1 Multiplexer (Internal)
S1
4 3 2 AND-OR
S0
S1
S0
Decoder
I0
I1
Y
I2
I3
70
Chapter 3 71
I 0,0
Y0
.
.
.
4 3 2 AND-OR
I 3,0
A0
2-to-4-Line decoder
A1
D0
I 0,1
.
.
.
D3
.
.
.
Y1
4 3 2 AND-OR
I 3,1
I 0,2
Y2
.
.
.
4 3 2 AND-OR
I 3,2
I 0,3
.
.
.
Y3
I 3,3
73
Chapter 3 72
Expanding Multiplexers
11
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
1
0
0
0
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
1
1
Z S
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
1
1
0
1
0
0
1
0
0
0
1
0
1
0
0
1
1
0
1
1
0
1
1
0
0
0
1
0
0
1
1
1
1
0
1
1
1
Multiplexer-based carry
We can set the multiplexer data inputs D0-D3, by fixing X and Y
and finding equations for C in terms of just Z.
X
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
0
1
0
1
1
1
C = X Y D0 + X Y D1 + X Y D2 + X Y D3
= X Y 0 + X Y Z + X Y Z + X Y 1
= X Y Z + X Y Z + XY
= m(3,5,6,7)
Heres the same thing, but for the sum function S(X,Y,Z)
0
0
0
0
1
1
1
1
Multiplexer-based Sum
X
x
0
0
0
0
0
0
1
1
1
1
Summary of Muxes
A n-to-1 multiplexer routes one of n input lines to a single output
line
Just like decoders,
Muxes are common enough to be supplied as stand-alone devices for
use in modular designs.
Muxes can implement arbitrary functions
S = X Y D0 + X Y D1+ X Y D2 + X Y D3
= X Y Z + X Y Z + X Y Z + X Y Z
= m(1,2,4,7)
12
Three-state Buffers
Different flavors:
Sharing a Wire
Driver Application
Three-State Transcievers
13
Transciever Application
14