Priority Encoder in Logisim-evolution

A decoder turns a binary code into one-hot outputs. A priority encoder does the reverse: given several active inputs, it outputs the binary code of the highest-priority one. Think keyboard scanners and interrupt controllers — when multiple keys are pressed, the highest-priority key wins.

The built-in Priority Encoder

Step 1 — Find it. Open the Plexers library in the component panel and select Priority Encoder (it sits next to Decoder and Multiplexer).
Step 2 — Set the size. In the attributes panel, set Select Bits — for an 8-to-3 encoder, select bits = 3, giving 8 data inputs and a 3-bit binary output.
Step 3 — Test priority. Connect input pins to the data inputs and probes to the output. Activate input 2 alone → output reads 010. Now also activate input 5 → output reads 101: the higher index wins, every time. There is also an enable input and a “group signal” output that tells you whether any input was active.

How priority resolution works

Under the hood it is a cascade: each input is ANDed with the inverted “any higher input active” signal, so only the topmost active input reaches the encoding logic. Building an 4-to-2 version from gates is a nice 20-minute exercise — derive it from the truth table with Combinational Analysis.

Go further

Compare with the decoder (the inverse operation) and the multiplexer (selection by address rather than priority).