GLAST/LAT >
DAQ and FSW >
FSW >
Doxygen Index >
LDT / V0-3-2
Constituent: encdec     Tag: mv2304
Interface Data Structures File List Data Fields Globals
BWU.c File Reference
Bit Word Unpacking, where word refers to 32-bit words. More...
#include "LDT/BWU.h"
#include "ffs.h"
#include <stdio.h>
Include dependency graph for BWU.c:
|
Functions |
unsigned int | BWU_expand (unsigned int wrd, unsigned int msk) |
| Expands wrd according to the bits set in msk. This is the inverse operation of BWP_collapse.
|
unsigned int | BWU_revert (unsigned int wrd, unsigned int nwrd, unsigned int nexp) |
| Reverts wrd to the original integer. This is the inverse operation of BWP_convert.
|
Detailed Description
Bit Word Unpacking, where word refers to 32-bit words.
- Author:
- JJRussell - russell@slac.stanford.edu
CVS $Id: BWU.c,v 1.1 2006/09/13 17:08:33 russell Exp $
Function Documentation
unsigned int BWU_expand |
( |
unsigned int |
wrd, |
|
|
unsigned int |
msk |
|
) |
|
|
|
Expands wrd according to the bits set in msk. This is the inverse operation of BWP_collapse.
- Returns:
- The expanded word
- Parameters:
-
| wrd | The mask to control the expansion |
| msk | The word to expand |
For each cleared bit encountered in msk, a 0 is placed into the equivalent bit position in the output word. For each set bit in msk, the value of the next available bit is pulled from the top of wrd and inserted into the equivalent bit position in the output word. Here equivalent bit position means the same bit position as in msk.
Example msk = 0x001101110;
wrd = 0x1011;
Expand wrd where the 0's in msk are
out = 0x001001100;
If one collapsed out
msk = 0x001101110;
out = 0x001001100;
wrd = 1011;
|
unsigned int BWU_revert |
( |
unsigned int |
wrd, |
|
|
unsigned int |
nwrd, |
|
|
unsigned int |
nexp |
|
) |
|
|
|
Reverts wrd to the original integer. This is the inverse operation of BWP_convert.
- Returns:
- The revert word
- Parameters:
-
| wrd | The word to expand |
| nwrd | The bit field width of the expanded word |
| nexp | The number of bits in the exponent. |
|
Generated on Thu Dec 7 05:02:19 2006 by
1.4.4