X or Z values
Verilog has two symbols for unknown and high impedance values. These values are very
important for modeling real circuits. An unknown value is denoted by an x. A high
impedance value is denoted by z.
12'h13x // This is a 12-bit hex number; 4 least significant bits
unknown
6'hx // This is a 6-bit hex number
32'bz // This is a 32-bit high impedance number
An x or z sets four bits for a number in the hexadecimal base, three bits for a number in
the octal base, and one bit for a number in the binary base. If the most significant bit of a
number is 0, x, or z, the number is automatically extended to fill the most significant bits,
respectively, with 0, x, or z. This makes it easy to assign x or z to whole vector. If the
most significant digit is 1, then it is also zero extended.
参考文件
1:Verilog HDL A Guide to Digital Design and Synthesis, Second Edition 第43页