Main Content

Bit Rotate

Rotate input signal by bit positions

  • Bit Rotate block

Libraries:
HDL Coder / Logic and Bit Operations

Description

The Bit Rotate block rotates the input signal left or right by the specified number of bit positions.

Ports

Input

expand all

Input signal on which the bit-rotation is performed.

  • Minimum bit width: 2

  • Maximum bit width: 128

Data Types: int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point

Output

expand all

Output signal that is bit-rotated. The output signal has the same data type as the input signal.

Parameters

expand all

Specifies direction of rotation, left or right.

Programmatic Use

Block parameter: mode
Type: string scalar | character vector
Value: "Rotate Left" | "Rotate Right"
Default: 'Rotate Left'

Specifies the number of bits to rotate.

Programmatic Use

Block parameter: N
Type: string scalar | character vector
Value: integer greater than or equal to zero
Default: '0'

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2014a