EasyManua.ls Logo

IMC CANSAS - Integer-Arithmetic

IMC CANSAS
582 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Data formats 133
imc CANSAS Users Manual - Doc. Version 1.9 - 05.12.2014© 2014 imc Meßsysteme GmbH
4.4 Integer-arithmetic
The imc CANSAS-module uses an integer processor. Calculational functions therefore must manage with
16-bit Integer-arithmetic. Computations with real numbers on the Integer-processor are possible in
principle, but require excessive time. The computational functions' algorithms therefore are always
compromises of processor time and precision.
The imc CANSAS-module mainly works with integers. The numerical range extends from -32767 to
+32767 in whole numbers. Though scaling factor and offset can produce large real numbers, internally
this small value range is all that is available for computations. This means that any real number range can
be simulated, but that not every number within such a range can be expressed. There are always only
65535 different result values possible. Due to the number range's symmetry around the value 0 the
number -32768 is not used.
For instance, with a factor of 1,0 and an offset of 0,0, the numerical range is -32767,0 ... +32767,0. A 13
as an integer stands for all value between 12,5 and 13,5. If the factor and offset are 100,0 and 0,0, 13
stands for all values from 1250 to 1350.
The results of computations can therefore in principle deviate from the technically correct value by 1 LSB.
And some particular functions, such as inverse value, can deliver results which deviate from the expected
results by several LSB's.
This difficulty is especially evident when multiplying two Integer-values: The result channel can also only
be expressed as the Integer-values -32767 to +32767, just as the two channels which were multiplied. For
instance, the product of 2
15
and 2
15
is 2
30
. The value 2
30
is reduced to 16 bits, so the lowest 16 bits are
simply dropped. Taken together with technicalities of the value range scaling, cases can thus arise when 1
* 1 returns 0. But multiplication can be employed sensibly, as illustrated by the following example: Power
= current * voltage. For measurement ranges of 0 .. 4 A for the current and 0 .. 5 V for the voltage, the
result value range is 0 .. 20 W. The value range 0 .. 20 W can indeed be expressed sensibly with 16 bits.

Table of Contents

Other manuals for IMC CANSAS