Lecture 21 Encoder, Priority Encoder
Lecture 21 Encoder, Priority Encoder
By Engr. Rimsha
1
Encoders
● An encoder is a digital circuit that performs the
inverse operation of a decoder.
● An encoder has 2n (or fewer) input lines and n
output lines.
● The output lines generate the binary code
corresponding to the input value
2
Truth Table: Octal to Binary Encoder
3
Encoder: Example
● An example of encoder is octal-to-binary encoder
● It has eight inputs (one for each octal digits) and
three outputs that generate the corresponding
binary number
● It is assumed that only one input has a value of 1
at any given time
● The encoder can be implemented with OR gates
whose inputs are determined directly from the
truth table
● Output z is equal to 1 when the input octal digit is
1,3,5 or 7. Output y is 1 for octal digits 2,3,6 or 7
and output x is 1 for digits 4,5,6 or 7. These
conditions can be expressed as by the Boolean
functions as shown in the previous slide
4
Octal to Binary Encoder Implementation
z=D1+D3+D5+D7 y=D2+D3+D6+D7
x=D4+D5+D6+D7
5
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
◦ D3 has the highest priority
◦ D0 has the lowest priority
● Validbit 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. The other two
outputs are not inspected when V equals 0 and
are specified as don’t care conditions
Priority Encoder: Expanded Truth Table
Priority Encoder: Truth Table
Input Output
D0 D 1 D2 D3 x y v
0 0 0 0 X X 0
1 0 0 0 0 0 1
X 1 0 0 0 1 1
X X 1 0 1 0 1
X X X 1 1 1 1
–X: don't-care conditions in the output, used in the
inputs to condense truth table, replaced by both 0 and
then 1
–V: valid output indication, implemented by OR function
Maps for Priority Encoder
Priority Encoder: Logic circuit
Practice Problem
11
End of Lecture
12