Gray code


Also found in: Dictionary, Wikipedia.

Gray code

[′grā ‚kōd]
(communications)
A modified binary code in which sequential numbers are represented by expressions that differ only in one bit, to minimize errors. Also known as reflective binary code.
McGraw-Hill Dictionary of Scientific & Technical Terms, 6E, Copyright © 2003 by The McGraw-Hill Companies, Inc.

Gray code

(hardware)
A binary sequence with the property that only one bit changes between any two consecutive elements (the two codes have a Hamming distance of one).

The Gray code originated when digital logic circuits were built from vacuum tubes and electromechanical relays. Counters generated tremendous power demands and noise spikes when many bits changed at once. E.g. when incrementing a register containing 11111111, the back-EMF from the relays' collapsing magnetic fields required copious noise suppression. Using Gray code counters, any increment or decrement changed only one bit, regardless of the size of the number.

Gray code can also be used to convert the angular position of a disk to digital form. A radial line of sensors reads the code off the surface of the disk and if the disk is half-way between two positions each sensor might read its bit from both positions at once but since only one bit differs between the two, the value read is guaranteed to be one of the two valid values rather than some third (invalid) combination (a glitch).

One possible algorithm for generating a Gray code sequence is to toggle the lowest numbered bit that results in a new code each time. Here is a four bit Gray code sequence generated in this way:

0 0 0 0 0 0 0 1 0 0 1 1 0 0 1 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 0 0 1 1 0 0 0

The codes were patented in 1953 by Frank Gray, a Bell Labs researcher.

http://nist.gov/dads/HTML/graycode.html.
This article is provided by FOLDOC - Free Online Dictionary of Computing (foldoc.org)
References in periodicals archive ?
Gray code number frameworks otherwise called the binary reflected dark code (BRGC) system is a number framework in which two progressive codes vary in only one bit position.
Trans-Cal has the most complete line of encoders, offering eight models, most of which output both Gray code and serial data and include variations on connector type and temperature and operating environments, including a model designed to operate as high as 100,000 feet.
The representation of larger numbers, we required to apply exact code pattern like excess-3 code, gray code and BCD are suitable for the signal processing system.
* Direct interface to most gray code or binary SSI sensors
A sampling of topics: digital modulation identification by wavelet analysis, fuzzy image processing in quality control application, parallel gray code optimization for high dimensional problems, computational coronary artery bypass grafting, concept-based term weighting for web information retrieval, enhanced image/video compression using diagonal divide, the design of autonomous mobile predator and prey robots, and texture classification using ridgelet transform.
Front: Isaac Harold, Joseph Kynock, Jacob Foster, Daniel McKenna, Callum Schorah, Dominic Suarez, Max Allen, John McGrath, Reece Gray code: NA