系统C支持三态逻辑吗?

发布于 2024-09-26 13:14:01 字数 170 浏览 2 评论 0原文

System C 支持三态逻辑吗?也就是说,可以获取 01X 的位,其中 X 表示“未知< /em>”?

如果是,它是否还支持可以包含 X 的向量,包括逻辑和算术运算?

Does System C support tri-state logic? That is, bits that can get 0, 1 or X, where X means "unknown"?

If it does, does it also support vectors that can contain Xes, including logic and arithmetic operations?

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

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

发布评论

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

评论(2

毁梦 2024-10-03 13:14:01

这是您需要的:

它没有三态变量,而是四态(正确吗?:P)变量 (0,1,X,Z)。有关更多信息,请参阅上面的链接。它还支持这些变量的向量。

希望我对你有一点帮助:)

Here is what you need:

It does not have tri-state variables, but quad-state (is that correct? :P) variables (0,1,X,Z). More about it in the above links. It also supports vectors of those variables.

Hope I helped you a little bit :)

回梦 2024-10-03 13:14:01

是的,您正在寻找 sc_logic 和 sc_lv 类型,它们是 4 个状态变量:0、1、X 和 Z。当您将它们一起解析时,请注意它们如何交互。 asic-world.com 网站上有一个很好的表格,直接取自 SystemC 用户手册。

但请注意,这不像在 Verilog 中那样工作,其中 X 也可以充当通配符。我必须构建自己的函数来添加该功能。

Yeah, you're looking for the sc_logic and sc_lv types which are 4 state variables: 0, 1, X, and Z. Pay attention to how they interact when you resolve them together. There's a nice tables on the asic-world.com site taken directly from the SystemC User Manual.

Note though that this doesn't work like in Verilog where X can also act as a wildcard. I had to build my own function to add that functionality.

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