- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sir, I'm using Verilog to program and Modelsim to simulate but i don't know how to use special function to calculate log, exponent, sin...Do i need add library ?
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
nobody answer for me. Sad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You didn't tell, if you need the mathematical functions only in the testbench or to be synthesizable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ---- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank FvM very much. That's i need
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do I need to add any extra Verilog/VHDL codes (library or anything) in the simulation before I could call these special functions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
They are available in HDL, but they cannot be used in an fpga.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page