Engee documentation

Bit Shift

Performs a logical or arithmetic shift of the input signal.

blockType: Bit Shift

Path in the library:

/Basic/Logic and Bit Operations/Bit Shift

Description

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

The behavior of this block in modeling and code generation differs from the block Shift Arithmetic.

Block Shift Arithmetic shifts the bits or the binary point of the input number. This block has additional options for code generation compared to the block Bit Shift. When it is necessary to perform a variable shift operation, use the block Shift Arithmetic instead of a block Bit Shift. If a signed number is entered, the block expands the signed digit.

Ports

Input

# IN_1 — Input signal
scalar | vector | the matrix

Details

An 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

Complex numbers support

Yes

Output

# OUT_1 — Output signal
scalar | vector | the matrix

Details

The output signal for which a logical or arithmetic shift is 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

Complex numbers support

Yes

Parameters

Main

# Shift Mode — type and direction of the shift
Shift Left Logical | Shift Right Logical | Shift Right Arithmetic

Details

Specify the type and direction of the shift.

Values

Shift Left Logical | Shift Right Logical | Shift Right Arithmetic

Default value

Shift Left Logical

Program usage name

mode

Tunable

No

Evaluatable

No

# Shift Length (must be greater than or equal to zero) — number of bits to shift
Int64 integer

Details

Set the number of bits for the shift to be greater than or equal to zero.

Default value

0

Program usage name

N

Tunable

No

Evaluatable

Yes