This problem is similar to the previous one (module). You are given a module named mod_a that has 2 outputs and 4 inputs, in that order. You must connect the 6 ports by position to your top-level module's ports out1, out2, a, b, c, and d, in that order.
You are given the following module:
module mod_a ( output, output, input, input, input, input );
此问题与上一个问题(模块)类似。您将得到一个名为mod_a的模块,该模块按顺序有2个输出和4个输入。您必须按位置将6个端口按顺序连接到顶级模块的端口out1、out2、a、b、c和d。
您将获得以下模块:模块mod_a(输出,输出,输入,输入,输出);
很简单,实际上就是更多的连线而已
但这里因为没给mod_a内的每个信号的名字,所以必须要提另一个例化模块接线的方法
mod_a instance1(wa,wb,wc);
这个会按照mod_a内部的信号的顺序直接接线,算是一种偷懒的方式,但我不是很喜欢用,容易出错,不过在信号特别多的时候用起来确实很方便
module top_module (
input a,
input b,
input c,
input d,
output out1,
output out2
);
mod_a mod_a_1(out1,out2,a,b,c,d);
endmodule