Question: how can we use exclusive-or to convert the binary number of into gray code

title: Gray code
text: Norman B. Spedding , however , registered a patent in 1994 with several examples showing that it was possible . Although it is not possible to distinguish 2 positions with n sensors on a single track , it is possible to distinguish close to that many . For example , when n is itself a power of 2 , n sensors can distinguish 2 − 2n positions . Hiltgen and Paterson published a paper in 2001 exhibiting a single - track Gray code with exactly 360 angular positions , constructed using 9 sensors . Since this number is larger than 2 = 256 , more than 8 sensors are required by any code , although a BRGC could distinguish 512 positions with 9 sensors . An STGC for P = 30 and n = 5 is reproduced here : Single