Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17268 Discussions

floating point in verilog question

Altera_Forum
Honored Contributor II
1,618 Views

Hi there, 

 

I'm converting some code in DSP floating point to systemverilog. I always get value 0 instead of 0.00001 in TI DSP. Is there a library to support floating point in Quartus device? 

 

Thanks and have a good weekend. 

Sean
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
766 Views

you have a couple of options 

 

Altera has some floating point megafunctions, i think Verilog is supported: 

 

http://www.altera.com/literature/ug/ug_altfp_mfug.pdf 

 

DSP Builder Advanced Blockset has some floating point blocks and full "math.h" support. it generates VHDL: 

 

http://www.altera.com/literature/hb/dspb/hb_dspb_adv.pdf 

 

you could also try the VHDL 2008 floating point package (there are some modified for VHDL-93 out there). this is not optimized for/by Altera, so i would expect the lowest fmax and highest resource usage out of the 3
0 Kudos
Altera_Forum
Honored Contributor II
766 Views

or you can try and convert it all to fixed point :)

0 Kudos
Altera_Forum
Honored Contributor II
766 Views

Thanks pancake, 

 

I already looked into megacore ip and I don't know where to start. Do you have any samples to let me fresh start. 

 

In C code. 

 

float scale_factor; 

scale_factor = 1 / (float) number_of_samples; 

 

Is there module .v that I just plug the float value in/out? 

 

 

Thanks, I will look over the weekend. 

 

Sean
0 Kudos
Reply