From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,183ebe04e93f0506 X-Google-Attributes: gid103376,public X-Google-Thread: 107079,183ebe04e93f0506 X-Google-Attributes: gid107079,public From: vince.delvecchio@see-below.analog.com (Vince Del Vecchio) Subject: Re: fixed point vs floating point Date: 1997/11/24 Message-ID: <65cc5r$k5@nwd2nws1.analog.com>#1/1 X-Deja-AN: 292232105 References: Organization: analog.com Newsgroups: comp.lang.ada,sci.math.num-analysis Date: 1997-11-24T00:00:00+00:00 List-Id: Date: 24 Nov 1997 12:10:12 -0500 Message-ID: Organization: Analog Devices CPD Lines: 39 X-Newsreader: Gnus v5.3/Emacs 19.33 mheaney@ni.net (Matthew Heaney) writes: > Let's change the problem a bit. What's more expensive: to calculate the > sine of a fixed point with a binary small, or to calculate the sine of a > floating point? What about making the fixed point 32 bits instead of 64 - > will that make it more efficient? > > That processor Intermetrics is building an Ada compiler for (SHARC, or > something like that) comes with "fixed point math in hardware." Will that > make any difference in efficiency? The SHARC (and other Analog Devices DSPs) only support fixed-point math with a fixed binary point. Specifically, they support type Signed_Fixed is delta 2**(-Word_Size + 1) range -1.0 .. 1.0; and type Unsigned_Fixed is delta 2**(-Word_Size) range 0.0 .. 1.0; where small == delta, upper endpoint is not a member of the type, and, for Sharc, Word_Size == 32. The difference from many other processors is that they have operations for Signed_Fixed * Signed_Fixed => Signed_Fixed Unsigned_Fixed * Unsigned_Fixed => Unsigned_Fixed where the shifting you need to do is built to the instruction. For arbitrary smalls, it probably won't be any faster than on other processors, but if you restricted yourself to certain smalls, it would be possible to be as efficient as floating-point. On the other hand, for the Sharc specifically, there is no fixed point sin routine in the C runtime library (or the Ada runtime library, for that matter). That is mostly because the processor also has floating point, and I think most people use the floating point. Fixed point transcendental operations are much more prevalent on our fixed-point-only processors. -Vince Del Vecchio vince.delvecchio@analog.com Not speaking for Analog Devices