converting floating point number to integer and vice versa

F

FPGA

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
 
J

Jon Beniston

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

Is this homework / an assignment?
 
H

HT-Lab

Is this homework / an assignment?

yes

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
www.ht-lab.com
 
T

Thomas Stanka

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.

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

bye Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top