module mux2_en
#(
	parameter WIDTH = 16
)
(
	input 		[WIDTH-1:0]	data_in_default,
	input 		[WIDTH-1:0]	data_in0,
	input 		[WIDTH-1:0]	data_in1,
	input 						sel,
	input 						en,
	
	output reg 	[WIDTH-1:0] data_out
);

reg [WIDTH-1:0] data_out_temp;

always@(*)
begin
data_out_temp=data_in_default;
case(sel)
1'b0:
begin
data_out_temp=data_in0;
end
1'b1:
begin
data_out_temp=data_in1;
end
default:
begin
data_out_temp=data_in_default;
end
endcase
end

always@(*)
begin
if (en==1'b1)
	data_out=data_out_temp;
else
	data_out=data_in_default;
end

endmodule
