Mux.v.bak 710 Bytes
module Mux32bit(muxin1, muxin2, signal, muxout);

input[31:0] muxin1, muxin2;
input signal;
output reg[31:0] muxout;

always @(*) begin
case(signal)
	1'b0: muxout = muxin1;
	1'b1: muxout = muxin2;
endcase
end

endmodule

module Mux5bit(muxin1, muxin2, signal, muxout);

input[4:0] muxin1, muxin2;
input signal;
output reg[4:0] muxout;

always @(*) begin
case(signal)
	1'b0: muxout = muxin1;
	1'b1: muxout = muxin2;
endcase
end

endmodule

module Mux32bit4x1(muxin1, muxin2, muxin3, signal, muxout);

input[31:0] muxin1, muxin2, muxin3;
input[1:0] signal;
output reg[31:0] muxout;

always @(*) begin
case(signal)
	2'b00: muxout = muxin1;
	2'b01: muxout = muxin2;
	2'b11: muxout = muxin3;
endcase
end

endmodule