首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >verilog mux不工作

verilog mux不工作
EN

Stack Overflow用户
提问于 2015-05-09 13:19:01
回答 1查看 408关注 0票数 0

我想为2*1 mux构建一个小代码,其中输入来自不同的模块(使其更实用),但我总是以高阻抗('Z')的形式输出。有什么建议吗?

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-05-09 13:43:40

问题是,每个模块中的dut1实例都是独立于其他模块的实例。换句话说,每个ip1ip2test都有自己的dut1 muxer。您将需要使用输入/输出连接,并将它们全部链接到一个mux_using_assign声明中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30140415

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档