Priority encoder: Difference between revisions

Content deleted Content added
No edit summary
captions
Line 3:
If two or more inputs are given at the same time, the input having the highest priority will take [[:wikt:precedence|precedence]].<ref>M. Morris Mano, Michael D. Ciletti, "Digital Design", 4th Edition, Prentice Hall, 2006, ISBN 978-0-13-198924-5.</ref> An example of a single bit 4 to 2 [[encoder]] is shown, where highest-priority inputs are to the left and "x" indicates an irrelevant value - i.e. any input value there yields the same output since it is superseded by higher-priority input. The output V indicates if the input is valid.
 
{| class="wikitable" style="margin:0;"
{{caption|+ 4 to 2 Priority Encoder}}
!style="border-bottom:2px solid #000;"|I<sub>3</sub>
!style="border-bottom:2px solid #000;"|I<sub>2</sub>
Line 22 ⟶ 23:
| 1 || x || x || x ||style="border-left:2px solid #000;"| 1 || 1 || 1
|}
{{caption|4 to 2 Priority Encoder}}
 
Priority encoders can be easily connected in arrays to make larger encoders, such as one 16-to-4 encoder made from six 4-to-2 priority encoders - four 4-to-2 encoders having the signal source connected to their inputs, and the two remaining encoders take the output of the first four as input.The priority encoder is an improvement on a simple encoder circuit, in terms of handling all possible input [[Computer configuration|configurations]].
Line 31:
For example, a 4-to-2 simple encoder takes 4 input bits and produces 2 output bits. The illustrated gate level example implements the simple encoder defined by the truth table, but it must be understood that for all the non-explicitly defined input combinations (i.e. inputs containing 0, 2, 3, or 4 high bits) the outputs are treated as don't cares.
 
|[[File:Encoder diagram.svg|thumb|212px|Gate level circuit diagram of a single bit 4-to-2 line encoder]]
{|align="right"
{| class="wikitable" style="margin:0;"
|[[File:Encoder diagram.svg|thumb|212px|Gate level circuit diagram of a single bit 4-to-2 line encoder]]
{{caption|+ 4 to 2 Simple Encoder}}
|align="left"|
<div class="thumb"></div>
|}
{| class="wikitable" style="margin:0;"
!style="border-bottom:2px solid #000;"|I<sub>3</sub>
!style="border-bottom:2px solid #000;"|I<sub>2</sub>
Line 55 ⟶ 52:
| 1 || 0 || 0 || 0 ||style="border-left:2px solid #000;"| 1 || 1 || 1
|}
{{caption|4 to 2 Simple Encoder}}
 
If the input circuit can guarantee at most a single-active input, a simple encoder is a better choice than a priority encoder, since it requires less logic to implement.