3 to 8 Decoder Using Two 2 to 8 Decoder
Short Description
g...
Description
Decoders and Encoders
Lesson Objectives In this lesson, we will learn about Decoders o Expansion of decoders o Combinational circuit implementation with decoders o Some examples of decoders o Encoders o o o o
Major limitations of encoders riorit! encoders Some examples of ecnoders
Decoders "s its name indicates, a decoder is a circuit component that decodes an input code# $iven n a binar! code of n%bits, a decoder will tell which code is this out of the & possible codes 'See (i)ure *'a++#
0 1
n%to%2n
n Inputs
Decoder
2n-1
( i)ure *'a+ " t!pical decoder n
n
-hus, a decoder has n% inputs and & outputs# Each of the & outputs corresponds to one n of the possible & input combinations#
n Inputs
Enable
n%to%2n Decoder
2 n Outputs
(i)ure *'b+ " t!pical decoder
(i)ure *'b+ shows the bloc. dia)ram o f a t!pical decoder, which has n input lines, and m n output lines, where m is e/ual to & # -he decoder is called n%to% m decoder# "part from this, there is also a sin)le line connected to the decoder call ed enable line# -he operations of the enable line will be discussed in the flowin) text#
o
In )eneral, output i e/uals * if and onl! if the input binar! code has a value of
i# o
o
-hus, each output line e/uals * at onl! one input combination but is e/ual to 0 at all other combinations# In other words, each decoder output corresponds to a minterm of the n input variables# n
o
-hus, the decoder )enerates all of the & minterms of n input variables#
Example: 2-to-4 decoders Let us discuss the operation and combinational circuit desi)n of a decoder b! ta.in) the specific example of a &%to%1 decoder# It contains two inputs denoted b! "* and " 0 and four outputs denoted b! D0 , D* , D& , and D2 as shown in fi)ure "lso note that "* is the MS3 while "0 is the LS3#
D0 4 "*"0 D* 4 "*"0
"0
&%to%1 Decoder
"*
D&4 "*"0
D2 4 "*"0 (i)ure & " &% to %1 decoder without enable Decima# l 0 1 2 3
Input A1 A0 0 0 01 1 0 1 1
D0 1 0 0 0
Output D1 D2 0 0 1 0 0 1 0 0
D3 0 0 0 1
-able * -ruth table for &%to %1decoder "s we see in the truth table 'table *+, for each input combination, one output line is activa ted, that is, the output line correspondin) to the input combination becomes *, while other lines remain inactive# (or example, an input of 00 at the input will activate line D0 # 0* at the input will activate line D * , and so on #
o
o
5otice that, each output of the decoder is actuall! a minterm resultin) from a certain combination of the inputs, that is D0 4"* "0 , ' minterm m0 + which corresponds to input o 00 o D* 4"* "0 , ' minterm m* + which corresponds to input 0* o D& 4"* "0 , ' minterm m& + which corresponds to input *0 o D2 4"* "0 , ' minterm m2 + which corresponds to input ** -his is depicted in (i)ures & where we see that each input combination will inov.e the correspondin) output, where each output is minterm correspondin) to the input combination# A
1
A
0
D0 4 " * " 0 D* 4 " * " 0 D& 4 " * " 0 D2 4 " * " 0 (i)ure 2 Implementation &%to %1decoder -he circuit is implemented with "5D )ates, as shown in fi)ure 2# In this circuit we see 6 6 6 that the lo)ic e/uation for D 0 is "* "0 # D0 is "* "0 , and so on# -hese are in fact the minterms bein) implemented# -hus, each output of the decoder )enerates a minterm correspondin) to the input combination#
The ena!le" input in decoders $enerall!, decoders have the 7enable8 input #-he enable input perroms no lo)ical operation, but is onl! responsible for ma.in) the decoder "C-I9E or I5"C-I9E# o If the enable 7E8 is :ero, then all outputs are :ero re)ardless of the input values# o is one, then the decoder performs its normal operation# o (or example, consider the &%to%1 decoder with the enable input '(i)ure 1+# -he enable input is onl! responsible for ma.in) the decoder active or inactive# If Enable E is :ero, then all outputs of the decoder will be :eros, re)ardless of the values of " * and "0 # ;owever, if E is *, then the decoder will perform its normal operation, as is shown in the
truth table 'table &+# In this table we see that as lon) as E is :ero, the outputs D0 to D2 will remain :ero, no matter whatever value !ou provide at the inputs " * "0 , depicted b! two don# "0 is the least si)nificant variable, while "& is the most si)nificant variable# -he three inputs are decoded into ei)ht outputs# -hat is, binar! values at the input form a combination, and based on this combination, the correspondin) output line is activated#
D0 4 " "0
2%to%A
"*
Decoder
"&
&
" " *
0
D * 4 " &"*"0 D & 4 " &"*"0 D 4""" 2
&
*
0
D1 4 "&"*"0 D> 4 "&"* "0 D? 4 " " " & * 0 D@ 4 "&"*"0
Enable
(i)ure > " 2% to %A decoder with enable Each output represents one minterm # o (or example, for input combination " & "* "0 4 00*, output line D* e/uals * while all other output lines e/ual 0 E@ Li.ewise, "* 4 E& E2 E? E@ , and similarl! o " & 4 E1 E> E? E @ o -hus, the encoder can be implemented usin) three 1% input OB )ates#
5a6or 7imitation o/ Encoders o o
o
Exactl! one input must inputs be active at an! )iven If the number of active is less than one time# or more than one, the output will be incorrect# (or example, if E2 4 E? 4 *, the output of the encoder " & "* "0 4 ***, which implies incorrect output#
T,o 8ro!lems to 9esol e & *# If two or more inputs are active at the same time, what should the output be? "n output of all 0Js is )enerated in & cases when all inputs are 0 o when E0 is e/ual to *# o
How can this ambiguity be resolved? Solution To Problem :1 o
o
o
Kse a Priority Encoder which produces the output correspondin) to the input with hi)her are priorit!# Inputs assi)ned priorities accordin) to their subscript value e#)# hi)her subscript inputs are assi)ned hi)her priorit!# In the previous example, if E2 4 E? 4 *, the output correspondin) to E ? will be produced '"& "* "0 4 **0+ since E? has hi)her priorit! than E2 #
Solution To Problem :2 o o
rovide one more output si)nal V to indicate validity of input data# V 4 0 if none of the inputs e/uals *, otherwise it is *
Example: 4-to-2 8riorit Encoders o o o
Sixteen input combinations -hree output variables "*, "0, and 9 9 is needed to ta.e care of situation when all inputs are e/ual to :ero# Outputs Inputs
E3 E2 0 00 0001001 0010011 0011011 0100101 0101101 0110101 0111101 1000111 1001111 1010111 1011111
E1
E0 0$
A1
A0 $0
Invalid Input
1100111 1101111 1110111 1111111
-able A -ruth table of 1%to %& riorit! Encoder In the truth table 'table A+, we have sixteen input combinations# In the output, we have three variables# -he variable 9 is needed to ta.e care of the situation where all inputs are :ero# In that case 9 is .ept at :ero, re)ardless of the values of " * and " 0 # -his combination is hi)hli)hted )reen# In all other cases, 9 is .ept at *, because at least one of the inputs is one# =hen E0 is *, the output combination of " * and " 0 is 00# -his combination is hi)hli)hted blue# -hen we have two combinations hi)hli)hted !ellow# In both these combinations, "* and "0 are 0*# -his is because in both these combinations E* is *, re)ardless of the value of E0 , and since E* has hi)her subscript, the correspondin) output value is 0*# -his is followed b! four input combinations in pin. # In these four combinations, the output " * "0 is *0, since E & is * in all these combinations, and E & has the hi)hest
precedence compared to E0 and E* # "lthou)h E0 and E * are also havin) a value of one in this set of four combinations, but the! do not have the priorit!# (inall! we have the last ei)ht input combinations, whose output is **# -his is because E2 is the hi)hest priorit! input, and it is e/ual to *# -hou)h the other inputs with smaller subscripts, namel!, E&, E*, and E0 are also havin) values of one in some combinations, but the! do not have the priorit!# -he truth table can be rewritten in a more compact form usin) don
View more...
Comments