我想为 2*1 多路复用器构建一个小代码,其中输入来自不同的模块(使其更实用),但我总是得到高阻抗('Z')的输出。有什么建议么?
module mux_using_assign(
din_0 , // Mux first input
din_1 , // Mux Second input
sel , // Select input
mux_out // Mux output
);
input din_0, din_1, sel ;
output mux_out;
wire mux_out;
assign mux_out = (sel) ? din_1 : din_0;
endmodule //End Of Module mux
module ip1();
wire a;
mux_using_assign dut1(.din_0(a));
assign a = 1;
endmodule
module ip2();
wire b;
mux_using_assign dut1(.din_1(b));
assign b = 0;
endmodule
module test();
wire sel ; // Select input
wire mux_out;
ip1 aa(); // tried commenting this and following line also
ip2 bb();
mux_using_assign dut1(.sel(sel),.mux_out(mux_out));
assign sel=1;
endmodule