Re: real to fixed poin tconversion
Where are these real numbers coming from? you cannot use real types in a design unless they are for constants or pre-synthesis setup. You cannot have real signals.
but to convert a real type, you need to use the to_ufixed(value, highbit, lowbit) and to_sfixed(value, highbit, lowbit) functions:
eg:
signal a : sfixed(9 downto -20);
a <= to_sfixed(-12.677, 9, -20); --convert -12.677 to fixed point signed with 10 integer bits and 20 fraction bits
or you could write:
a <= to_sfixed(-12.677, a) --uses size information from signal "a"
signal b : ufixed(7 downto -7);
b <= to_ufixed(1.887645372, 7, -7);