필터 지우기
필터 지우기

Floating point to fixed point

조회 수: 2 (최근 30일)
freebil
freebil 2013년 10월 2일
댓글: Walter Roberson 2013년 10월 3일
Hello. I want to convert some floating point values to fixed point with the best precision i can have for 20 bits. My range of values is [-1000,1000]. I have already rounded my values by using less bits in the mantissa. I used 10 bits(mantissa) and my numbers were pretty close. If i use fixed point numbers, can I make it better? Thanks

답변 (1개)

Walter Roberson
Walter Roberson 2013년 10월 2일
You will need 11 bits to represent the integer portion of -1000 to +1000. That will leave 9 bits of the 20 available for the fraction. It sounds like you want 10 bits after the decimal place. That will not fit.
  댓글 수: 2
freebil
freebil 2013년 10월 2일
Thanks for the answer. Is there any other function than fi?
Walter Roberson
Walter Roberson 2013년 10월 3일
The best precision that you could have in 20 bits would probably be by using floating point instead of fixed point. With 20 bits you would not be able to always get 10 bits after the decimal point: you would get at best 9 bits of precision but those 9 bits of precision might be spaced less than 1/512 apart near 0 (and furthest apart near -1000 and +1000)
Do you need the precision to be uniformly distributed over the range -1000 to +1000, or is there a particular location in there where the spacing between adjacent values should be less than 1/512 (e.g., near 0) ? If so, where, and how much precision near +/- 1000 are you willing to give up to gain extra digits near the important point?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by