1

有人可以澄清我哪里出错了。我在这 2 个小时......我知道代码中的第一个奇偶校验包括它自己,并以是和否的顺序跳过它之后的每个第一个数字。第二个跳过它自己和后面的数字之后的每一组数字。第 4 个应在包括自身和前 3 个数字后跳过 4。

These are my message bits in its original form: 1101011011000110 
   and I want to add the hamming parity bits onto them.
   ? = Parity
so this means ??1?101?01101100011?0 
Parity 1 = ?110110010 
Parity 2 = ?101111011 
Parity 3 = ?1010110?0 (this is where my issue is so I cant move on)
Parity 4 = cant get to this part...
4

1 回答 1

0

看起来您的第 5 个奇偶校验位位于错误的位置。

你有:

??1?101?01101100011?0

但它应该是:

??1?101?0110110?00110

因此,重新计算奇偶校验位(粗体表示“保留”,否则跳过),我们遵循“保留 1,跳过 1,保留 1...”的模式:

? ? 1 ? 1 0 1 ? 0 1 1 0 1 1 0 ? 0 0 1 1 0

P1: ?1110110010 (even number of 1s, so 0 parity)

(丢弃前 1 位)遵循模式“保留 2,跳过 2,保留 2...”:

?1 ?1 01 ?0 11 01 10 ?0 01 10

P2: ?101111001 (even number of 1s, so 0 parity)

(丢弃接下来的 2 位)遵循模式“保留 4,跳过 4,保留 4...”:

?101 ?011 0110 ?0011 0

P4: ?10101100 (even number of 1s, so 0 parity)

(丢弃接下来的 4 位)遵循模式“keep 8, skip 8, keep 8...”(但我们只能做 keep 8, skip 6,所以这里就足够了):

?0110110 ?00110

P5: ?0110110 (even number of 1s, so 0 parity)

所以最终的汉明 (21,16) 编码值为:

001010100110110000110

(21位,其中16位为数据位)

于 2017-06-01T00:49:34.623 回答