//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Design Name:
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module mux_2_1(
input a,
input b,
input s,
output y
);
assign y=s?b:a;
endmodule
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Design Name:
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module mux_2_1a();
reg a,b,s;
mux_2_1 inst(a,b,s,y);
initial
begin
a=1;
b=1;
s=1;
#20;
b=0;
#20;
a=0;
#20;
s=0;
#20;
s=1;
end
endmodule