Fractional And Integer Data Alu Arithmetic - Motorola DSP56800 Manual

16-bit digital signal processor
Table of Contents

Advertisement

Data Arithmetic Logic Unit
Example 3-6. Converting a 36-Bit Accumulator to a 16-Bit Value
MOVE
A1,A
MOVE
A1,B
MOVE
A,A
MOVE
A,B
Where limiting is enabled, as in the second example in Example 3-6, limiting only occurs when the
extension register is in use. You can determine if the extension register is in use by examining the
extension bit (E) of the status register. Refer to Section 5.1.8, "Status Register," on page 5-6.
3.3

Fractional and Integer Data ALU Arithmetic

The ability to perform both integer and fractional arithmetic is one of the strengths of the DSP56800
architecture; there is a need for both types of arithmetic.
Fractional arithmetic is typically required for computation-intensive algorithms such as digital filters,
speech coders, vector and array processing, digital control, and other signal-processing tasks. In this mode
the data is interpreted as fractional values, and the computations are performed interpreting the data as
fractional. Often, saturation is used when performing calculations in this mode to prevent the severe
distortion that occurs in an output signal generated from a result where a computation overflows without
saturation (see Figure 3-14 on page 3-28). Saturation can be selectively enabled or disabled so that
intermediate calculations can be performed without limiting, and limiting is only done on final results (see
Example 3-7).
0.5 x 0.25 = 0.125
0.625 + 0.25 = 0.875
0.125 / 0.5 = 0.25
0.5 >> 1 = 0.25
Integer arithmetic, on the other hand, is invaluable for controller code, for array indexing and address
computations, compilers, peripheral setup and handling, bit manipulation, bit-exact algorithms, and other
general-purpose tasks. Typically, saturation is not used in this mode, but is available if desired. (See
Example 3-8.)
4 x 3 = 12
1201 + 79 = 1280
63 / 9 = 7
100 << 1 = 200
The main difference between fractional and integer representations is the location of the decimal (or
binary) point. For fractional arithmetic, the decimal (or binary) point is always located immediately to the
right of the MSP's most significant bit; for integer values, it is always located immediately to the right of
the value's LSB. Figure 3-8 on page 3-15 shows the location of the decimal point (binary point), bit
weightings, and operands alignment for different fractional and integer representations supported on the
DSP56800 architecture.
3-14
;Converting with No Limiting
;Sign Extend A2, A0 set to $0000
;Sign Extend B2, B0 set to $0000
;Converting with Limiting Enabled
;Sign Extend A2, Limit if Required
;Sign Extend B2, Limit if Required
Example 3-7. Fractional Arithmetic Examples
Example 3-8. Integer Arithmetic Examples
DSP56800 Family Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents