Fixed-Point Blockset    
Shift Arithmetic

Shift the bits and/or radix point of a signal

Library

Bits

Description

The Shift Arithmetic block can be used to shift the bits or the radix point of a signal, or both.

For example, the effects of radix point shifts two places to the right and two places to the left on an input of data type sfix(8) are shown below.

Shift Operation
Binary Value
Decimal Value
No shift (original number)
11001.011
-6.625
Radix point shift right by 2 places
1100101.1
-26.5
Radix point shift left by 2 places
110.01011
-1.65625

This block performs arithmetic bit shifts on signed numbers. Therefore, the most significant bit is recycled for each bit shift. The effects of bit shifts two places to the right and two places to the left on an input of data type sfix(8) follow.

Shift Operation
Binary Value
Decimal Value
No shift (original number)
11001.011
-6.625
Bit shift right by 2 places                 
11110.010
-1.75
Bit shift left by 2 places
00101.100
5.5

Parameters and Dialog Box

Shift bits right how many places (negative is shift left)
The number of places the bits of the input signal is shifted. A positive value indicates a shift right, while a negative value indicates a shift left.
Shift binary point right how many places (negative is shift left)
The number of places the radix point of the input signal is shifted. A positive value indicates a shift right, while a negative value indicates a shift left.

Characteristics

Input Port
Any data type supported by the blockset. Inputs may be scalar or vector.
Output Port
Any data type supported by the blockset. Output is scalar if the input is scalar, and vector if the input is vector.
Direct Feedthrough
Yes
Sample Time
Inherited
Scalar Expansion
No
Vectorized
Yes, accepts vector inputs


  Scaling Strip Sign