Engee documentation

Bit Shift

Logic or arithmetic shift of the input signal.

bit shift

Description

The Bit Shift block performs a logical or arithmetic shift of the input signal.

The behaviour of this block during simulation and code generation differs from the block Shift Arithmetic.

The Shift Arithmetic block shifts the bits or binary point of the input number. This block has additional options for code generation compared to the Bit Shift block. When a variable shift operation is required, use the Shift Arithmetic block instead of the Bit Shift block. If a signed number is input, the block performs a signed digit expansion.

Ports

Input

Port_1 - input signal
scalar | vector | matrix

Input signal for which a logical or arithmetic shift is performed.

  • Minimum bit width: 2.

  • Maximum bit width: 128.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, Int128, UInt128 UInt8, UInt16, UInt32, UInt64, Bool, Fixed.

*Support for complex numbers: Yes

Output

Port_1 - output signal
scalar | vector | matrix

An output signal for which a logical or arithmetic shift has been performed. The output signal has the same data type and size as the input signal.

  • Minimum bit width: 2.

  • Maximum bit width: 128.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, Int128, UInt128 UInt8, UInt16, UInt32, UInt64, Bool, Fixed.

*Support for complex numbers: Yes

Parameters

Shift Mode - shift type and direction
Shift Left Logical (by default) | Shift Right Logical | Shift Right Arithmetic

Specify the type and direction of the shift.

Usage in program code

Block Parameter

mode

Values

Shift Left Logical | Shift Right Logical | Shift Right Arithmetic

By default

Shift Left Logical

Shift Length (must be greater than or equal to zero) - number of bits to shift
0 (By default) | non-negative scalar

Specify the number of bits to shift greater than or equal to zero.

Usage in program code

Block parameter

N

Values

non-negative scalar

* By default*

0