Electronic – Why is the Gray code called a cyclic code

binarycode

I understand why it is called reflexive and a unit distance code. I don't see any cyclic pattern which is repeating in the code. Why is it called a cyclic code?

Best Answer

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.

Related Topic