verilog 在同一根线上驱动信号

发布于 2024-11-01 14:52:29 字数 118 浏览 4 评论 0原文

我浏览了互联网,找不到我的问题的清晰简洁的答案。我想知道如果我将相同强度的信号驱动到同一根线上,其中一个为逻辑 1,另一个为逻辑 0,会发生什么?如果我想要一个“获胜”的信号,但由于没有更好的词,根据具体情况,我该怎么办?

I looked through internet and couldn't find a clear and concise answer to my question. I want to know what'll happen if I drive same strength signals onto the same wire, one of them being logic 1 and the other being logic 0? What do I do if I want a signal to "win", for lack of a better word, depending on the situation?

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

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

发布评论

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

评论(2

勿忘初心 2024-11-08 14:52:29

根据您的评论,听起来您想要一辆三态巴士。驱动三态总线的基本结构是:

assign bus = enable ? out : 1'bz;

每个驱动总线的模块都有一个这种形式的驱动程序。任何时候只能断言一个模块的使能;总线协议应该定义如何决定总线的所有权。例如,像I2C这样的串行总线有“主”和“从”;主人总是先说话,奴隶只有在主人要求后才说话。

如果您不希望总线在没有任何驱动时浮动(在模拟中,这显示为 Z 值),您可以将总线声明为 tri0tri1而不是普通的电线

如果多个模块同时置位启用,或者如果您有多个标准 分配总线 = out; 驱动程序尝试在总线上驱动不同的值,则称为“争用”。这将在模拟中显示为 X 值,并可能导致物理设备中的驱动程序损坏。

Based on your comment, it sounds like you want a three-state bus. The basic structure to drive a three-state bus is:

assign bus = enable ? out : 1'bz;

Each module driving the bus has a driver of this form. Only one module may have its enable asserted at any time; the bus protocol should define how ownership of the bus is decided. For example, serial buses like I2C have a "master" and a "slave"; the master always talks first, and the slave only talks after it has been requested to by the master.

If you don't want the bus to float when nothing is driving (in simulation, this shows up as a Z value), you can declare the bus as tri0 or tri1 rather than a regular wire.

If multiple modules have the enable asserted at the same time, or if you have multiple standard assign bus = out; drivers attempting to drive different values on the bus, it is known as "contention". This will show up as an X value in simulation, and could result in damage to the drivers in a physical device.

有木有妳兜一样 2024-11-08 14:52:29

我想知道如果我会发生什么
驱动相同强度的信号到
同一根线,其中一根为逻辑 1
另一个是逻辑0?

如果负载是一个简单的网络,它将被分配 StX(Strong X)。

如果我想要一个信号,我该怎么办
“赢”,因为没有更好的词,
要看具体情况?

您是否想问如何在 Verilog 中对此进行建模或如何使用 MOS 器件进行此建模?

I want to know what'll happen if I
drive same strength signals onto the
same wire, one of them being logic 1
and the other being logic 0?

If the load is a simple net it will be assigned StX(Strong X).

What do I do if I want a signal to
"win", for lack of a better word,
depending on the situation?

Are you asking how to model this in Verilog or how to do this with MOS devices?

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