dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 160

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Data Arithmetic Logic Unit
In order for the accumulator to be pushed on the stack 32 bits at a time, the stack pointer must be aligned to
an odd word address. See Section 3.5.3, “Accessing Long-Word Values Using Word Pointers,” on
page 3-19 for more information.
5.2.7
The DSP56800E bit-manipulation instructions operate in a read-modify-write sequence: the value to be
manipulated is read into a temporary register, modified according to the instruction, and written back to its
original location. The “read” portion of this sequence is performed as if a MOVE.W instruction had been
executed, and thus may cause saturation to occur if an entire accumulator register is specified. In order for
bit-manipulation operations to execute correctly, saturation must be disabled. For this reason,
bit-manipulation instructions should always be performed on the FF1 portion of a register (A1, for
example) instead of the entire register, as demonstrated in Example 5-14.
5.3
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,
data is interpreted as fractional values, and computations are performed accordingly. When calculations
are performed in this mode, saturation is often used to prevent a problem that occurs without saturation: an
output signal that is generated from a result where a computation overflows without saturation can be
severely distorted (see Figure 5-27 on page 5-40). Saturation can be selectively enabled and disabled so
that intermediate calculations are performed without limiting and so that only the final results are limited.
Integer arithmetic is typically used in controller code, array indexing and address computations, peripheral
setup and handling, bit manipulation, bit-exact algorithms, and other general-purpose tasks. Typically,
saturation is not used when integers are processed, but it is available if desired.
5-14
Fractional and Integer Arithmetic
Bit-Manipulation Operations on Accumulators
; Saving the A accumulator to the Stack
ADDA
MOVE.L
MOVE.L
; Restoring the A accumulator from the Stack
MOVE.L
MOVE.L
; BFSET using the A register
BFSET
; BFSET using the A1 register
BFSET
Example 5-13. Saving and Restoring an Accumulator—Long Accesses
Example 5-14. Bit Manipulation on a DSP56800E Accumulator
#2,SP
A2,X:(SP)+
A10,X:(SP)
X:(SP)-,A
X:(SP)-,A2
#$0F00,A
#$0F00,A1
DSP56800E Core Reference Manual
; Point to first empty location
; Save extension register
; Save A1 and A0 registers
; Restore A1 and A0 (changes A2)
; Restore extension register
; Reads A1 with saturation enabled - can limit
; Sets bits 11 through 8 and stores back to A1
; A2 is sign extended and A0 is cleared
; Reads A1 with saturation disabled
; Sets bits 11 through 8 and stores back to A1
; Note: A2 and A0 unmodified
Freescale Semiconductor

Related parts for dsp56800e