dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 154

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Data Arithmetic Logic Unit
5.2.1
The accumulator registers serve as the source or destination for most data ALU operations. The result of an
ALU or multiplication operation is typically a full 36-bit value that, when written to an accumulator,
affects the entire register. Inputs for most arithmetic operations are also full-precision 36-bit accumulator
values.
The entire accumulator register can also be accessed with the explicit execution of a MOVE instruction.
Contents from the 32-bit CDBR bus can be written to all accumulators (A, B, C, or D) with sign extension
propagated to the 4-bit extension register (A2, B2, C2, or D2). When the contents of the 36-bit accumulator
need to be limited, the SAT instruction can be used to saturate the value in the 36-bit accumulator, limiting
with the full-scale positive or negative 32-bit values ($7FFF:FFFF or $8000:0000).
5.2.1.1
Automatic sign or zero extension of the 36-bit accumulators is provided when the FF accumulator is
written with a smaller size operand. The extension can occur when FF is written from the CDBR
(MOVE.B, MOVEU.B, MOVE.W, or MOVE.L instruction) or with the results of certain data ALU
operations (for example, ADD.L, SUB.L, or TFR from a 16-bit register to a 36-bit accumulator). If a word
operand is to be written to an accumulator register (FF), the FF1 portion of the accumulator is written with
the word operand, the FF0 portion is zeroed, and the FF2 portion receives sign extension.
Figure 5-5 shows some examples of writing word values to an accumulator. Note that all three portions of
the accumulator are modified by these instructions.
A move instruction that moves one accumulator to another, or a MOVE.L instruction with an immediate
value, behaves similarly. This result does not occur for the TFR instruction; no sign extension is performed
when TFR transfers a smaller register to an accumulator.
When an unsigned value is moved into an accumulator, the extension (FF2) portion of the accumulator
must be cleared because the most significant bit might be set. Automatic sign extension causes this bit to
be propagated into the extension register, making the value negative. Unsigned loads of words or long
words to an accumulator are performed using the technique in Example 5-3 on page 5-9.
5-8
B
B
Accessing an Entire Accumulator
35 32 31
35 32 31
Writing a Negative Value into 36-Bit Accumulator:
Writing a Positive Value into 36-Bit Accumulator:
B2
B2
Writing an Accumulator with a Small Operand
X
X
X
X
Before Execution
Before Execution
X
X
B1
B1
X
X
Figure 5-5. Writing the Accumulator as a Whole
X
X
16 15
16 15
DSP56800E Core Reference Manual
X
X
X
X
B0
B0
X
X
X
X
0
0
B
B
35 32 31
35 32 31
MOVE.W #$1234,B
MOVE.W #$A987,B
B2
B2
0
F
1
A
After Execution
2
After Execution
9
B1
B1
3
8
4
16 15
7
16 15
Freescale Semiconductor
0
0
0
0
B0
B0
0
0
0
0
0
0

Related parts for dsp56800e