At the moment I am trying to come up with a formula decoding Hamming(7,4). Until now not a single one gave me consistent right solutions.
I've googled a lot, but cannot find the right information. My implementation uses different parity and data bits positions than normal, but I don't want to change it.
Parity bits:
My byte looks like this;
MSB - > 0 D3 D2 D1 D0 P2 P1 P0 < - LSB
I tried checking the parity of the circles and adding the 1's and 0's to get a binary number.
p0 wrong would give 0b001 = 1, so that's correct
p1 wrong would give 0b010 = 2, so that's correct
p2 wrong would give 0b100 = 4, there goes my theory
Also found this formula online;
bit1 = x4 + x5 + x6 + x7
bit2 = x2 + x3 + x6 + x7
bit3 = x1 + x3 + x5 + x7
wrong bit = 4b1+2b2+b3
This doesn't work either
At the moment I do not have code yet, because I first need to figure out the logic / formula of this problem.
My actual results are inconsistent, I'm trying to come up with a formula that gives me a right solution. Preferably using bit manipulation, like I tried with using the outcome of even/odd from the circles.