字转位,输入一个Int16形式的字,返回一个长度16的bool数组
public static bool[] WordToBits(short word)
{
bool[] result = new bool[16];
for (int i = 0; i < 16; i++)
{
result[i] = ((word >> i) & 1) == 1;
}
return result;
}
public static bool[] WordToBits(short word)
{
bool[] result = new bool[16];
for (int i = 0; i < 16; i++)
{
result[i] = ((word >> i) & 1) == 1;
}
return result;
}