Forum Discussion
7 Replies
- Altera_Forum
Honored Contributor
nobody answer for me. Sad
- Altera_Forum
Honored Contributor
You didn't tell, if you need the mathematical functions only in the testbench or to be synthesizable?
- Altera_Forum
Honored Contributor
--- Quote Start --- You didn't tell, if you need the mathematical functions only in the testbench or to be synthesizable? --- Quote End --- I need the mathematical functions in testbench only. Thank - Altera_Forum
Honored Contributor
You should review the real math functions provided by verilog
--- Quote Start --- Table 17-18—Verilog to C real math function cross-listing Verilog function Equivalent C function Description $ln(x) log(x) Natural logarithm $log10(x) log10(x) Decimal logarithm $exp(x) exp(x) Exponential $sqrt(x) sqrt(x) Square root $pow(x,y) pow(x,y) x**y $floor(x) floor(x) Floor $ceil(x) ceil(x) Ceiling $sin(x) sin(x) Sine $cos(x) cos(x) Cosine $tan(x) tan(x) Tangent $asin(x) asin(x) Arc-sine $acos(x) acos(x) Arc-cosine $atan(x) atan(x) Arc-tangent $atan2(x,y) atan2(x,y) Arc-tangent of x/y $hypot(x,y) hypot(x,y) sqrt(x*x+y*y) $sinh(x) sinh(x) Hyperbolic sine $cosh(x) cosh(x) Hyperbolic cosine $tanh(x) tanh(x) Hyperbolic tangent $asinh(x) asinh(x) Arc-hyperbolic sine $acosh(x) acosh(x) Arc-hyperbolic cosine $atanh(x) atanh(x) Arc-hyperbolic tangent --- Quote End --- - Altera_Forum
Honored Contributor
thank FvM very much. That's i need
- Altera_Forum
Honored Contributor
Do I need to add any extra Verilog/VHDL codes (library or anything) in the simulation before I could call these special functions?
- Altera_Forum
Honored Contributor
They are available in HDL, but they cannot be used in an fpga.