The difference b/w floating-point & fix-point implementa

Status
Not open for further replies.

vaf20

Full Member level 3
Joined
Jan 27, 2003
Messages
174
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,479
Float or Fix

hi all my friends
what's conceptual diff b/w floating-point and fix-point implementation?
tnx in advance
 

Re: Float or Fix

fixed point has limited range of values depending on the number of bits being used. Floating point is able to represent a huge range (Comparitively) because it has an exponent attached. Fixed is more accurate (for the same number of bits because more bits represent the mantissa.) The errors if fixed are easy to calculate. Floating point is generally easier to implement because of the fact that there are most time libraries available with the complier. Fixed is faster to execute operations.
 

Float or Fix

You can also evaluate these concepts with careful considerations into the present Digital Signal Processors, like TI and ADI's processers. Apart from the reasons explained above, one of the most important feathures of FIXED point calculation is the LOW POWER issue, which makes long-life battaries possible for mobile terminals.
 

Re: Float or Fix

hi
does anyone write HDL code or implement any unit through floating point?
because of this fact that basic function implementation is differ to fixed point.
can ne1 give me link to floating piont HDL design ?
 

Re: Float or Fix

floating point numbers are generally represeted as
<pre>
exponent
±mantissa × 2
</pre>
 

Re: Float or Fix

hi
how can i convert integer to floating point and vice versa in VHDL?
tnx ahead
 

Re: Float or Fix

ALU operations are easier in fixed point as the position of the decimal is fixed. Therefore to add, subtract no change is needed in decimal position whereas in floating point the decimal position floats around and shifting is needed to correctly align the decimals before two numbers can be operated upon.
 

Re: Float or Fix

Converting from int to float is easy.
set the sign according to the mostsig bit of your int. then abs your int.
set the mantissa to the value of your int (you may need to shift depending on what size int and what size float.)
Set your exp to 1.

If you are using IEEE then you will need to store with the decimal place in a particular postion I can't remeber for sure but I think that it is x.xxxxx e5 for example so that the decimal point has only one number left of it. So first divide your int by a number that will give you x.x and is 1e N and set the exp to N.

to convert the other way first decide if your value is able to be converted ie in range for int representation, that is not not 1.2 e 120.
Now multiply by 1eN where N is the value of the exp. and move your mantisa to the int discarding all after the decimal. You need to do a little work to preserve the sign.

Also note that you do not need to write this stuff there is plenty of people who have written it already. try looking at www.opencores.org.
 

Re: Float or Fix

tnx mc_navman
can u give me a link to integer2float writen code in opencores which u mentioned?
tnx again
 

Re: Float or Fix

I think that you will need to write the int to float section yourself.
here is a link to a float multiply.
**broken link removed**
I dont know if this link will work because I was logged in but it is some floating point stuff for Altera NIOS.
**broken link removed**
I did try to use the bottom one but it was not finished. I am working on it but I cannot post my work, it is owned by my company.
 

Float or Fix

i have the same question. when i develop a board of FFT , i met a problem . that is how can i simulate the algrithm and how can i have distinguishment of difference between fixed and floating. how can i make a conclusion on wether the result of simulatio n meet with the need of design?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…