I just have:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
the to_unsigned() yes is part of numeric_std,
the to_stdlogicvector() I saw on the web but after
your post I was looking inside the libs that came with Quartus and
You're right that one is not there.
on the numeric_std that came with quartusII it is now very clear that
to_signed() and to_unsigned() functions are for converting integers
only. period !
Yes, because t0_unsigned is not needed to convert slv. They are
"closely related" types and so the "cast" works to convert them. I
sometimes forget my VHDL terminology but the concept is right.
The origin of all confusion was found here on the web
lines 626 and following where all those stuff for std_logic_vectors also
exists.
Apparently existed in 1994 and were taken out in 1995... :-(
http://www.ece.msstate.edu/~reese/EE8993/ieee_standards/numeric_std.vhd
sometimes the web is a bad place to look for info :-(
Oh, yes, an old document can be misleading. I always have to search my
hard drive to find my copies of numeric_std which is in the synthesis
vendor's directories. That is the one that matters when you are working
with their tools and you don't even need to be online.
Glad you got to the bottom of all this. I think you wrapped your head
around it faster than I did.
There is another case where an expression is of indeterminate type. I
can't say this is a valid case, but supposed + is defined for both
unsigned result and a signed result for the operands you are using.
Then the type of the result has to be specified. I believe this is done
with signed' in front of the expression (in parentheses of course).
Maybe someone has a real example?
So there are three ways you indicate type of expressions, this is one
(not sure what it is called), then there is the conversion of closely
related types (free compared to a conversion function) and finally there
are conversion functions like to_integer() which require a function to
be written. I think that covers the field.
Rick