For what "n" counts are there cyclic counters with constant Hamming distance "d"?
(In particular, what if "d" == 1?)
EDIT:
Let me show the problem through examples.
The 3-bit Gray counter is well known. Its 8 consecutive states are:
000
001
011
010
110
111
101
100
However, you can also create shorter Hamming-1 counters (6 state):
000
001
011
010
110
100
or (6 state):
000
001
011
111
110
100
or (4 state):
001
011
111
101
The questions are:
- for any "n" states, how to tell if there is a cyclic counter with Hamming distance "d"?
- how to systematically generate such a counter (or sequence of states).
When $d=1$ and our states have $k$ bits, you can create cyclic counters of any length $n$ where $n$ is even and $n \le 2^k$.
(Odd lengths $n$ are not possible, because we always alternate between an odd number and an even number of
1s in any counter, so we must take an even number of steps to return to the start.)To do this, start with a Gray counter of length $2^{k-1}$ using $k-1$ bits. For example, when $k=4$, we have
To get a cyclic counter of length $n$ using $k$ bits ($n=10$ in the example below) we take the first $\frac n2$ of these states, with a $0$ appended...
and then the same $\frac n2$ states, with a $1$ appended, in reverse order:
This is the cyclic counter we wanted.