Sunday, August 30, 2009

Reflected Gray Codes

Refer to the post, "Gray code conversion rules" The following illustrates the reflection principle.
Take base 4, Gray code, using bits 0, 1, 2, 3:

0...000
1...011
2...002
3...003
...
4...013
5...010
6...011
7...012
.
8...022
9...023
10..020
11..021
. ...
Where the reflection rules for Gray code base N uses N terms at a time, refer to rightmost column. Bits are 0,1,2,3. Then the next string of 4 terms repeats last term of previous string (a 3), and continues with the same cycle: 3 ->0 -> 1 -> 2.
However, the next column uses 4 terms with 0, the next 4 with 1, the next 4 with 2's and the next with 3's. Next column going to the left uses 16 0's, 16 1's, etc.
Now refer to the blog, "Lengths of Infinite Farey tree continued fractions".

No comments:

Post a Comment