Verilog case
Without the default case, this would create a latch for Y
Assigning X to a variable means synthesis is free to assign any value
// Simple binary encoder (input is 1-hot)
input [7:0] A; // 8-bit input vector
output [2:0] Y; // 3-bit encoded output
reg [2:0] Y; // target of assignment
default: Y = 3’bX; // Don’t care when input is not 1-hot