What is the difference between == and === in Verilog?

前端 未结 3 1343
一生所求
一生所求 2020-12-25 11:19

What is the difference between:

if (dataoutput[7:0] == 8\'bx) begin

and

if (dataoutput[7:0] === 8\'bx) begin 
3条回答
  •  不思量自难忘°
    2020-12-25 11:51

    == For comparing bits (0 or 1) === For comparing all 4 states (0, 1, x, z)

    == can be synthesized into a hardware (x-nor gate), but === can't be synthesized as x is not a valid logic level in digital, it is infact having voltages in between 0 and 1. And z is not itself any logic, it shows disconnection of the circuit.

提交回复
热议问题