Shifter; Arithmetic Shift - Analog Devices adsp-2100 Manual

Adsp-2100 family programmable single-chip microprocessors
Table of Contents

Advertisement

SHIFTER

15

ARITHMETIC SHIFT

Syntax:
Permissible xops
SI
SR1
SR0
Example:
Description:
designated arithmetic shift. If the condition is not true then perform a no-
operation. Omitting the condition performs the shift unconditionally. The
operation arithmetically shifts the bits of the operand by the amount and
direction specified in the Shift Code from the SE register. Positive Shift
Codes cause a left shift (upshift) and negative codes cause a right shift
(downshift).
The shift may be referenced to the upper half of the output field (HI
option) or to the lower half (LO option). The shift output may be logically
ORed with the present contents of the SR register by selecting the SR OR
option.
For ASHIFT with a positive Shift Code (i.e. positive value in SE), the
operand is shifted left; with a negative Shift Code (i.e. negative value in
SE), the operand is shifted right. The number of positions shifted is the
count in the Shift Code. The 32-bit output field is sign-extended to the left
(the MSB of the input is replicated to the left), and the output is zero-filled
from the right. Bits shifted out of the high order bit in the 32-bit
destination field (SR
the destination field (SR
To shift a double precision number, the same Shift Code is used for both
halves of the number. On the first cycle, the upper half of the number is
shifted using an ASHIFT with the HI option; on the following cycle, the
lower half of the number is shifted using an LSHIFT with the LO and OR
options. This prevents sign bit extension of the lower word's MSB.
Status Generated:
15 – 50
[ IF cond ] SR = [SR OR] ASHIFT xop
Permissible conds (see Table 15.9)
AR
EQ
MR2
NE
MR1
GT
MR0
GE
LT
IF LT SR = SR OR ASHIFT SI (LO);
Test the optional condition and, if true, then perform the
) are dropped. Bits shifted out of the low order bit in
31
) are dropped.
0
None affected.
LE
AC
NEG
NOT AC
POS
MV
AV
NOT MV
NOT AV
NOT CE
(HI)
;
(LO)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents