Gray code features

Dec 06, 2019

Gray code features

1. Gray code belongs to reliability coding, which is a coding method that minimizes errors. Because, although the natural binary code can be directly converted into an analog signal by a digital-to-analog converter, in some cases, for example, when changing from decimal 3 to 4, every bit of the binary code must be changed, which can make digital circuits produce very Large spike current pulses. Gray code does not have this disadvantage. When switching between adjacent bits, only one bit changes. It greatly reduces the logic confusion when moving from one state to the next. Because there is only one bit difference between two adjacent code groups of this code, when the angular displacement of the direction is used to convert the digital quantity, when the angular displacement of the direction changes slightly (and the digital quantity may occur) When changing, the Gray code only changes one bit, which is more reliable than other codes that change two or more bits at the same time, which can reduce the possibility of errors.

2. Gray code is an absolute encoding method. The typical Gray code is a single-step self-complement code with reflection characteristics and cyclic characteristics. Its cyclic and single-step characteristics eliminate the possibility of major errors in random access. The reflection and self-completion characteristics make negation very convenient.

3. Because Gray code is a variable weight code, each bit code does not have a fixed size, it is difficult to directly compare the size and arithmetic operations, nor can it be directly converted into a liquid level signal. After a code transformation, it becomes a natural binary. The code is read by the host computer.

5. A typical Gray code is a quasi-weighted code that uses absolute coding, and its absolute value is 2 ^ i-1 (set the lowest bit i = 1).

6. The decimal number parity of the Gray code is the same as the number of 1s in its codeword.


Send Inquiry