Moudule
概念介绍
到目前为止,你已经熟悉了一个模块,它是一个通过输入和输出端口与其外部交互的电路。更大、更复杂的电路是通过将较小的模块和其他连接在一起的部分(例如赋值语句和always块)组合而成的更大模块来构建的。因为模块可以包含其他模块的实例,由此形成了一个层级结构。
By now, you’re familiar with a module, which is a circuit that interacts with its outside through input and output ports. Larger, more complex circuits are built by composing bigger modules out of smaller modules and other pieces (such as assign statements and always blocks) connected together. This forms a hierarchy, as modules can contain instances of other modules.
下面这张图展示了一个非常简单的电路及其子模块。在这个练习中,创建一个实例模块mod_a,然后这个模块的三个引脚(in1,in2,和out)连接到你的顶层模块的三个端口(a,b,和out)。这个模块mod_a是给定给你的——你必须实例化它。
The figure below shows a very simple circuit with a sub-module. In this exercise, create one instance of module
mod_a, then connect the module’s three pins (in1,

文章介绍了Verilog中模块的概念,模块是通过输入和输出端口交互的电路单元,可以通过组合形成层级结构。重点讲述了如何通过位置连接法和名字连接法将信号连接到模块的端口,强调了即使端口顺序改变,按名称连接仍能保持正确性。并提供了代码示例展示这两种方法。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



