Here is some more information on Gray-codes taken from the Mathematical Games column of Scientific American by Martin Gardner, August, 1972, pp. 106-109. The first publication of a Gray-code as such was in U.S. patent 2,632,058 (March 17, 1953) to Frank Gray, a research physicist at Bell Telephone Laboratories. The first application of a Gray code (though not by that name) to solve a puzzle was, according to Martin Gardner, in 1872. This was in a brochure published in that year by Louis Gros in Lyon, France, giving a method for solving the so-called Chinese ring puzzle. Binary Gray-code can be used to solve the well known Tower of Hanoi puzzle (method described in the Gardner column). Regarding the definition of a Gray-code, I quote from Martin Gardner's column: "There is an infinity of Gray codes, since they apply to any base system and for each base there are many different ways to construct the code." On the relationship between Gray-codes and Hamiltonian paths on cubes of n dimensions, see: "Gray Codes and Paths on the n-Cube" by E. N. Gilbert in the Bell System Technical Journal, Vol. 37, No. 1, pp. 815-826 (May, 1958). Finally, at least as of the Gardner column in 1972, the number of possible Gray-codes, even for the binary system, is known only for four or fewer digits. In particular, the number of binary Gray codes for five or more bits is (or was as of 1972) unknown. Now there's a PIC challenge! Cheers, --- Warren Davis ================================================ Davis Associates, Inc. 43 Holden Road West Newton, MA 02165 U.S.A. Tel: 617-244-1450 FAX: 617-964-4917 Visit our web site at: http://www.davis-inc.com ================================================