Algorithm Examples - Motorola DSP56800 Manual

16-bit digital signal processor
Table of Contents

Advertisement

Software Techniques
8.4.4

Algorithm Examples

This subsection provides examples of values calculated with the division algorithms in this section.
A simple example of fractional division is the following case:
0.125 / 0.5 = 0.25
For this case a positive fractional algorithm can be selected. Converting the fractional numbers into hex gives the fol-
lowing division:
$10000000 / $4000
This gives the following results:
quotient = $2000 = 0.25
remainder = 0
Another example of fractional division is the following case:
-0.2628712165169417858123779297 / 0.39035034179687500 = -0.6734008789062500
For this case a four-quadrant fractional algorithm can be selected. Converting the fractional numbers into hex gives
the following division:
$de5a3c69 / $31f7
This gives the following results:
quotient = $a9ce = -0.6734008789062500
A simple example of integer division is the following case:
64 / 9 = 7 (remainder = 1)
For this case a positive integer algorithm can be selected. Converting the integer numbers into hex gives the follow-
ing division:
$00000040 / $0009
This gives the following results:
quotient = $0007 = 7
remainder = 1
Another example of integer division is the following case:
-492789125 / -15896 = 31000
For this case a four-quadrant integer algorithm can be selected. Converting the integer numbers into hex gives the
following division:
$e2a0a27b / $c1e8
This gives the following results:
quotient = $7918 = 31000
The results can be easily checked by multiplying the quotient by the divisor and adding the remainder to
this product. The final answer should be the same as the original dividend.
8-18
Example 8-6. Simple Fractional Division
Example 8-7. Signed Fractional Division
Example 8-8. Simple Integer Division
Example 8-9. Signed Integer Division
DSP56800 Family Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents