Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Extract Bits - Output selection of contiguous bits from input signal

Library

Logic and Bit Operations

Description

The Extract Bits block allows you to output a contiguous selection of bits from the stored integer value of the input signal. Use the Bits to extract parameter to define the method for selecting the output bits.

Data Type Support

The Extract Bits block accepts inputs of any numeric data type supported by Simulink software, including fixed-point data types. Floating-point inputs are passed through the block unchanged. Boolean inputs are treated as uint8 signals.

For a discussion on the data types supported by Simulink software, see Data Types Supported by Simulink in the Simulink documentation.

Parameters and Dialog Box

Bits to extract

Select the method for extracting bits from the input signal.

Number of bits

(Not shown on dialog above.) Select the number of bits to output from the input signal. Signed integer data types can have no less then two bits in them. Unsigned data integer types can be as short as a single bit.

This parameter is only visible if you select Range starting with most significant bit or Range ending with least significant bit for the Bits to extract parameter.

Bit indices

(Not shown on dialog above.) Specify a contiguous range of bits of the input signal to output. Specify the range in [start end] format. The indices are assigned to the input bits starting with 0 at the least significant bit.

This parameter is only visible if you select Range of bits for the Bits to extract parameter.

Output scaling mode

Select the scaling mode to use on the output bits selection:

Example

Consider an input signal that is represented in binary by 110111001:

Characteristics

Direct Feedthrough

Yes

Sample Time

Inherited

Scalar Expansion

N/A

States

None

Dimensionalized

Inherited

Multidimensionalized

Yes

Zero Crossing

No

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS