GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LDT / V0-5-0 > encdec / linux-gcc
#include "LDT/BW.h"
Functions | |
BW_vector | BWP_collapseL (unsigned int val, unsigned int msk) |
Collapses the bit pattern in val considering only those bits that are set in msk. The bit pattern is left justified. | |
BW_vector | BWP_collapseR (unsigned int val, unsigned int msk) |
Collapses the bit pattern in val considering only those bits that are set in msk. The bit pattern is right justified. | |
BW_vector | BWP_convertL (unsigned int val, unsigned int nsig, unsigned int nexp) |
Encodes small integer values that are embedded in a large field. | |
BW_vector | BWP_convertR (unsigned int val, unsigned int nsig, unsigned int nexp) |
Encodes small integer values that are embedded in a large field. |
CVS $Id: BWP.h,v 1.1 2006/09/13 17:09:08 russell Exp $
BW_vector BWP_collapseL | ( | unsigned int | val, | |
unsigned int | msk | |||
) |
Collapses the bit pattern in val considering only those bits that are set in msk. The bit pattern is left justified.
val | The word to extract the bits from | |
msk | The mask of bits to consider |
BW_vector BWP_collapseR | ( | unsigned int | val, | |
unsigned int | msk | |||
) |
Collapses the bit pattern in val considering only those bits that are set in msk. The bit pattern is right justified.
val | The word to extract the bits from | |
msk | The mask of bits to consider |
BW_vector BWP_convertL | ( | unsigned int | val, | |
unsigned int | nval, | |||
unsigned int | nexp | |||
) |
Encodes small integer values that are embedded in a large field.
val | The value to be encoded | |
nval | The bit field width of val | |
nexp | The number of bits to devote to the exponent encoding |
__inline BW_vector BWP_convertR | ( | unsigned int | val, | |
unsigned int | nval, | |||
unsigned int | nexp | |||
) |
Encodes small integer values that are embedded in a large field.
val | The interger value to be encoded | |
nval | The bit field width of val | |
nexp | The number of bits to devote to the exponent encoding |
bwv = BWP__convertR (0x1fff, 25, 4);
One can encode up to 15 leading zeroes. In this case there are only 8. This gets encoded as EXP = 7 (this is the usual n-1), MANTISSA = 0xfff or 0x7fff, NBITS = 16.
Of course, some of these are silly combinations in the sense that the would produce no compression and would more than likely result in an expansion.