pullock,
At the danger of boring you to death with maths:
For a Gray-coded binary string G[i] of length n, the equivalent decoded binary string B[i] where i = [n-1 .. 0] can be got from the following:
Firstly, assign MSB of G to MSB of B (MSB of both strings are always the same):
B[n-1] = G[n-1]
For the rest of the bits:
B[i] = B[i+1] XOR G[i]
...for i= [n-2 .. 0]
I can post 'C' source for a working encoder and decoder (up to n=32 or 64) if required.
Cheers,
SCT