Gray code

From Computer History Wiki
Revision as of 23:32, 28 December 2016 by Jnc (talk | contribs) (A decent start)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A Gray code (named after their inventor) is a coding system in which 'neighbour' code only differ in one bit. In a classic binary code, many transitions involve multi-bit changes; e.g. going from 3 (011) to 4 (100) involves changes in all three bits.

This behaviour can be an issue when a binary code is used in a state machine; if the binary-coded state is fed into combinatorial circuitry, with real counters, the output bits do not all change at the exact same instant. So (for example), the counter output might very briefly display 7 (111) in the process of going from 3 of 4. The combinatorial circuity might therefore produce glitches on its output during the brief period when a false intermediate outputs are present.

Gray codes have other uses, though - for example in transmission codings.