public Extract ( int StartBit, int EndBit, |
||
StartBit | int | |
EndBit | int | |
From | ||
return |
public UInt32 Extract(int StartBit, int EndBit, UInt32 From)
{
// Declare 32 character mask defaulted '0';
char[] array = new string('0', 32).ToCharArray();
// Set the mask bits as specifed by the parameters
for (int I = (31 - EndBit); I <= (31 - StartBit); I++)
array[I] = '1';
// Extract and return the data
return (Convert.ToUInt32(new string(array), 2) & From);
}
BitExtractor::Extract ( int StartBit, int EndBit, System.UInt64 From ) : System.UInt64 |