【问题标题】:Set partial array of input A to a module's input将输入 A 的部分数组设置为模块的输入
【发布时间】:2021-05-02 08:23:07
【问题描述】:

XYZ 接受 [1:0] 输入QRS 输入 [2:0]。所以在声明 XYZ 时在 QRS 中,如何将 QRS a[1]a[0] 设置为 XYZ aQRS b[1]b[0]XYZ b查看我代码中的注释清楚了解我的问题

module XYZ (
    y,
    a, b
);
    output y;
    input [1:0] a, b;
  
    //....

endmodule


module QRS (
    y,
    a, b
);
    output y;
    input [2:0] a, b;
    wire w;


    XYZ xyz(w, //How to assign a[1] and a[0] to a, and same for b)
    
endmodule

【问题讨论】:

    标签: verilog system-verilog


    【解决方案1】:

    好的,你可以这样做

    XYZ xyz(w, a[1:0], b[1:0])
    

    【讨论】:

      猜你喜欢
      • 2019-04-24
      • 1970-01-01
      • 2018-08-26
      • 1970-01-01
      • 1970-01-01
      • 2016-01-10
      • 1970-01-01
      • 2021-07-08
      • 2020-05-27
      相关资源
      最近更新 更多