Op Mon, 26 Mar 2012 11:22:21 +0200 schreef kishor <(E-Mail Removed)>:

> Hi friends,

> I am working on stellaris LM3s6965 (cortex-m3) & Keil 4.20 for data

> acquisition. ADC is signed 24-bit.

>

> To perform software Gain calibration I have two options,

>

> 1. 64-bit fixed width arithmetic

> ADC_Reading = ((int64_t)ADC_Reading * Gain) / 0x8000;

> 2. Single precision Float

> ADC_Reading = ADC_Reading * Gain;

>

> Which is better for performance wise[?]
An (u)int64_t multiplication is always faster than a float multiplication,

assuming you don't have a hardware FPU.

Also, if you can deal with some loss of precision, you can pre-divide both

operands enough to be able to use 32-bit multiplication.

--

Gemaakt met Opera's revolutionaire e-mailprogramma:

http://www.opera.com/mail/
(Remove the obvious prefix to reply privately.)