How convert a std_logic_vector INPUT of the my entity in a IEEE Float type, to do some operations in my process? My entity need receive a IEEE Float of A/D converter.
2 Answers
VHDL doesn't have a float
type by default - it has real
which is not synthesisable.
However, the IEEE-standardised VHDL floating-point types are perfectly synthesisable.
You'll have to cast your std_logic_vector
as an unsigned
or signed
vector first and then convert to a suitable floating-point type, which need not be an IEEE-754 defined type
VHDL's floating point type (real) is not synthesizable (except perhaps by some very specialized tools), so if you have an input std_logic_vector in IEEE float form you will have to extract and process the required data fields (sign, exponent, mantissa) yourself (or use a library that does it for you, knowing the large amount of hardware resources this will consume).
Personally, I would avoid using floating point if at all possible, and stick to using fixed point instead.