GATE Computer ScienceVery hardGATE CS (PYQ pattern)

The Internet checksum (one's complement of the 16-bit one's complement sum) of the words 0xF0F0, 0x0F0F, 0x8001, 0xFFFF is 0x7FFE. Which of the following corruptions of the data words would the receiver fail to detect?

  1. A. 0x8001 → 0x8000, all other words unchanged
  2. B. 0xFFFF → 0x0000 together with 0xF0F0 → 0xF0F1
  3. C. the lowest bit of every one of the four words inverted
  4. D. words reordered, with 0xF0F0 → 0xF0F1 and 0x0F0F → 0x0F0E

Correct answer: D. words reordered, with 0xF0F0 → 0xF0F1 and 0x0F0F → 0x0F0E

One's complement addition is commutative, so reordering is invisible, and +1 on one word cancels −1 on another. Changing 0x8001 to 0x8000 alters the sum by 1. 0xFFFF and 0x0000 are both 'zero' in one's complement, so that swap changes nothing, but the extra +1 on 0xF0F0 is caught. Inverting every low bit changes the words by +1, −1, −1, −1, a net −2, which is detected.

More Digital Logic questions

Exams that ask this topic