Bit Slice

Return field of consecutive bits from input signal

Library

HDL Coder / Logic and Bit Operations

  • Bit Slice block

Description

The Bit Slice block returns a field of consecutive bits from the input signal. Specify the lower and upper boundaries of the bit field by using zero-based indices in the LSB Position and MSB Position parameters.

Parameters

MSB Position

Specifies the bit position (zero-based) of the most significant bit (MSB) of the field to extract. The default is 7.

For an input word size WS, LSB Position and MSB Position must satisfy the following constraints:

WS > MSB Position >= LSB Position >= 0; 

The word length of the output is computed as (MSB Position - LSB Position) + 1.

LSB Position

Specifies the bit position (zero-based) of the least significant bit (LSB) of the field to extract. The default is 0.

Ports

The block has the following ports:

Input
  • Supported data types: Fixed-point, integer (signed or unsigned), Boolean

  • Maximum bit width: 128

Output

Supported data types: unsigned fixed-point or unsigned integer.

Extended Capabilities

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

Introduced in R2014a