Anda di halaman 1dari 3

`timescale 1ns / 1ps

//////////////////////////////////////////////////////////////////////////////////

// Company:

// Engineer:

//

// Create Date: 01/30/2018 03:26:48 AM

// Design Name:

// Module Name: mux_2_1

// Project Name:

// Target Devices:

// Tool Versions:

// Description:

//

// Dependencies:

//

// Revision:

// Revision 0.01 - File Created

// Additional Comments:

//

//////////////////////////////////////////////////////////////////////////////////

module mux_2_1(

input a,

input b,
input s,

output y

);

assign y=s?b:a;

endmodule

`timescale 1ns / 1ps

//////////////////////////////////////////////////////////////////////////////////

// Company:

// Engineer:

//

// Create Date: 01/30/2018 03:31:44 AM

// Design Name:

// Module Name: mux_2_1a

// Project Name:

// Target Devices:

// Tool Versions:

// Description:

//

// Dependencies:

//

// Revision:

// Revision 0.01 - File Created

// 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

Anda mungkin juga menyukai