EXTRACTBITS Extraction de bits
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.
- 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.
Propriétés : Type 'vec' de taille 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.
Propriétés : Type 'vec' de taille 1.
- number of bits or index of bit (case range of bits:[start,end],0 is leat 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.
Propriétés : Type 'vec' de taille -1.
- Treat bit field as an integer(0=no 1=yes)
It indicates the scaling mode to use on the output bits selection.
Propriétés : Type 'vec' de taille 1.
- toujours actif: non
- direct-feedthrough: oui
- détection de passage à zéro: non
- mode: non
- entrée régulières:
- port 1 : taille [1,1] / type 3
- sorties régulières:
- port 1 : taille [1,1] / type 3
- nombre des entrées évènementielles: 0
- nombre des sorties évènementielles: 0
- possède un état continu: non
- possède un état discret: non
- possède un état objet: non
- nom de la fonction de calcul: extract_bit_32_UH0
- SCI/macros/scicos_blocks/IntegerOp/EXTRACTBITS.sci [voir code]
Fady NASSIF INRIA