Decoder
• Is a combinational circuit that converts binary information
from n input lines to a maximum of 2n unique output lines
For example if the number of input is n=3 the number of
output lines can be m=23 . It is also known as 1 of 8
because one output line is selected out of 8 available
lines:
3 to 8
decoder
enable
Decoder with Enable Line
• Decoders usually have an enable line,
• If enable=0 , decoder is off. It means all
output lines are zero
• If enable=1, decoder is on and depending
on input, the corresponding output line is
1, all other lines are 0
• See the truth table in next slide
Truth table for decoder
E a2 a1 a0 D7 D6 D5 D4 D3 D2 D1 D0
-----------------------------------------------------------
0 x x x 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 1
1 0 0 1 0 0 0 0 0 0 1 0
1
1 ……………………………………….
1 ……………………………………..
1
1
1 1 1 1 1 0 0 0 0 0 0 0
Major application of Decoder
• Decoder is use to implement any combinational cicuits ( fn )
For example the truth table for full adder is s (x,y,z) = ∑ ( 1,2,4,7)
and C(x,y,z)= ∑ (3,5,6,7). The implementation with decoder is:
Encoder
• Encoder is a digital circuit that performs the
inverse operation of a decoder
• Generates a unique binary code from several
input lines.
• Generally encoders produce2-bit, 3-bit or 4-bit
code. n bit encoder has 2n input lines
2 bit encoder
2-bit encoder
• If one of the four input lines is active
encoder produces the binary code
corresponding to that line
• If more than one of the input lines will be
activated or all the output is undefined. We
can consider don’t care for these
situations but in general we can solve this
problem by using priority encoder.
2-bit Priority Encoder
• A priority encoder is an encoder circuit that
includes priority function.
• It means if two or more inputs are equal to 1 at
the same time, the input having higher subscript
number, considered as a higher priority. For
example if D3 is 1 regardless of the value of the
other input lines the result of output is 3 which is
11.
• If all inputs are 0, there is no valid input. For
detecting this situation we considered a third
output named V. V is equal to 0 when all input
are 0 and is one for rest of the situations of TT.
2-bit Priority Encoder
• By using TT and K-map we get following
boolean functions for 4-input (or 2-bit)
priority encoder:
• X = D2 + D3
• Y = D3 + D1D’2
• V= D0 + D1 + D2 + D3
See next two slides for K-maps and the logic
circuit of 2-bit priority encoder