First page Back Continue Last page Overview Graphics
Scaling and Offsetting Procedure
Find two integers whose ratio is equal to the fractional value to scale by.
Multiply and then divide the number to be scaled by the respective integers.
An offset can be added to the scaled result.
In the previous example, what is the scaling ratio for the A/D output?
Using the techniques allows the programmer to scale data efficiently and easily.
Multiply before dividing to avoid losing significant data. Make sure the destination register cannot overflow after the multiplication.