1 的补码 - 1 位或 2 位错误能否检测不到?如何?为什么?

1's complement - Can 1 bit or 2 bit errors go undetected? How? Why?

在网络数据包报头中,当 1 的补码用于 8 位字节(而不是 TCP 中通常使用的 16 位)时,是否可以检测不到 1 位错误?

2 位错误可以不被检测到吗?

如果他们可以,为什么会发生这种情况?

这是 1 的补码处理 3 个 8 位字节的方式。 (而不是 TCP 中的 16 位)

   10011001
+  01010010
___________
   11101011
+  01011001
___________
1  01000100
          1   Wrap Around and add 9th Bit
___________
   01000101  <- Sum
___________
   10111010  <- 1’s Complement

如果有 1 位错误,它们都会被检测到,但是 2 位错误可能不会被检测到。

   10011000 <- last bit switched (should be 10011001) 
+  01010011 <- last bit switched (should be 01010010)
___________
   11101011
+  01011001
___________
1  01000100
          1 <- Wrap Around and add 9th Bit
___________
   01000101 <- Sum
___________
   10111010 <- 1’s Complement with 2 bit error is the same as previous answer