I will give 10 points to anyone who can answer this one!!
Thread Starter
Join Date: Oct 2002
Location: aus
Posts: 206
Likes: 0
Received 0 Likes
on
0 Posts
I will give 10 points to anyone who can answer this one!!
Hi All,
I am writing a program that reads gillham gray code for a data logger. For those who don't know, gray code is that sent by an altitude encoder to a transponder in light aircraft.
I have a list of Gillham codes, and that is OK, but what I need for writing a program is a mathmatical equasion that converts the gillham code to either binary, hex, or decimal.
I have searched the internet in every way that I can and I can't find the info that I need, so my question is can anybody help me find out how to get this equasion PPPLLLLEEEEAAASSSSEEEEEEE???????????
Regards,
Pullock.
I am writing a program that reads gillham gray code for a data logger. For those who don't know, gray code is that sent by an altitude encoder to a transponder in light aircraft.
I have a list of Gillham codes, and that is OK, but what I need for writing a program is a mathmatical equasion that converts the gillham code to either binary, hex, or decimal.
I have searched the internet in every way that I can and I can't find the info that I need, so my question is can anybody help me find out how to get this equasion PPPLLLLEEEEAAASSSSEEEEEEE???????????
Regards,
Pullock.
Join Date: Apr 2000
Location: USA
Posts: 78
Likes: 0
Received 0 Likes
on
0 Posts
4 bit gray code from 'Digital Fundamentals" 6th Edition by Floyd
Decimal --- Binary --- Gray Code
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
Can't you re-write someone else's Ti-8X conversion program?
Decimal --- Binary --- Gray Code
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
Can't you re-write someone else's Ti-8X conversion program?
Thread Starter
Join Date: Oct 2002
Location: aus
Posts: 206
Likes: 0
Received 0 Likes
on
0 Posts
Thanks for the heads up so far guys, I did find the list of codes in an ATC600A manual, however it still doesn't provide me with any easy equasion for the conversion. Short of writing a program that refers to a look up table of all the codes, i'm still stumped.........
Join Date: Nov 2002
Location: Berks, UK
Posts: 1
Likes: 0
Received 0 Likes
on
0 Posts
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
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