Nom

EXTRACTBITS — EXTRACTBITS

Block Screenshot

Contents

Palette

Description

This block outputs a contiguous selection of bits from the input integer number.The Bits to extract defines the method by which the user select the output bits.

1- When "Upper Half" is selected the block outputs the half of the input that contain the most significant bit. In this case the third parameter "number of bits or index of bit" is ignored.

2- When "Lower Half" is selected the block outputs the half of the input that contain the least significant bit. In this case the third parameter "number of bits or index of bit" is ignored.

3- When "Range starting with most significant bit" is selected the block outputs certain number of bits of the input that contain the most significant bit. In this case the third parameter "number of bits or index of bit" defines the number of bits to extract.

4- When "Range ending with least significant bit" is selected the block outputs certain number of bits of the input that contain the least significant bit. In this case the third parameter "number of bits or index of bit" defines the number of bits to extract.

5- When "Range of bits" is selected the block outputs a range of bits of the input. In this case the third parameter "number of bits or index of bit" defines the range of bits to extract, it must be a vector with the format [start,end].

The extracted value depends on the forth parameter "Treat bit field as an integer". When it is set to 0 the input scaling is used to determine the output scaling. When it is set to 1, only the extracted bits forms the output number.

Dialog box

  • Datatype(3=int32 4=int16 5=int8 ...)

    It indicates the type of the input/output data. It support all the integer datatype, number must be between 3 and 8.

    Properties : Type 'vec' of size 1.

  • Bits to extract(1=Upper Half 2=Lower Half 3=Range starting with most significant bit 4=Range ending with least significant bit 5=Range of bits)

    It indicates the mode used to extract bits from the input data.

    Properties : Type 'vec' of size 1.

  • number of bits or index of bit (case range of bits:[start,end],0 is least significant bit)

    When the "Bits to extract" field is set to 3 or 4, this parameter is used to determine the number of bits to extract and it must be a number. When the "Bits to extract" field is set to 5 ,this parameter is used to determine range of bits to extract and it must have the [start,end] form vector. When the "Bits to extract" field is set to 1 or 2, this parameter is ignored.

    Properties : Type 'vec' of size -1.

  • Treat bit field as an integer(0=no 1=yes)

    It indicates the scaling mode to use on the output bits selection.

    Properties : Type 'vec' of size 1.

Default properties

  • always active: no

  • direct-feedthrough: yes

  • zero-crossing: no

  • mode: no

  • regular inputs:

    - port 1 : size [1,1] / type 3

  • regular outputs:

    - port 1 : size [1,1] / type 3

  • number/sizes of activation inputs: 0

  • number/sizes of activation outputs: 0

  • continuous-time state: no

  • discrete-time state: no

  • object discrete-time state: no

  • name of computational function: extract_bit_32_UH0

Interfacing function

  • SCI/modules/scicos_blocks/macros/IntegerOp/EXTRACTBITS.sci

Computational function

  • SCI/modules/scicos_blocks/src/c/extract_bit_32_UH0.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_32_UH1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_u32_UH1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_32_LH.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_32_MSB0.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_32_MSB1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_u32_MSB1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_32_LSB.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_32_RB0.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_32_RB1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_u32_RB1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_16_UH0.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_16_UH1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_u16_UH1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_16_LH.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_16_MSB0.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_16_MSB1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_u16_MSB1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_16_LSB.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_16_RB0.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_16_RB1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_u16_RB1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_8_UH0.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_8_UH1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_u8_UH1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_8_LH.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_8_MSB0.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_8_MSB1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_u8_MSB1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_8_LSB.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_8_RB0.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_8_RB1.c

  • SCI/modules/scicos_blocks/src/c/extract_bit_u8_RB1.c

See also

Authors

Fady NASSIF - INRIA