- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey everyone!
I have a problem and I hope everyone can help me: now I don't known that operation of real type in vhdl. for example: if I calculation 3.5/4.5 then result=?. one more problem is function sin, cos, tan in vhdl. thanks!Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
library ieee;
use ieee.std_logic_1164.math_real.all; http://www.csee.umbc.edu/help/vhdl/stdpkg.html This should help.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should consider, that real and respective math functions are only available for simulation and compile time calculations, e.g. generation of ROM tables. But they aren't synthesizable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess that shows how much I have used those functions. I thought about checking that before i posted, but now i just feel retarded. That being said, Altera provides floating point math units as megacores. Or opencores.org may have something useful. Trig functions, depending on precision a LUT may be helpful, or if you google "implement sine hardware" you may come up with some results. Besides that I don't have a clue really. Sorry for not being too useful.
ece.gmu.edu/courses/ECE645/projects_S06/talks/CORDIC.pdf an interesting result.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, also Altera has floating point MegaFunctions. But they don't use VHDL real type rather than IEEE or custom specific floating point types.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks everyone!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are trying to use Floating point numbers (real) inside an FPGA, there is probably something wrong with the origional spec. Floating point math is horrible and eats up alot of logic.
Try and re-spec the design to used fixed point math instead. It fits right in with what FPGAs do. and then also look at using this package from the IEEE: http://www.vhdl.org/fphdl/vhdl.html Its fully synthesisable in quartus, but dont try and use the floating point parts of it, unless you want to clock the design extremly slowly (or use the altera FP units instead. In addition, its normally best to implement sin/cos functions using a ROM as it is alot more practical. And remember, keep it fixed point.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have implemented in this forums. But I cannot use floating point (real) . It error only.
Please help.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you cannot use real types in designs. They are for simulation only.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page