??? 08/11/07 07:22 Read: times |
#143089 - write down the bits Responding to: ???'s previous message |
Russ,
this is a classical example of "paper-and-pencil-ware". So, take a sheet of paper and a pencil... :-) Write down the bits of CRC (say c15..c0) and the input byte (say, b7..b0). Now, start to do the CRC manually, bitwise, observing where the individual bits go. You will find out, that within the first 4 bits, the bits won't get mixed too much, and in fact only the high nibble of the original CRC xored with high nibble of the input byte is xored into CRC shifted left by that nible, into 3 positions (this comes from the fact that the 3 nonzero bits in the 1021 poly are sufficently far from each other, and the highest nonzero bit is sufficiently far from the "overflow" end). Now try to write down the same in nibbles form; and do it for both nibbles. You will then see how the algo works... Have fun! Jan |