wire / wire-format / priority-encoder
A priority encoder converts a one-hot (or multi-hot) input to a binary code, giving priority to the highest-numbered active input. Used in interrupt controllers (highest priority interrupt), CAM (highest-priority match), and arbiters. If multiple inputs are active, the highest-numbered (or lowest, depending on design) is encoded.
aka: Priority encoder
spec: Digital logic design
A priority encoder converts a one-hot (or multi-hot) input to a binary code, giving priority to the highest-numbered active input. Used in interrupt controllers (highest priority interrupt), CAM (highest-priority match), and arbiters. If multiple inputs are active, the highest-numbered (or lowest, depending on design) is encoded.
| field | size | meaning |
|---|---|---|
| 4:2 priority encoder | 4 inputs, 2 outputs | Outputs the binary code of the highest active input. E.g., inputs 1010 -> output 11 (input 3 has highest priority). |
| 8:3 priority encoder | 8 inputs, 3 outputs | Outputs the binary code of the highest active input among 8. |
| Valid output | 1 bit | 1 if any input is active (at least one 1). |
| Priority scheme | config | Highest number = highest priority (or lowest, depending on design). |
example:
00 00
Priority encoder (placeholder)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/priority-encoder
or /wire-format/priority-encoder.json