Jawaban:
Kesetaraan dan Operator Relasional (mengembalikan X jika operan memiliki X atau Z)
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)
Operator Identitas (bandingkan nilai logika 0, 1, X, dan 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)
Contoh
Jika reg a kurang dari 2'b10, simpan 2'b11 di a.
if (a < 2'b10) begin
a = 2'b11;
end
Peringatan
Operator perbandingan numerik Verilog mirip dengan yang ada di C: ==,! =, <,>, <=,> =.