Answers:
相等和关系运算符(如果操作数具有X或Z,则返回X)
m == n // is m equal to n? (1-bit True/False result)
m != n // is m not equal to n? (1-bit True/False result)
m < n // is m less than n? (1-bit True/False result)
m > n // is m greater than n? (1-bit True/False result)
m <= n // is m less than or equal to n? (1-bit True/False result)
m >= n // is m greater than or equal to n? (1-bit True/False result)
身份运算符(比较逻辑值0、1,X和Z)
m === n // is m identical to n? (1-bit True/False results)
m !== n // is m not identical to n? (1-bit True/False result)
例
如果reg a小于2'b10,则将2'b11存储在a中。
if (a < 2'b10) begin
a = 2'b11;
end
注意事项
来源:Stuart Sutherland撰写的“基于Verilog-2001标准(IEEE Std 1364-2001)的《 Verilog HDL快速参考指南》”