Gray code

(redirected from Gray codes)
Also found in: Dictionary.

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.

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.

Gray code

A binary code used to represent digits generated from a mechanical sensor that may be prone to error. Used in telegraphy in the late 1800s, and also known as "reflected binary code," Gray code was patented by Bell Labs researcher Frank Gray in 1947.

Only Change One Bit
In Gray code, there is only one bit location different between numeric increments, which makes mechanical transitions from one digit to the next less error prone. The following chart shows normal binary representations from 1 to 10 and the corresponding Gray code.
Decimal  Binary   Gray Digit Code     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
References in periodicals archive ?
Gray codes are otherwise called unweighted code which implies the bit positions in the code do not have a particular weight doled out (non-positional).
Gray codes are otherwise called cyclic (continually being created by a component) codes or unit separate codes in which the contrast between the code bunches varies just by 1.
By choosing values of the base n and distant parameter p, the (n, k, p) gray code produces distinctive gray codes, including several conventional gray codes, for example, the one displayed underneath:
If n is another esteem, the (n, k, p) gray code will be other kind of gray code another kind of gray codes.
In this paper, an algorithm for a digital image cryptosystem based on gray code number system independent of the shape or size of the image is proposed.
One application of the Gray codes generated in this paper is in producing Graeco-latin squares (any square of ordered pairs in which each entry of the alphabet appears exactly once as a left-hand entry in every row and every column and similarly for right hand entries) and balanced factorial groups in the design of experiments.
On generating the N-airy reflected Gray codes. IEEE transactions on computers, 33:739-741.
Gray codes. Available on the Internet with a URL of http://web.usna.navy.mil/ [sim] wdj/gray.htm
If [a.sub.l] and [a.sub.p] also differ in exactly one position and if all [N.sup.M] possible M-tuples occur in exactly once (so p = [N.sup.M]) then [alpha] is called a Gray code of length [N.sup.M] over the alphabct [Z.sub.N].
To create a Gray code for sequences of length 1 use one copy of an N-gon (a regular two-dimensional polygon with N sides, with a 2-gon being a line segment) with labels , , ...
If [a.sub.1] and [a.sub.p] also differ in exactly one position and if all [N.sup.M] possible M-tuples occur in [alpha] exactly once (so p = [N.sup.M]) then [alpha] is called a Gray code of length [N.sup.M] over the alphabet [Z.sub.N].
To create a Gray code for sequences of length 1 use one copy of an N-gon (a regular two-dimensional polygon with N sides, with a 2-gon being a line segment) with labels , ,..., [N-1] affixed to the vertices in a counterclockwise fashion, starting at any vertex for .

Site: Follow: Share:
Open / Close