Simulink Reference Previous page   Next Page
Extract Bits

Output a selection of contiguous bits from the 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. The Bits to extract parameter defines the method by which you select the output bits.

Data Type Support

The Extract Bits block accepts inputs of any data type supported by Simulink, 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, refer to Data Types Supported by Simulink in the Using Simulink documentation.

Parameters and Dialog Box

Bits to extract
Select the mode by which to extract bits from the input signal, as discussed in Description.
Number of bits
(Not shown on dialog above.) Select the number of bits to output from the input signal.
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
Zero Crossing
No


Previous page  Environment Controller Fcn Next page

© 1994-2005 The MathWorks, Inc.