System verilog real variable

In reply to tri.nguyen1123:

The issue here is that if either the true or false conditional expressions are real, the resulting type is real. The value 1’bz is being converted to 0.0.

To prevent this from happening, you can write

assign x = y ? logic'(val) :' 1bz;