Y
yezi
HI all:
I can not understand the following code , could explain to me in some
easy way:
unsigned long reflect (unsigned long crc, int bitnum) {
// reflects the lower 'bitnum' bits of 'crc'
unsigned long i, j=1, crcout=0;
for (i=(unsigned long)1<<(bitnum-1); i; i>>=1) {
````````````````````````````````````````````````````````````````
if (crc & i) crcout|=j;
````````````````````````````
j<<= 1;
}
return (crcout);
}
is the code provide the function - changeing the "11100011" to
"11000111"
Thanks for any comments
I can not understand the following code , could explain to me in some
easy way:
unsigned long reflect (unsigned long crc, int bitnum) {
// reflects the lower 'bitnum' bits of 'crc'
unsigned long i, j=1, crcout=0;
for (i=(unsigned long)1<<(bitnum-1); i; i>>=1) {
````````````````````````````````````````````````````````````````
if (crc & i) crcout|=j;
````````````````````````````
j<<= 1;
}
return (crcout);
}
is the code provide the function - changeing the "11100011" to
"11000111"
Thanks for any comments