A priority encoder accepts several requests and returns the code of the highest-priority active one. It also commonly supplies a valid flag. Priority is a chosen ordering, such as the highest numbered input winning; the circuit does not infer which request is most important.
Worked example
Consider inputs I3 through I0, with I3 highest priority. For request pattern 0101, I2 and I0 are active. The encoder returns code 10 for I2 and valid = 1. For 0000, valid = 0 and the code must be interpreted according to the specification.
What to watch for
Always check valid before using the output code. Code 00 alone cannot distinguish no request from an active I0 in this example.
Try it yourself
What code results from 1010 with I3 highest priority?
Answer: 11, because I3 wins over I1. The valid flag is one.
How to study this topic
Name each input and define its active level before drawing gates. Follow one data path at a time, then check the other combinations. A complete specification is the best starting point for a reliable circuit.
Explore related programmes
These recorded programmes are upcoming. This article is general educational content, not a syllabus or course sample.
Digital Electronics