Verilog中的Z代表什么?

What does Z in Verilog stand for?

我最近在 Verilog 代码中发现了这样的代码,我指的是编写有限状态机。

reg [15:0]Bus;
Bus = 'bzzzzzzzzzzzz1111;

这里的z是什么意思?

来自 IEEE Std 1800-2012,“6.3.1 逻辑值”部分:

z—represents a high-impedance state

The SystemVerilog value set consists of the following four basic values:

0—represents a logic zero or a false condition
1—represents a logic one or a true condition
x—represents an unknown logic value
z—represents a high-impedance state

The values 0 and 1 are logical complements of one another.

Z 表示高阻抗状态,但为什么要这样?

这基本上意味着你没有驱动总线的输出,所以其他东西可以驱动它。

你最有可能在驱动设备的输出端口时使用它,假设 FPGA 正在与另一个具有 I2C 协议的芯片通信,你发送你的读取请求,然后在总线上驱动 Z 以允许设备响应您请求的数据