I'm having some troubles with the SEC/DED error correction code. It seems I've found some cases in which the decoder thinks a double bit flip occured but only one really occured. I suppose I did somthing wrong, but I was not able to understand what. Let me show you an example.
Suppose I want to encode the 4 bits 1011
using a (7,4) code plus an extra bit needed to perform the two-error-detection. The coded word should be 00110011
, where the most significant bit is the extra parity bit, the following two are p0 and p1 and so on.
Now, let's suppose that during a transmission the less significant bit is flipped; thus the received word will be 00110010
. The receiver will extract from this code the four received data bits 1010 and will construct a new code which will result 01011010
. Finally the receiver will perform a bitwise xor of the two codes obtaining 0111
. The last three bits says that bit 7 has been flipped (which is right), but the first bit is 0 and, as far as i know, the decoder should consider this situation as if more than a bit flip has occured.
What did I do wrong?