HDL—Verilog Language—Modules:Hierarchy—Modules

这一部分主要介绍模块例化部分的内容

例如有一个模块:

module mod_a ( input in1, input in2, output out );

// Module body

endmodule

现在要在顶层模块(top_module)中实例化这个部分

 具体做法:

模块名 例化后的的模块名(.模块的信号名(top中与模块连接的信号的名字),

.模块的信号名(top中与模块连接的信号的名字),

.模块的信号名(top中与模块连接的信号的名字)

);

例如:

mod_a instance1(.out(wc),

.in1(wa),

.in2(wb)

);

所以这个题目的做法也很简单

In this exercise, create one instance of module mod_a, then connect the module's three pins (in1, in2, and out) to your top-level module's three ports (wires a, b, and out). The module mod_a is provided for you — you must instantiate it.

在本练习中,创建模块mod_a的一个实例,然后将模块的三个引脚(in1、in2和out)连接到顶级模块的三条端口(导线a、b和out)。

module top_module ( input a, input b, output out );
    mod_a mod_a_1(
        .in1(a),
        .in2(b),
        .out(out)
    );
endmodule

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值