A
Andy
Guest
You are interpreting std_logic 'X' as "I don't care, but it is
stable." This is not the definition of 'X'. It means undefined, and
could be anything, including transitioning between states
continuously. Depending upon the implementation, multiple inputs
changing continuously at the same time can result in non-obvious
results. Thus propagating X * ? to X makes some sense.
You are also using an unofficial package placed in the ieee library by
synopsys, and other vendors followed suit to provide compatibility
with synopsys. Use ieee.numeric_std instead (or, if your tool supports
vhdl 2008, then use numeric_std_unsigned, which is the functional
equivalent of std_logic_unsigned). Both of these are ieee controlled,
reviewed and balloted packages which guarantee compatibility between
vendors that support them (not the case with std_logic_unsigned).
However, as stated earlier, numeric_std (and I presume
numeric_std_unsigned) both set the results to X if either input
contains one or more bits of 'X'.
If this is important to you, the vhdl200x standard is in early
development and is taking suggestions for improvements. This is an
excellent reason for using official IEEE sactioned packages instead of
synopsys ones: You have a mechanism for changing the IEEE packages.
Because synopsys does not control other vendors' versions of
std_logic_unsigned, the package cannot be changed as effectively as
can official IEEE standards.
You can wrap the operation with additional simulated logic that checks
either operand for all bits=0 and forces the output to 0.
Andy
stable." This is not the definition of 'X'. It means undefined, and
could be anything, including transitioning between states
continuously. Depending upon the implementation, multiple inputs
changing continuously at the same time can result in non-obvious
results. Thus propagating X * ? to X makes some sense.
You are also using an unofficial package placed in the ieee library by
synopsys, and other vendors followed suit to provide compatibility
with synopsys. Use ieee.numeric_std instead (or, if your tool supports
vhdl 2008, then use numeric_std_unsigned, which is the functional
equivalent of std_logic_unsigned). Both of these are ieee controlled,
reviewed and balloted packages which guarantee compatibility between
vendors that support them (not the case with std_logic_unsigned).
However, as stated earlier, numeric_std (and I presume
numeric_std_unsigned) both set the results to X if either input
contains one or more bits of 'X'.
If this is important to you, the vhdl200x standard is in early
development and is taking suggestions for improvements. This is an
excellent reason for using official IEEE sactioned packages instead of
synopsys ones: You have a mechanism for changing the IEEE packages.
Because synopsys does not control other vendors' versions of
std_logic_unsigned, the package cannot be changed as effectively as
can official IEEE standards.
You can wrap the operation with additional simulated logic that checks
either operand for all bits=0 and forces the output to 0.
Andy