Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图找出如何检查 3 位总线的 msb 是否设置为 1,即 1xx。当我检查 bus==3'b1xx 时,似乎什么也没发生。
您编写的表达式的结果只能是 (1'b0) 或 (1'bx),对于if语句分支,它们都被认为是 false。
if
假设您声明了总线,wire [2:0] bus;您可以使用它来检查它bus[2] == 1'b1
wire [2:0] bus;
bus[2] == 1'b1
bus ==? 3'b1xx现在在 SystemVerilog 中,您可以使用将 RHS X 视为不关心的通配符匹配。LHS 上的 X 被视为与 相同==。
bus ==? 3'b1xx
==