Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

special functions for DSP in FPGA implementation

I used to implement some complicated DSP algorithms in TI DSP chips. Now, we are trying to do the implementation in FPGA. Does Altera FPGA already have a library for modules such as ln(x), cos(x), atan(x), sqrt(x), and 1/x etc? If yes, how could they be "called/instantiated" in modelsim (student version) or Quartus II? I need the final implementation can be run in the actual hardware (FPGA) efficiently.

Thanks in advance.

Cindy

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The answer is not really, but they are easy to, but the way you speak sounds like you have little knowledge of how fpgas work. Nothing is "called", you instantiate modules and implement them on the chip.

    Things like ln and sin, COs etc would usually be done with a look up table. The values can easy be calculated in hdl itself at elaboration time before the design is synthesised onto the chip. Model sim just stimulated the hardware description.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    So which means, I have to implement some special functions by myself in order to make the codes run in actual hardware, and Altera doesn't have the ready to use modules to be embedded into my codes?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    So which means, I have to implement some special functions by myself in order to make the codes run in actual hardware, and Altera doesn't have the ready to use modules to be embedded into my codes?

    --- Quote End ---

    No, Tricky was just observing that when you were asking your question that you were not using terminology that reflects a knowledge of DSP on FPGAs. The users on this forum are friendly and helpful, so lets see if we can help ...

    When you wrote your DSP algorithms on the TI DSPs, did you use floating-point or fixed-point signal processing?

    Until recently FPGA digital signal processing has mainly been fixed-point, since that is what the hardware supports. There are many applications that take in fixed-point samples from ADCs, perform some processing, and then send fixed-point data to DACs. Newer generation FPGAs can support floating-point DSP.

    Whether to use fixed-point or floating-point is application specific, so if you could describe what you are trying to do, it would help people provide you feedback.

    If you want to see some examples of fixed-point DSP FPGA processing, take a look at these slides and tutorial ...

    https://www.ovro.caltech.edu/~dwh/correlator/pdf/ee_live_14_hawkins.pdf

    https://www.ovro.caltech.edu/~dwh/correlator/pdf/esc-104slides_hawkins.pdf

    https://www.ovro.caltech.edu/~dwh/correlator/pdf/esc-104paper_hawkins.pdf

    The paper has lots of references, so you can take a look at those too.

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Does Altera FPGA already have a library for modules such as ln(x), cos(x), atan(x), sqrt(x), and 1/x etc?

    --- Quote End ---

    See http://www.altera.com/literature/ug/ug_altfp_mfug.pdf for a list of floating point operations you get "for free". Probably most of what you're looking for (a subset from <math.h>) is available.

    But as Dave, Tricky mentioned: floating vs. fixed, LUT vs. logic - there's different ways you can do it, but the above is what you can get "for free".

    Good luck.