vhdl integer to real
I see no bog problem in that. Unless I am again not understanding what you need.
To the multiplier it would be transparent if you use integers or fixed point numbers. To the multiplier it would be just signed integers. It is you who will decide how to represent your numbers. If you will use 18-bit numbers, than I advise you to use format 2.16 for the range [-1 1]. For instance,
A = 11 1000 0000 0000 0000 = -0.5.
Take 2's complement.
A = 00 1000 0000 0000 0000 = 2^-1 +0 +0 +...+0 = 0.5
B=01 0100 0000 0000 0000 = 2^0+2^-2 = 1+0.25 = 1.25.
As you can see, you know that the decimal point is located right after the second bit (from left to right) and still the multiplier will take it as integer.
In the case of multiplication the resulting number is A2.16 * B2.16=C4.32, or if you want to see it like this A18*B18=C36.
If you want your result to be of 18 bits and you are sure it will be in the range [-1 1], and supposing that the left bit is the MSB, you take bits 33 downto 16, and there you will have your C2.16 number.
If you have doubts send me an e-mail to
mendozaulises@yahoo.com.
I can also send you an 18-bit multiplier VHDL code.
regards,
Ulises
Added after 32 minutes:
If you don't understand fixed point arithmetic, you can refer to:
h**p://