// mux4.sv // 4-to-1 multiplexer written with a case statement. module mux4 #( parameter int WIDTH = 8 ) ( input logic [1:0] sel, input logic [WIDTH-1:0] a, input logic [WIDTH-1:0] b, input logic [WIDTH-1:0] c, input logic [WIDTH-1:0] d, output logic [WIDTH-1:0] y ); always_comb begin case (sel) 2'd0: y = a; 2'd1: y = b; 2'd2: y = c; default: y = d; endcase end endmodule