Reputation: 57
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
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