系统C支持三态逻辑吗?
System C 支持三态逻辑吗?也就是说,可以获取 0
、1
或 X
的位,其中 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 X
es, including logic and arithmetic operations?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是您需要的:
它没有三态变量,而是四态(正确吗?: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 :)
是的,您正在寻找 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.