default case
// 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 isnt 1-hot
If you omit the default, the compiler will create a latch for Y
? Or you can list all 256 cases
Better way: Use a function
? Compiler will warn you of missing cases