Xero
Xero

Reputation: 57

in VHDL how to check if UNSIGNED(8 downto 0) is UNINITIALIZED or UNDEFINED?

I am not able to check if an Unsigned(8 downto 0) data type is "XXXXXXXX" or even "UUUUUUUU"

Inside a process as a variable or even checking an input im not able to get it to work.

Any solution to it?

Upvotes: 2

Views: 1032

Answers (1)

Tricky
Tricky

Reputation: 4461

This is because the numeric_std package overloads the "=" function so that any "UUUU" or "XXXX" values will cause the result to always be false. Rememeber that numeric_std is arithmetic, so non numeric values should cause this behaviour.

To get a valid comparison, convert the unsigned first to std_logic_vector:

if std_logic_vector(some_unsiged) = "XXXXXXXXX" then

Upvotes: 1

Related Questions