module MyEncoder(i0,i1,i2,i3,i4,i5,i6,i7,en_out); input l1,l2,l3,l4,l5,l6,l7; output [2:0] en_out; reg [2:0] en_out; always @ (i0 or i1 or i2 or i3 or i4 or i5 or i6) if(i6 == 1'b1) en_out <= 3'b110'; else if ( i5 == 1'b1) en_out <= 3'b101; else if ( i4 == 1'b1) en_out <= 3'b100; else if ( i3 == 1'b1) en_out <= 3'b011; else if ( i2 == 1'b1) en_out <= 3'b010; else if ( i1 == 1'b1) en_out <= 3'b001; else en_out <= 3'b000; endmodule