Gray code is beneficial for multiple electromechanical applications of digital systems, such as shaft position encoders, autonomous braking systems, copiers etc. In all these applications, an input sensor produces a digital value that indicates a mechanical position. When continuous or analog information is converted to digital form, as in the case of the above applications, the error susceptibility increases with the number of bit changes between adjacent numbers in a sequence. Gray code provides a robust solution to this problem, as a single bit changes between adjacent numbers that makes error detection and correction easier.
To understand this, let’s consider an example of a mechanical encoding disk. The above figure shows a conceptual mechanical encoding disk that uses binary encoding. The disk has three contacts that produce 3-bit code depending on the rotational position of the disk. The yellow areas are connected to a signal source corresponding to logic-1, and the white areas are connected to the ground corresponding to logic-0. In the above figure, the contact positions generate the code 001.
The problem arises when the disk is positioned at the boundaries of two regions, such as at the boundary of 001 and 010. Here, there are two bits change (two right bits) from the above region of the boundary to the below region of the boundary. However, because of the imperfection in the assembly of the mechanical system, both bits may not change simultaneously. So the intermediate incorrect values such as 011 or 000 may generate before the final value 010 becomes stabilized. Such scenarios can arise in cases where there are more than one bit change between two adjacent regions. Imagine the level of consequences with the presence of such transient errors in the case of an autonomous braking system. Such errors can lead to an accidental scenario. This problem can be resolved using the gray encoding in place of straight binary encoding, as shown in the below figure.
The above mechanical encoding disk uses gray code. We already know that, in the case of gray code, a single-bit change happens between the adjacent sequences. Considering the adjacent regions 001 and 011, we can observe that only the middle bit is changing (single-bit change). Therefore, there is no intermediate incorrect code exists from one region to its adjacent region. Thus, the use of gray code eliminates the possibility of such errors. Moreover, if there is any such error exists, then it is very easy to find the faulty bit location.
Previous Table of Content Next