How do handle a binary division that starts by 0? in a CRC calculation

609 Views Asked by At

im facing a new case of binary division and i would like to know how to manage it. My problems is that it starts by 0 and i'm not sure how to handle that. NOTE: this is a CRC calculation problem and M' = 0 0 1 1 0 0 1 0 1 1 0 0 0 0 0 0

i have: 0 0 1 1 0 0 1 0 1 1 0 0 0 0 0 0 / 1 0 0 0 0 1

Thanks for your help

2

There are 2 best solutions below

4
On

Just as in decimal, the leading $0$s can be ignored.

0
On

Solution: just skip to the first bit with value 1

In the CRC (Cyclic Redundancy Check) algorithm for generating code words, we follow a process called "modulo-2 division".

This is basically applying XOR instead of subtraction.

In CRC, the value to be XORd, is dependent only on the MSB (most significant bit, i.e., the left most bit) of the dividend at the step.

If you have a 0 as the MSB at any step, you XOR the dividend with 0s, otherwise you XOR with the divisor. This essentially means that leading zeroes can be ignored/skipped (in non-hardware simulation)

The same logic applies to the start of the problem too. If your dividend has leading zeroes from the beginning, just skip to the first bit with value 1.

Disclosure: I haven't studied the theoretical derivation behind this method nor worked with real implementations on the networks.

My source: https://www.fishercom.xyz/division-multiplexing/cyclic-redundancy-check-crc.html