Parallel Case
A priority encoder is more expensive than a simple encoder
- If we know the input is 1-hot, we can tell the synthesis tools
- “parallel-case” pragma says the order of cases does not matter
input [7:0] A; // 8-bit input vector
output [2:0] Y; // 3-bit encoded output
reg [2:0] Y; // target of assignment
case (1’b1) // synopsys parallel-case
default: Y = 3’bX; // Don’t care when input is all 0’s