COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### CRC lookup table: why 0xC0C1?

• Email
• Follow

```I'm studying the table-driven CRC implementation for CRC-16 (poly 0x8005).
Now, in the standard CRC-16 table
(http://www.xs4all.nl/~koekeroe/hacked/crc.htm, end of document), I
can -not- understand how the table entry with index 1 has a value of 0xC0C1.
It seems to me that this entry should have value 0x8005.  I reason this way:
because the index is 1, and decimal 1 has exactly 1 set bit, then there will
occur exactly 1 XORs of the poly 0x8005 with the register, which is
initially 0x0000.  How can exactly 1 XOR of the poly with 0 result in
anything other than the poly or some shifted variant of it?

--
Jeff S.

```
 0
Reply object0173 (2) 2/20/2004 12:14:42 AM

See related articles to this posting

```"Jeff Stewart" <object01@hotmail.com> wrote in message
news:3b266408875f1c72f7ed08a58f0f970b@news.teranews.com...
> I'm studying the table-driven CRC implementation for CRC-16 (poly 0x8005).
> Now, in the standard CRC-16 table
> (http://www.xs4all.nl/~koekeroe/hacked/crc.htm, end of document), I
> can -not- understand how the table entry with index 1 has a value of
0xC0C1.
> It seems to me that this entry should have value 0x8005.  I reason this
way:
> because the index is 1, and decimal 1 has exactly 1 set bit, then there
will
> occur exactly 1 XORs of the poly 0x8005 with the register, which is
> initially 0x0000.  How can exactly 1 XOR of the poly with 0 result in
> anything other than the poly or some shifted variant of it?
>
> --
> Jeff S.
>
>

Some CRC implementations reverse the order of the input bits and/or the
output bits. Take your input (0x01) and reverse the bits and you get 0x80.
Look up 0x80 in the table and you get 0xA001. Reverse these bits and you get
0x8005.

```
 0

1 Replies
845 Views

Similar Articles

12/7/2013 6:10:56 AM
page loaded in 65671 ms. (0)