Real Time Systems Design And Analysis

Chapter 7.5.2 - Scaled Numbers

7.5.2   Scaled Numbers

In virtually all computers, integer operations are faster than floating-point ones.
This fact can be exploited by converting floating-point algorithms into scaled
integer algorithms. In these so-called scaled numbers, the least significant bit
(LSB) of an integer variable is assigned a real number scale factor. Scaled
numbers can be added and subtracted together and multiplied and divided by
a constant (but not another scaled number). The results are converted to floating
point only at the last step, thus saving considerable time. For example,
suppose an analog-to-digital (A/D) converter is converting accelerometer data.
If the least significant bit of the two’s complement 16-bit integer has value
0.0000153 ft/s2, then any acceleration can be represented up to the maximum
value of (215 − 1)*0.0000153 = 0.5013351 ft/s2. The 16-bit number 0000 0000
0001 011, for example, represents an acceleration of 0.0001683 ft/s2.

A common practice is to quickly convert the integer number into its floating-
point equivalent by xf = x · 0.0000153 and then proceed to use it in calculations
directly with other converted numbers; for example, diff = xfzf, where zf
is a similarly converted floating-point number. Instead, the calculation can be
performed in integer form first and then converted to floating point:
diff = (xz) · 0.0000153.

For applications involving the numerous addition and subtraction of like data,
scaled numbers can introduce significant savings. Note, however, that multiplication
and division by another scaled number cannot be performed on a scaled
number as those operations change the scale factor. Finally, accuracy is generally
sacrificed by excessive use of scaled numbers.

UNLIMITED FREE ACCESS TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: PCMCIA Memory Cards
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.