Electronic – Some pointers on how to begin VHDL writing

fpgasimulationsynthesisvhdl

I'm currently doing some tutorials and reading some books on how to write VHDL. As I'm curious and learn better with hands-on tutorials I'm going to start implementing my projects that will serve me well in the future.

For my first real project I'm trying to implement an arctg function followed by an aggregation operator function.

I don't want to reinvent the wheel and I don't want to be further confused and so I'm asking here the following questions:

  1. The integer to float and vice-versa with the bits of the mantissa, exponent and integer is necessary right? Isn't there any website where people have already implemented this kind of things and share with the community?
  2. I've seen somewhere that the package math_real already has an ARCTANfunction which accepts a REAL which I guess is a float. So:

    2.1. Is this synthesizable? If not why is it even coded?

    2.2. If everything needs to be converted from float to integer in order to be passed between functions, why does ARCTAN accept REAL and not an integer?

Best Answer

VHDL-2008 has synthesisable fixed-point and floating-point libraries, in addition to ieee.math_real which is strictly for simulation. You can instantiate the float package with any width of mantissa and exponent, or use the pre-defined float types (roughly IEEE P754). The fixed point package is a better choice for DSP, and usually produces smaller hardware.

These libraries should handle question (1) for you.

For question 2)

  1. The math_real ARCTAN is used in simulation, not for synthesis.
  2. Question makes no sense as you can pass reals to and from functions.
Related Topic