3

I have a the generator polynomial which has to be converted to binary number to use in my CRC code.Like for example these are the one's that are converted correctly, I want to know how they are done.

These are used for ROHC CRC computation:

The polynomial to be used for the 3 bit CRC is: C(x) = 1 + x + x^3

this is 0x06 The polynomial to be used for the 7 bit CRC is: C(x) = 1 + x + x^2 + x^3 + x^6 + x^7

this is 0x79

want to know how 0x06 and 0x79 are derived from those equations.

Vijay
  • 33
  • 1
  • 1
  • 4
  • Where do you get those numbers? `0b11001111 => 0xCF` And that is indeed what Wikipedia says. Perhaps you need to make a slight adjustment somewhere. – leppie Jan 13 '12 at 05:06
  • 1
    the numbers are taken from RFC for ROHC – Vijay Jan 17 '12 at 11:36

1 Answers1

3

Those appear to be in reversed binary notation.

When representing CRC polynomials, each term maps to one bit. Furthermore, the highest order term is implicit and is omitted.

So breaking down your two examples:

1 + x + x^3                    = 1101
1 + x + x^2 + x^3 + x^6 + x^7  = 11110011

Chopping off the highest order term:

1101     -> 110      = 0x06
11110011 -> 1111001  = 0x79
Mysticial
  • 464,885
  • 45
  • 335
  • 332
  • yeh that is correct, the highest order is removed cause it specifies the CRC type like x^7 => that it is CRC7 and that bit should not be considered. – Vijay Jan 17 '12 at 11:38
  • Is there any reason why highest order term has to remove? – JasonHsieh Nov 21 '21 at 00:08