Verilog 将输入A的部分数组设置为模块';s输入

Verilog 将输入A的部分数组设置为模块';s输入,verilog,system-verilog,Verilog,System Verilog,XYZ接受[1:0]输入并且QRS具有[2:0]的输入。因此,在QRS中声明XYZ时,如何将QRSa[1]和a[0]设置为XYZa和b[0]至XYZb检查我的代码中的注释清楚了解我的问题 module XYZ ( y, a, b ); output y; input [1:0] a, b; //.... endmodule module QRS ( y, a, b ); output y; input [2:0]

XYZ
接受[1:0]输入并且QRS具有[2:0]的输入。因此,在QRS中声明XYZ时,如何将
QRS
a[1]
a[0]
设置为
XYZ
a
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

好的,你可以这样做

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