-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Gray Code continuous code
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
000 000
001 001
011 010
010 011
110 100
111 101
101 110
100 111
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Conversion:
Unsigned int bin_to_gray (unsigned int N)
{
Return n ^ (n >> 1);
}
Unsigned int gray_to_bin (unsigned int N)
{
INT I;
For (i = o; (1 << i) { N ^ = n >> (1 << i); } Return n; }