Shift

Shift Node

The Shift node allows you to shift the bits of a value left or right by any number of bits. Two common uses of the shift operator are to implement bitwise operations, usually when combined with the And, Or and Not, nodes. to access and use single bits of an integer value or variable, and to perform cheap multiply and divide operations when multiplying or dividing by a value that is a power of 2, i.e. 2, 4, 8, 16 etc. Shifting left in binary effectively multiplies by 2, while shifting right divides by 2, but is much cheaper than a multiply or divide.


Ports

A

The value to shift, a numerical integer value.

B

The amount to shift the value by, in bits.


Parameters

A

A constant integer value for value, used when the A port is not connected.

A

A constant integer value for shift amount, used when the B port is not connected.

L/R

The direction to shift, Left, or Right.