crc-8 and crc-16 code...

Discussion in 'C++' started by Mamut, Feb 21, 2007.

  1. Mamut

    Mamut Guest

    Hello
    Does have anybody procedures for:
    CRC-8: polynomial x^8 + x^7 + x^2 + 1
    i CRC-16: polynomial x^16 + x^15 + x^2 + 1
    ?
    Mamut, Feb 21, 2007
    #1
    1. Advertising

  2. Mamut wrote:
    > Does have anybody procedures for:
    > CRC-8: polynomial x^8 + x^7 + x^2 + 1
    > i CRC-16: polynomial x^16 + x^15 + x^2 + 1
    > ?


    Have you tried googling for those?
    Victor Bazarov, Feb 21, 2007
    #2
    1. Advertising

  3. Mamut

    Mamut Guest


    > Have you tried googling for those?


    yes but for this polynomials I can't find...
    Mamut, Feb 21, 2007
    #3
  4. Mamut wrote:
    >> Have you tried googling for those?

    >
    > yes but for this polynomials I can't find...


    If you just need to calculate polynomials, what's the problem?
    Write a function that takes your argument and multiplies and
    adds what you need. Example:

    // 'n' = degree, 'a' = array of factors (sized n+1)
    // 'x' = parameter
    double polynomial(double x, double *a, size_t n)
    {
    double result = a[n];
    while (n) {
    result *= x;
    result += a[--n];
    }
    return result;
    }

    Now, all you need is to define the proper arguments...

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
    Victor Bazarov, Feb 21, 2007
    #4
  5. Mamut

    Mamut Guest


    >
    > If you just need to calculate polynomials, what's the problem?
    > Write a function that takes your argument and multiplies and


    no, I need to calculate CRC sum based on these polinomials and I can't
    do this.
    Mamut, Feb 22, 2007
    #5
  6. Mamut wrote:
    >> If you just need to calculate polynomials, what's the problem?
    >> Write a function that takes your argument and multiplies and

    >
    > no, I need to calculate CRC sum based on these polinomials and I can't
    > do this.


    This sound like an admission of defeat. What seems to be the problem?
    Do you have the algorithm? If yes, have you attempted to convert it
    into C++ terms? If yes, do you get compiler errors? If yes, read the
    FAQ 5.8. If you don't have the algorithm, we can't help you. Try
    posting to comp.programming or search for it on the web. Once you
    find the algorithm, try writing it down in C++ terms. If you don't
    succeed (and how would you know unless the compiler complains, right?),
    post what you have and the errors (IOW, follow the recommendations of
    FAQ 5.8).

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
    Victor Bazarov, Feb 22, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jan Decaluwe

    Re: How to use easics crc generator?

    Jan Decaluwe, Jun 24, 2003, in forum: VHDL
    Replies:
    11
    Views:
    7,431
    OutputLogic
    Nov 26, 2010
  2. `Zidane Tribal
    Replies:
    1
    Views:
    2,510
    Joe Smith
    Jul 28, 2007
  3. praveenk

    vhdl code for crc 32

    praveenk, Jun 26, 2008, in forum: VHDL
    Replies:
    0
    Views:
    1,013
    praveenk
    Jun 26, 2008
  4. Matt
    Replies:
    9
    Views:
    1,154
    Mark Curry
    Feb 10, 2012
  5. `Zidane Tribal
    Replies:
    3
    Views:
    251
    Sisyphus
    Jul 27, 2007
Loading...

Share This Page