Why is the Gray code called a cyclic code?

cyclic
ˈsʌɪklɪk,ˈsɪklɪk/
adjective
1. occurring in cycles; regularly repeated.

You haven't given a reference for the 'cyclic code' terminology but there is certainly a cyclic patter. This is most obvious in an encoder disc.

enter image description here

Figure 1. The cyclic pattern of each bit is clearly visible on this optical absolute encoder disc.

Each bit has a repeating on-off pattern with a 50% mark-space ratio. The bits are arranged so that only one bit changes at a time. This prevents errors on transitions from one code to the adjacent one due to misalignment of sensors, etc.

There's a generic definition about the cyclic nature of the Gray code further down the Wikipedia Gray code article mentioned in altai's answer: "The last entry in Gn differs by only one bit from the first entry. (The code is cyclic.)". That is it can wrap while still maintaining only one-bit change.

It would be possible to generate a Gray-ish code that didn't have this property if, for example, the number of steps was not even or a power of 2. This might be acceptable in a linear encoder which wouldn't need to wrap.


Take the four bit Gray code sequence below and print it out then cut it out with scissors. Then wrap the ends round and tape them together so you have a Gray-code band.

enter image description here

As you rotate the band notice there is only one bit change between every spot that is facing you, even when you cross the tape.

That is, it is a cyclic code that has no start and no end.

This is why Gray Code, named after it's inventor Frank Gray, is used for encoders where single bit transitions removes the uncertainty of having two bits changing at the same time.

enter image description here


The Gray code for decimal 15 rolls over to decimal 0 with only one switch change. This is called the "cyclic" property of a Gray code.

Straight from the Wikipedia article.

Tags:

Binary

Code