Gray code (Gray code) is one kind of quasi-weight code, set The lowest point of the gray code is n = 1, The absolute value of the gray code weight is (2^n)-1, and its notation alternates positive and negative from left to right. Typical Gray code is one kind of single-step self-complementing code with reflection characteristics and cyclic characteristics. Its cyclic and single-step characteristics eliminate the possibility of major errors when random number is taken. Gray code is a reliable coding method, which is one kind of error minimization coding method.
Decimal number | Nature Binary number | 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 |