Unused select line combination in 3x1 MUX?
There is a far neater way to make a multiplexer, using a vector.

Example:

module mux(
  input wire a,
  input wire b,
  input wire c,
  input wire[1:0] sel,
  output wire y
);
  wire [3:0] mux = {1'b0,c,b,a};
  assign y = mux[sel];
endmodule


In this case you assign your outputs into the variable 'mux' and then the output will be the sel'th element in the vector.

A 3:1 mux doesn't really exist - you will always have a \$2^n\$ inputs where \$n\$ is the number of bits in the select signal. So you have to have some way of handling the extra condition. One option is to pick a fixed constant like 0 or 1 (which depends on what it connects to later - e.g. you might want a 1 if this is driving a bus which is considered 'idle' when high). Alternatively, you can add some form of error checking - e.g. have an additional output bit to signify that there was an error (or have the opposite logic and signify that the output is valid).

Example:

module mux(
  input wire a,
  input wire b,
  input wire c,
  input wire[1:0] sel,
  output wire y,
  output wire valid
);
  wire [3:0] mux = {1'b0,c,b,a};
  assign y = mux[sel];
  assign valid = (sel != 2'b11);
endmodule


In this example, when the sel signal has a value that is not 3, then the output signal valid will be high to indicate that the input was correct. Otherwise, if the input is 3, then the valid signal will be low to indicate that the input was invalid.



It's worth noting the reasons why using a vector in this way is preferable. Firstly it is quite easy to follow - if you compare your code to the example, its much clearer what is going on using a vector compared with having to decode the logic. Secondly, and more crucially, it allows for easier parameterisation - you can add a parameter to your block which will correctly scale the select signal and mux signal based of the parameter - although to do this, you would also have to make the input signals into a vector as well which would even then eliminate the need for the 'mux' variable.