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?