converting floating point number to integer and vice versa

F

FPGA

Guest
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
 
On 4 Jan, 17:08, FPGA <FPGA.unkn...@gmail.com> wrote:
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?
 
On Jan 4, 12:56 pm, Jon Beniston <j...@beniston.com> wrote:
On 4 Jan, 17:08, FPGA <FPGA.unkn...@gmail.com> wrote:

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?
yes
 
On Fri, 4 Jan 2008 10:15:45 -0800 (PST), FPGA <FPGA.unknown@gmail.com>
wrote:

On Jan 4, 12:56 pm, Jon Beniston <j...@beniston.com> wrote:
On 4 Jan, 17:08, FPGA <FPGA.unkn...@gmail.com> wrote:

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?

yes
do we get the diploma if we answer or does it still go to you?
 
"FPGA" <FPGA.unknown@gmail.com> wrote in message
news:d058a299-05ae-41aa-80de-be4db769c99c@f3g2000hsg.googlegroups.com...
On Jan 4, 12:56 pm, Jon Beniston <j...@beniston.com> wrote:
On 4 Jan, 17:08, FPGA <FPGA.unkn...@gmail.com> wrote:

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?

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
 
On 4 Jan., 23:09, "HT-Lab" <han...@ht-lab.com> wrote:
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
 

Welcome to EDABoard.com

Sponsor

Back
Top