Checksum and CRC Error Detection: Worked Examples, Comparison and Exam Patterns

Learn how checksum and CRC differ, then follow a complete one's-complement checksum and modulo-2 CRC calculation. The guide also covers detection limits and common exam traps.

KnowledgeGate Team

Exam prep & CS education

Updated 7 Nov 20265 min read
Checksum and CRC Error Detection: Worked Examples, Comparison and Exam Patterns

Checksum uses end-around carry and complementation; CRC uses XOR division without carries or borrows. Appending the wrong number of zeroes, dropping a wrapped carry, or treating XOR as subtraction changes the result. Their different blind spots matter as much as the arithmetic, because a passing receiver check means only that no error was detected.

Checksum and CRC error detection: what each receiver checks

Both methods add redundancy to a data block. The sender calculates extra bits from the original data and transmits data plus redundancy. The receiver applies the corresponding rule again. If the received block violates that rule, an error has been detected, but neither method repairs the damaged data or identifies the changed bit by itself.

Method

Sender's rule

Receiver's passing result

Checksum

Add fixed-width words using one's-complement addition, including end-around carry, then complement the sum

The data words plus checksum produce an all-ones sum

CRC

Treat the bits as a polynomial over GF(2) and divide by a chosen generator polynomial

Division by the same generator leaves a zero remainder

Checksum and CRC are related error-detection methods, not interchangeable procedures, and neither catches every error pattern. Use Data Link Layer Error Control: CRC and Hamming Worked when you need parity, Hamming code and ARQ alongside these two methods. For checksum versus CRC specifically, the receiver targets are all ones versus zero remainder, and the blind spots differ. These methods also build on core computer-science concepts.

One's-complement checksum: a complete 4-bit worked example

For a 4-bit checksum, split the data into equal 4-bit words. Add them using one's-complement arithmetic. Whenever addition produces a fifth bit, retain the lower four bits and add the leftmost carry back into the least-significant position. After all words have been added, complement every bit of the final 4-bit sum.

Use the sender words 1001, 1100, and 1010.

  1. Add the first two words:

1001 + 1100 = 10101

Retain the lower four bits, 0101, and wrap the carry 1 around:

0101 + 0001 = 0110

  1. Add the third word:

0110 + 1010 = 10000

Retain 0000, wrap the carry 1, and obtain 0001.

  1. Complement the final sum:

0001 becomes checksum 1110.

At the receiver, the three data words reduce to 0001 by the same steps. Adding the transmitted checksum gives 0001 + 1110 = 1111. The all-ones result means this received block passes the checksum test. It does not prove with certainty that no error occurred, because some error patterns preserve the sum.

Sender and receiver verify a 4-bit one's-complement checksum with end-around carries.

CRC fundamentals: generator degree, appended zeroes and XOR division

CRC interprets a bit string as polynomial coefficients. The generator 1101 represents (x^3 + x^2 + 1), so its degree is r = 3. A degree-3 generator produces a 3-bit remainder. The sender therefore appends three zeroes to the data before performing the division.

Modulo-2 subtraction is XOR: 1 XOR 1 = 0, 1 XOR 0 = 1, 0 XOR 1 = 1, and 0 XOR 0 = 0. There are no borrows or carries. Align the generator with the current leftmost 1 and XOR; when the current bit is 0, move to the right. The sender replaces the appended zeroes with the remainder. This construction makes the transmitted codeword exactly divisible by the generator.

CRC worked example: divide 101101 by 1101

CRC flow divides 101101000 by 1101 to get remainder 010, then contrasts passing and corrupted frames.

Let the data be D = 101101 and the generator be G = 1101. Because G has degree 3, append three zeroes:

D × 2^3 = 101101000

Now perform modulo-2 division. The positions below are zero-based positions at which the generator's leftmost bit is aligned:

Code
Start:          101101000
XOR at pos 0:   011001000
XOR at pos 1:   000011000
XOR at pos 4:   000000010

No further alignment is possible because only three bits remain. Those last three bits give R = 010.

Replace the three appended zeroes with that remainder:

D || R = 101101010

Dividing this transmitted codeword by 1101 at the receiver gives remainder 000, so the frame passes the CRC test.

Now suppose one transmitted bit changes and the receiver gets 101111010. Division by the same generator gives remainder 111. Because the remainder is non-zero, the receiver detects an error and rejects the frame. CRC indicates that the codeword is invalid, but it does not reveal which bit changed.

Checksum vs CRC: detection strength and blind spots

An additive checksum can miss compensating changes. Consider two original 4-bit words, 0101 and 1001. Their sum is 1110, so their checksum is 0001. If an error changes the words to 0110 and 1000, their sum is still 1110. The receiver obtains the same all-ones result after adding checksum 0001, so it accepts the corrupted block. Swapping complete words also leaves this additive checksum unchanged because addition does not depend on word order.

CRC is usually stronger against structured bit errors, but its guarantees depend on the generator:

  • A generator of degree r detects every burst error of length at most r.

  • A generator containing more than one non-zero term detects every single-bit error.

  • A generator with (x + 1) as a factor detects every error pattern containing an odd number of flipped bits.

CRC still has a blind spot. If an error pattern, represented as an error polynomial, is exactly divisible by the generator, division can leave remainder zero and the error goes undetected. So “CRC detects every multi-bit error” and “CRC detects every burst” are both unsafe absolute claims.

Checksum and CRC exam patterns: traps to check before answering

Recurring question families are predictable even when the bit strings change. You may have to compute a sender checksum, test a received checksum, infer the number of CRC bits from the generator degree, calculate a CRC remainder or codeword, test a received frame, or select a valid detection guarantee from the generator's algebraic properties.

Use this five-check desk routine:

  1. Fix the checksum word width before adding.

  2. Wrap every checksum carry back into the least-significant position.

  3. Complement only at the point requested by the procedure.

  4. For CRC, append exactly degree(G) zeroes.

  5. Use XOR throughout and preserve leading zeroes in the remainder.

The classic distractors do the opposite. 1101 has four bits but degree 3, so it needs three appended zeroes, not four. Ordinary borrowed binary subtraction is not CRC division. Dropping an end-around carry changes a checksum. A few cancelling division steps do not prove that a received frame is valid; only the final remainder does.

Study error control as part of Computer Networks, then practise mixed-topic Computer Networks MCQs that require choosing and calculating with the correct method.

Checksum and CRC: the short version and next step

Checksum means fixed-width one's-complement addition, end-around carry, then complement. CRC means append r zeroes, divide by a degree-r generator using XOR, and transmit the resulting r-bit remainder.

Reproduce both examples once without looking: checksum 010 and CRC remainder 1110. The leading zero is part of the three-bit remainder; dropping it changes the codeword length. If you want Computer Networks sequenced inside a wider GATE CS preparation path, GATE Guidance by Sanchit Sir is the appropriate next step.