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?
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
numeric_std provides overload functions for the "=" operator. IEEE Std 1076-2008 9.2.3 Relational operators "The equality and inequality operators (= and /=) are defined for all types other than file types and protected types." 12.4 Use clauses "If two potentially visible declarations are homographs and one is explicitly declared and the other is implicitly declared, then the implicit declaration is not made directly visible."
"="[unsigned, unsigned return boolean] is implicitly declared immediately following the declaration of type unsigned in package numeric_std and is not visible. It has the behavior (9.2.3) "Two composite values of the same type are equal if and only if for each element of the left operand there is a matching element of the right operand and vice versa, and the values of matching elements are equal, as given by the predefined equality operator for the element type." While the explicitly declared "=" behavior is different. ieee.std_logic_1164."=" has no explicit overload declarations.