2:1 Multiplexer

Easy Verilog FSM
Solve this problem

Design a simple 2:1 multiplexer in Verilog.

Constraints

  • sel=0 => a
  • sel=1 => b
  • combinational only
  • assign statement allowed
Starter codeVerilog
1module mux2(2    input wire a,3    input wire b,4    input wire sel,5    output wire y6);7// TODO8endmodule