Error Detection Using Cyclic Redundancy Check (CRC): Principle, Modulo-2 Division, and Worked Example

Error Detection Using Cyclic Redundancy Check (CRC): Principle, Modulo-2 Division, and Worked Example

Verified Sources
Nov 4, 2026

Cyclic Redundancy Check CRC is an error-detecting code constructed from a generator polynomial G(x)G(x). The core principle is polynomial long division over modulo-2 arithmetic (so subtraction is XOR, with no carries/borrows). Modulo-2 division is used to compute a remainder that is appended to the data, forming a transmitted codeword. At the receiver, the same division is performed; if the remainder is nonzero, an error is detected. This “nonzero remainder” property is central to CRC’s detection capability.

A generator of degree rr implies CRC appends exactly rr redundant bits (the remainder length) to the dataword. Generator polynomial defines the code structure; Remainder determines the appended checksum bits.

Polynomial model for CRC

Map a binary string to a polynomial over GF(2)GF(2):

  • bit string bkbk−1…b0b_k b_{k-1}\dots b_0 ⇒\Rightarrow bkxk+bk−1xk−1+⋯+b0b_k x^k + b_{k-1} x^{k-1} + \cdots + b_0
  • addition/subtraction uses XOR (coefficients reduced mod 2)

Then:

  1. Data polynomial: M(x)M(x) from the dataword.
  2. Multiply by xrx^r (append rr zeros): M(x) xrM(x)\,x^r.
  3. Compute remainder R(x)R(x) when dividing M(x)xrM(x)x^r by G(x)G(x): M(x)xr=Q(x)G(x)+R(x),deg⁡(R)<rM(x)x^r = Q(x)G(x) + R(x), \quad \deg(R) < r
  4. Transmitted codeword polynomial: C(x)=M(x)xr+R(x)C(x)=M(x)x^r + R(x)

At the receiver, the receiver divides the received bits interpreted as C′(x)C'(x) by G(x)G(x). If the received codeword was correct (i.e., no errors), then: C(x) mod G(x)=0C(x) \bmod G(x) = 0 So any error pattern E(x)E(x) that yields a nonzero remainder will be detected because: (C(x)+E(x)) mod G(x)=E(x) mod G(x)≠0(C(x)+E(x)) \bmod G(x) = E(x) \bmod G(x) \neq 0

CRC Explained (Polynomial & Remainder Check)

Key terms to anchor the idea

  • Dataword MM
  • Generator polynomial G(x)G(x)
  • Remainder R(x)R(x)
  • Transmitted codeword C(x)C(x)

Visualizing the CRC division flow

Compute the transmitted codeword for CRC using modulo-2 division

  1. 1
    Step 1

    Dataword = 1101011011 and generator G(x)=x4+x+1G(x)=x^4+x+1 (degree r=4r=4). CRC appends r=4r=4 zeros before division.

  2. 2
    Step 2

    G(x)=x4+x+1G(x)=x^4+x+1 corresponds to bits 10101 (coefficients for x4,x3,x2,x1,x0x^4,x^3,x^2,x^1,x^0 are 1,0,0,1,11,0,0,1,1).

  3. 3
    Step 3

    Append 4 zeros: 1101011011 → 1101011011 0000 (total length 14).

  4. 4
    Step 4

    Use XOR subtraction (no carries). Divide 11010110110000 by 10101 to obtain remainder RR of 4 bits.

  5. 5
    Step 5

    Transmitted bits = original dataword + remainder (4 bits).

Worked example (CRC codeword)

1) Inputs

  • Dataword: 1101011011
  • Generator polynomial: G(x)=x4+x+1G(x)=x^4+x+1
  • Degree: r=4r=4
  • Generator bit pattern (divisor): 10101 (since x4x^4 and x1x^1 and x0x^0 have coefficient 1)

So we append 4 zeros to the dataword:

  • M(x)x4M(x)x^4 bits: 11010110110000

2) Modulo-2 long division to find remainder

We divide 11010110110000 by 10101 using XOR “subtraction” at each step when the leading bit is 1.

Carrying out the long division yields the final remainder:

  • RR = 0100

Therefore the transmitted CRC codeword is:

  • Transmitted codeword = dataword + remainder
  • C=1101011011  ∣∣  0100=11010110110100C = \texttt{1101011011} \;||\; \texttt{0100} = \texttt{11010110110100}

So the transmitted codeword is:

  • 11010110110100

(Here || means concatenation.)

3) Verify at the receiver: division should give remainder 0

The receiver takes the received bits (assume no alteration) interpreted as C(x)C(x) and divides by $G(x)=10101` again.

Because CRC construction guarantees C(x)C(x) is exactly divisible by G(x)G(x), we have: C(x) mod G(x)=0C(x) \bmod G(x) = 0

In binary remainder terms:

  • Divide 11010110110100 by 10101
  • Receiver remainder = 0000

Hence:

  • The receiver concludes no error detected.

type="tip" title="Why appending rr zeros works" content="Because G(x)G(x) has degree rr, the remainder of dividing by G(x)G(x) always has degree < rr. That remainder is exactly rr bits, so appending rr zeros makes room to insert the computed parity bits."

type="warning" title="CRC is error-detecting, not error-correcting" content="If an error pattern E(x)E(x) happens to be a multiple of G(x)G(x), the remainder could still be 0 and the CRC would not detect it. This is rare for good generator polynomials, but not impossible."

CRC transmitter-to-receiver lifecycle

Append zeros

1. Sender preparation

Extend M(x)M(x) to M(x)xrM(x)x^r by appending rr zeros."

Compute remainder

2. Sender computation

Divide M(x)xrM(x)x^r by G(x)G(x) to obtain R(x)R(x)."

Form codeword

3. Sender transmission

Transmit C(x)=M(x)xr+R(x)C(x)=M(x)x^r+R(x) (dataword + remainder bits)."

Divide received word

4. Receiver checking

Compute C′(x) mod G(x)C'(x)\bmod G(x). If remainder is 0 → accept, else → detect error."

Bit roles in the CRC codeword (this example)

Lengths and placement of fields for r = 4.

Receiver detection logic (no-bit-altered case)

Knowledge Check

Question 1 of 4
Q1Single choice

In CRC, how is the remainder computed?