Hi all, In my package declared below and performing rational division operation,once i ran on GHDL VHDL simulator gave an error "no function declarations for operator "/"" variable w,x : integer; variable num : real; begin w := numerator(a); x := denominator(a); num :=(a(numer))/(a(denom)); Thanks in advance Regards Raghavendra
I cannot understand your code... For real operations: did you include the ieee.math_real.all?
Thanks .i attached my source code.actually its package ...
> i attached my source code.
Thats not the complete code. At least the libraries are missing...
And this seems to be wrong:1 | |
Usually the range of an integer is -2^31 to 2^31-1
1 | |
2 | |
3 | |
Why do you not use a record? That would be the ideal solution for your fractional number:
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
> Thats not the complete code.
actually its a complete package.
i will try whatever you suggested,whats the problem in my code.
> no function declarations for operator "/"
There is no definition for a integer division resulting in a float
value. Try this
num := real(a(numer))/real(a(denom));
Thanks Lothar Miller..
> num := real(a(numer))/real(a(denom));
above statment working fine.
Reply
Please log in before posting.