Verilog Coding Exercise · Combinational II
8:3 Encoder
The reverse of a decoder — one active line becomes a binary code.
Converts one active input line (out of eight) back into its 3-bit binary index. A plain encoder assumes exactly one input is active at a time — if more than one is high, the result is undefined, which is exactly the problem the priority encoder solves.