Say I have the matrix
$M= \left[ {\begin{array}{cc} 0 & 0&0&1&1&1&1 \\ 0&1&1&0&0&1&1 \\ 1&0&1&0&1&0&1\\ \end{array} } \right]$
Now I know that this string $0101011$ has one wrong bit. So I do the matrix multiplication and calculate the syndrome to get $1 1 1$ which corresponds to the 7th bit.
NOW what if I change the first bit of B=$0101011$ so it becomes A=$1101011$ so now I have two error bits doing the matrix multiplication of $M*A$
I get a different syndrome that corresponds to a different bit, I thought hamming codes could detect two errors, could someone please explain?
The Hamming code can detect the two errors; the syndrome is non-zero, whence the conclusion it is not correct, there were error(s).
However, the Hamming code cannot correct two errors (only one). Thus, if there are two errors and one tries to recover the original codeword this can fail. Yet, again one can reliably detect that there were error(s).