Search code examples
complexity-theoryfpgacrc

which one is more complex? calculating a 64 bits CRC or two 32 bits CRCs with different polynomials?


I was wondering how 64-bit CRC on an FPGA compares to two 32-bit CRCs (different polynomials) on the same FPGA. Would two 32 bits CRC be more complicated than performing a single 64-bit CRC? Is it going to take a while or it would be fast?

How can I calculate the complexity (or do a complexity analysis)?

any help would be much appreciated Thank you.


Solution

  • I was wondering how 64-bit CRC on an FPGA compares to two 32-bit CRCs (different polynomials) on the same FPGA.

    On a "normal" FPGA it does not matter which kind of information (CRCs, checksums, floating-point values ...) you compare:

    Checking if a 64-bit value equals another 64-bit value takes the same amount of resources (gates or time).

    This is of course not true if you use an FPGA that has a built-in CRC unit that (as an example) supports CRC32 but not CRC64 ...

    Would two 32 bits CRC be more complicated than performing a single 64-bit CRC?

    In both cases you'll need 64 logic cells (this means: 64 LUTs and 64 flip-flops).

    In the case of a 64-bit CRC, 63 logic cells must be connected to the previous logic cell and there must be one signal line connecting the first and the last logic cell.

    In the case of two 32-bit CRCs, 62 logic cells must be connected to the previous logic cell and there must be two signal lines connecting the first and the last logic cell of each CRC.

    If you have an FPGA that allows connecting 64 cells in a row without using a "long" signal line, the 64-bit CRC saves one "long" signal line.

    (Edit: On the FPGA on my eval board you can connect 16 cells in a row; on such an FPGA, both onw 64-bit CRC and two 32-bit CRC would cost 5 "long" signal lines.)

    Is it going to take a while or it would be fast?

    How can I calculate the complexity (or do a complexity analysis)?

    You require one clock cycle per bit - in both cases.

    Note that an FPGA works completely differently than a computer:

    You typically don't need time to perform some operation but all operations are performed at the same time...