converting floating point number to integer and vice versa

I want to write a function to

1) convert single precision 32 bit floating point number to integer and return integer 2) convert integer to single precision floating point number and return 32 bit floating point

What are the parameters I should give to each functions and what logic do I use for both the functions.

Do i need to write seperate function for signed and unsigned numbers?

Your help would be appreciated

Reply to
FPGA
Loading thread data ...

Is this homework / an assignment?

Reply to
Jon Beniston

yes

Reply to
FPGA

do we get the diploma if we answer or does it still go to you?

Reply to
MikeShepherd564

At least you are honest.

I would suggest you search the web first since there is a lot of stuff available on-line and then come back with specific questions.

If you know a bit of C/C++ then I would suggest you also look at GCC's floatlibc.c which contains these 2 functions, if you understand them then translating them to VHDL shouldn't be too difficult.

Good luck! Hans

formatting link

Reply to
HT-Lab

I would suggest "+float +vhdl" and take the first hit in google for a careful inspection.

bye Thomas

Reply to
Thomas Stanka

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.