dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 173

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
5.3.6.3
Three instructions—ASL16, ASR16, and LSR16—shift an entire 36-bit accumulator by 16 bits in 1 cycle.
LSR16 and ASR16 logically or arithmetically shift a 36-bit accumulator 16 bits to the right, and are useful
for converting 16-bit values to 32-bit long values that are unsigned and signed, respectively. When it is
necessary to convert a 16-bit value to a 32-bit integer, the FF1 portion must be shifted into the FF0 portion,
and the FF2 portion must be shifted into the 4 LSBs of the FF1 portion. In this manner, the original 16-bit
value is represented as a 32-bit integer. The ASL16 instruction shifts a 36-bit accumulator 16 bits to the
left, filling the FF0 portion with $0000 and the extension register with what were previously the 4 LSBs of
the original FF1 portion.
5.3.6.4
The ASRAC and LSRAC instructions are unique in that they arithmetically or logically right shift a 16-bit
value into a 32-bit field and add the result to the previous value of the accumulator. For these two
instructions, the least significant bits of the MSP are shifted into the most significant bits of the LSP.
5.4
The DSP56800E can perform both unsigned and signed arithmetic operations. The addition, subtraction,
multiplication, and comparison instructions work for both signed and unsigned values, but the condition
code computations are different.
5.4.1
Unsigned arithmetic operations such as addition, subtraction, comparison, and logical operations are
performed with the same instructions, and in the same manner, as for signed computations. The difference
between signed and unsigned operations involves how the data is interpreted (Section 3.2.1, “Data
Formats,” on page 3-6) and which status bits are affected when comparing signed and unsigned numbers.
The difference in the way condition codes are calculated is most evident with any of the conditional jump
and branch instructions, such as Bcc and Jcc. These instructions perform an operation based on the state of
the condition codes, which may be set differently depending on whether a signed or unsigned calculation
has been performed to generate the value tested by the instruction.
Specifically, the following conditions should be used for signed values:
These conditions should be used instead for unsigned values:
Note that the HS condition is identical to carry clear (CC) and that LO is identical to carry set (CS).
Freescale Semiconductor
GE—greater than or equal to
LE—less than or equal to
GT—greater than
LT—less than
HS (high or same)—unsigned greater than or equal to
LS (low or same)—unsigned less than or equal to
HI (high)—unsigned greater than
LO (low)—unsigned less than
Unsigned Arithmetic Operations
Condition Codes for Unsigned Operations
Shifting Accumulators by 16 Bits
Shifting with Accumulation
Data Arithmetic Logic Unit
Unsigned Arithmetic Operations
5-27

Related parts for dsp56800e