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
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).
