0

I thought I understood how to find error and correct it in a SEC hamming code but then my textbook question questioned my ability...

Consider a SEC code that protects 8 bit words with 4 parity bits. If we read the value 0x375, is there an error? If so, correct the error.

So 0x375 is equivalent to 0011 0111 0101

I locate the parity bits...

p1: 0011 0111 0101
p2: 0011 0111 0101
p4: 0011 0111 0101
p8: 0011 0111 0101

Now to detect error I see if any parity bits are odd...

p1: 0011 0111 0101 = 010100 = EVEN (0)
p2: 0011 0111 0101 = 011110 = EVEN (0)
p4: 0011 0111 0101 = 10111 = EVEN (0)
p8: 0011 0111 0101 = 10101 = ODD (1)

I was under the impression that to find the error bit you simply add the parity bit numbers that are ODD. In my case, only parity bit 8 is odd. So error bit = p8 = 8. But I didn't think a parity bit number could be the error bit so I must have done something wrong?

Jason Fel
  • 921
  • 4
  • 10
  • 29

1 Answers1

1

The parity bit is just like any other bit in that it can have an error just like any of the other bits, so if only one parity bit indicates error, the parity bit itself is in error. You did nothing wrong.

reference: my professor's lecture slide

Takaia
  • 152
  • 1
  • 1
  • 10