Verilog 输入端口变量的默认数据类型是什么?

发布于 2025-01-17 01:35:51 字数 119 浏览 3 评论 0原文

你好,我是 Verilog 新手,对此我一直很困惑。在某些示例中,输入和输出被声明为电线或寄存器,而在其他示例中,它们只是这样列出: Module(输入 a, b, 输出 c)

赋予这些值的默认数据类型是什么?

Hello I’m new to Verilog and I’ve been confused over this. In some examples the inputs and outputs are declared as wires or regs and on others they are just listed like this:
Module(input a, b, output c)

What is the default data type given to these values?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

属性 2025-01-24 01:35:51

任何方向端口的默认数据类型都是无符号 4 状态标量(1 个二进制数字)。在 Verilog 中,inputinout 端口必须是且默认为网络类型 wireoutput 端口也默认为 wire,但也可以指定为变量 reg。 (SystemVerilog 通过允许输入端口也被声明为变量来放宽其中一些规则)。

既然您知道隐式默认值是什么,请成为一名优秀的工程师,并且永远不要依赖它们——要明确。

The default data type for a port in any direction is an unsigned 4-state scalar (1 binary digit). In Verilog, input and inout ports must be and default to the net type wire. output ports also default to wire but can also be specified as a variable reg. (SystemVerilog relaxes some of these rules by allowing input ports to also be declared as variables).

Now that you know what the implicit defaults are, please be a good engineer and never rely on them—be explicit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文