Hi When converting from floating to fixed point, is there any general tolerance to consider the result acceptable? Thanks Azizah
Fixed Point Conformance
Started by ●December 30, 2010
Reply by ●December 30, 20102010-12-30
azizah <atlantis353@n_o_s_p_a_m.googlemail.com> wrote:> When converting from floating to fixed point, is there any general > tolerance to consider the result acceptable?It is usual to truncate the result, and most people have considered that acceptable. If not, you can add (or subtract for negative values) an appropriate amount. -- glen
Reply by ●December 31, 20102010-12-31
On Dec 30, 8:59�am, "azizah" <atlantis353@n_o_s_p_a_m.googlemail.com> wrote:> When converting from floating to fixed point, is there any general > tolerance to consider the result acceptable?even given the same word width (say 32-bit), sometimes fixed point has better precision than floating point. maybe it's the floating-point value that lies outside of limits of tolerance regarding error. r b-j
Reply by ●December 31, 20102010-12-31
On Thu, 30 Dec 2010 21:59:04 -0800 (PST), robert bristow-johnson <rbj@audioimagination.com> wrote:>On Dec 30, 8:59�am, "azizah" <atlantis353@n_o_s_p_a_m.googlemail.com> >wrote: > >> When converting from floating to fixed point, is there any general >> tolerance to consider the result acceptable? > >even given the same word width (say 32-bit), sometimes fixed point has >better precision than floating point. maybe it's the floating-point >value that lies outside of limits of tolerance regarding error.For any word-width fixed point will have better precision for values which are exactly representable in both formats. What floating point gives you for the loss in precision is dynamic range. FP allows you to represent numbers much larger in value but you give up precision to do it. This makes it easier to develop DSP algorithms as one doesn't have to pay attention to all the scaling, overflows, wrap-arounds etc. but comes at a high hardware cost (cost of chips and power). -- Muzaffer Kal DSPIA INC. ASIC/FPGA Design Services http://www.dspia.com
Reply by ●January 1, 20112011-01-01
every time you quantize, you will introduce noise. hence SNR analysis will help to tell at what bit precision values you need to stop. Bharat
Reply by ●January 1, 20112011-01-01
On 12/30/2010 08:59 AM, azizah wrote:> Hi > When converting from floating to fixed point, is there any general > tolerance to consider the result acceptable? > Thanks > AzizahHi Azizah, In addition to the other helpful comments that have already been posted, I'd like to add that, if you're doing multiply-accumulates, 16-bit fixed-point arithmetic can be _better_ than 32-bit floating point. The problem with doing a floating-point multiply-accumulate is that, barring special architectures, EVERY multiply has to requantize and EVERY accumulation has to requantize. This is not so for fixed-point processing when the accumulator has guard bits, and nearly all modern-day DSPs include guard bits. However, some architectures like the x86, have special extended-precision (80-bit) floating-point registers that can mitigate the extra quantization problem. I thought this may be relevent to your design. -- Randy Yates % "My Shangri-la has gone away, fading like Digital Signal Labs % the Beatles on 'Hey Jude'" yates@digitalsignallabs.com % http://www.digitalsignallabs.com % 'Shangri-La', *A New World Record*, ELO
Reply by ●January 1, 20112011-01-01
On 12/30/2010 05:59 AM, azizah wrote:> Hi > When converting from floating to fixed point, is there any general > tolerance to consider the result acceptable?Generally, the tolerance needs to be good enough for the application at hand. If the number isn't known to any better than +/- 0.5% of the full range, then you only need 8 bits of precision. If the number needs to be known to better than 300 ppb of full range then single-precision floating point isn't good enough. So, you're probably stuck with doing some analysis. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html
Reply by ●January 1, 20112011-01-01
>On 12/30/2010 08:59 AM, azizah wrote: >> Hi >> When converting from floating to fixed point, is there any general >> tolerance to consider the result acceptable? >> Thanks >> Azizah > >Hi Azizah, > >In addition to the other helpful comments that have already been >posted, I'd like to add that, if you're doing multiply-accumulates, >16-bit fixed-point arithmetic can be _better_ than 32-bit floating >point. > >The problem with doing a floating-point multiply-accumulate is that, >barring special architectures, EVERY multiply has to requantize and >EVERY accumulation has to requantize. This is not so for fixed-point >processing when the accumulator has guard bits, and nearly all >modern-day DSPs include guard bits. > >However, some architectures like the x86, have special >extended-precision (80-bit) floating-point registers that can mitigate >the extra quantization problem.That's only true if you are using the ancient x87 instruction set. The modern SSE based floating point instructions do not have those extra bits. In 64 bit mode, a Pentium/Athlon chip doesn't even support the old x87 instruction set.>I thought this may be relevant to your design.Steve
Reply by ●January 2, 20112011-01-02
On 01/01/2011 10:33 PM, steveu wrote:> [Randy wrote:] > [...] >> However, some architectures like the x86, have special >> extended-precision (80-bit) floating-point registers that can mitigate >> the extra quantization problem. > > That's only true if you are using the ancient x87 instruction set.I agree with the fact that it's only in the x87 instruction set.> The modern SSE based floating point instructions do not have those > extra bits.Agreed.> In 64 bit mode, a Pentium/Athlon chip doesn't even support the old x87 > instruction set.This is not true. In "Volume 1, Basic Architecture" of the "Intel 64 and IA-32 Architectures Software Developer's Manual" (Sept 2006) it is stated in section 8.1.1: In compatibility mode and 64-bit mode, x87 FPU instructions function like they do in protected mode. In those modes the 80-bit registers are present. How they interact with the extended-precision registers available in the SSE2 instructions is not clear to me, but they are apparently there and available for use in the old x87 instructions. -- Randy Yates % "My Shangri-la has gone away, fading like Digital Signal Labs % the Beatles on 'Hey Jude'" yates@digitalsignallabs.com % http://www.digitalsignallabs.com % 'Shangri-La', *A New World Record*, ELO
Reply by ●January 2, 20112011-01-02
>On 01/01/2011 10:33 PM, steveu wrote: >> [Randy wrote:] >> [...] >>> However, some architectures like the x86, have special >>> extended-precision (80-bit) floating-point registers that can mitigate >>> the extra quantization problem. >> >> That's only true if you are using the ancient x87 instruction set. > >I agree with the fact that it's only in the x87 instruction set. > >> The modern SSE based floating point instructions do not have those >> extra bits. > >Agreed. > >> In 64 bit mode, a Pentium/Athlon chip doesn't even support the old x87 >> instruction set. > >This is not true. In "Volume 1, Basic Architecture" of the "Intel 64 >and IA-32 Architectures Software Developer's Manual" (Sept 2006) it is >stated in section 8.1.1: > > In compatibility mode and 64-bit mode, x87 FPU instructions function > like they do in protected mode. > >In those modes the 80-bit registers are present. How they interact with >the extended-precision registers available in the SSE2 instructions is >not clear to me, but they are apparently there and available for use >in the old x87 instructions.Interesting. Maybe I confused "no compiler ever uses them" with "they aren't present". Steve






