N
Niv (KP)
I have a function which accepts an unsigned vector of unconstrained
length, and assigns it to the variable "work".
One of the operations it performs depends on the value being
"1000......0000"
that is all '0's axcept the msb being set to a '1' , for any length
vector
I currently test for this as follows:
ELSIF ((work(work'HIGH) = '1')) AND
((work(work'HIGH - 1 DOWNTO work'LOW)) = (work(work'HIGH - 1
DOWNTO work'LOW)'RANGE => '0')) THEN
-- operation here
This compiles OK, but is there a neater way, it does seem a bit long
winded.
Regards, Kev P.
length, and assigns it to the variable "work".
One of the operations it performs depends on the value being
"1000......0000"
that is all '0's axcept the msb being set to a '1' , for any length
vector
I currently test for this as follows:
ELSIF ((work(work'HIGH) = '1')) AND
((work(work'HIGH - 1 DOWNTO work'LOW)) = (work(work'HIGH - 1
DOWNTO work'LOW)'RANGE => '0')) THEN
-- operation here
This compiles OK, but is there a neater way, it does seem a bit long
winded.
Regards, Kev P.