Reply by robert bristow-johnson November 15, 20052005-11-15
in article LOmdnaADz_YPyuTeRVn-gg@rcn.net, Jerry Avins at jya@ieee.org wrote
on 11/14/2005 22:35:

> mk wrote: > > ... > >> Forgive me for being pedantic but even if states on opposite sides of >> wraparound are not considered adjacent there is no exception. If they >> are not adjacent there is no state to the right of 7 and no state to >> the left of 0 so the whole question of difference between states >> becomes moot. >> Anyway as a hardware designer, it never occured to me to question the >> adjacency issue as in 3 bit binary 7+1 = 0 just as naturally as 1+2=3. >> As far as I am considered they are adjacent by definition not by >> choice. > > OK. I'll buy that. I wanted to avoid a categorical statement and created > more trouble than I might have avoided.
that'll teach ya! (hee-hee-hee-hee-hee) actually, by even bringing up Gray code in the conceptual A/D (for the same reason, i thought if i didn't put in that caveat, someone else would nail me for it), the same thing happened to me. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by Jerry Avins November 14, 20052005-11-14
mk wrote:

   ...

> Forgive me for being pedantic but even if states on opposite sides of > wraparound are not considered adjacent there is no exception. If they > are not adjacent there is no state to the right of 7 and no state to > the left of 0 so the whole question of difference between states > becomes moot. > Anyway as a hardware designer, it never occured to me to question the > adjacency issue as in 3 bit binary 7+1 = 0 just as naturally as 1+2=3. > As far as I am considered they are adjacent by definition not by > choice.
OK. I'll buy that. I wanted to avoid a categorical statement and created more trouble than I might have avoided. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by mk November 14, 20052005-11-14
On Mon, 14 Nov 2005 15:55:05 -0500, Jerry Avins <jya@ieee.org> wrote:

>robert bristow-johnson wrote: >> in article GZudnR-nuJ1iBuXeRVn-rQ@rcn.net, Jerry Avins at jya@ieee.org wrote >> on 11/14/2005 09:15: >> >> >>>robert bristow-johnson wrote: >>> >>>>in article AaadnfuiMfkDneXenZ2dnUVZ_sudnZ2d@rcn.net, Jerry Avins at >>>>jya@ieee.org wrote on 11/13/2005 22:12: >>>> >>>> >>>> >>>>>A Gray code is one in which -- with a single exception -- codes for >>>>>adjacent states differ by only one bit. >>>> >>>> >>>>??? >>>> >>>>what's that single exception, Jerry? >>> >>>Wraparound. >> >> >> but, i think even in that case, there is only one bit changing when you >> change to neighboring states, including a wrapped around state. the first i >> ever learned about Gray code was with mechanical shaft encoders. in fact, >> the quadrature shaft encoder that at least the older mice and trackballs >> used, were a two bit Gray code. > >I agree that there is no exception if states on opposite sides of >wraparound are considered adjacent.
Forgive me for being pedantic but even if states on opposite sides of wraparound are not considered adjacent there is no exception. If they are not adjacent there is no state to the right of 7 and no state to the left of 0 so the whole question of difference between states becomes moot. Anyway as a hardware designer, it never occured to me to question the adjacency issue as in 3 bit binary 7+1 = 0 just as naturally as 1+2=3. As far as I am considered they are adjacent by definition not by choice.
Reply by Jerry Avins November 14, 20052005-11-14
robert bristow-johnson wrote:
> in article GZudnR-nuJ1iBuXeRVn-rQ@rcn.net, Jerry Avins at jya@ieee.org wrote > on 11/14/2005 09:15: > > >>robert bristow-johnson wrote: >> >>>in article AaadnfuiMfkDneXenZ2dnUVZ_sudnZ2d@rcn.net, Jerry Avins at >>>jya@ieee.org wrote on 11/13/2005 22:12: >>> >>> >>> >>>>A Gray code is one in which -- with a single exception -- codes for >>>>adjacent states differ by only one bit. >>> >>> >>>??? >>> >>>what's that single exception, Jerry? >> >>Wraparound. > > > but, i think even in that case, there is only one bit changing when you > change to neighboring states, including a wrapped around state. the first i > ever learned about Gray code was with mechanical shaft encoders. in fact, > the quadrature shaft encoder that at least the older mice and trackballs > used, were a two bit Gray code.
I agree that there is no exception if states on opposite sides of wraparound are considered adjacent. As for the old mouse encoders, that was a clever way to get around my encoder patents. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Jerry Avins November 14, 20052005-11-14
Tim Wescott wrote:

   ...

> 100 to 000 changes by more than one bit?
No, but it changes by more than one count. What I called "wraparound". Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Jerry Avins November 14, 20052005-11-14
robert bristow-johnson wrote:
> in article 2KKdnTSDMsMdXOXeRVn-sA@rcn.net, Jerry Avins at jya@ieee.org wrote
...
>>Like straight binary, offset binary and two's-complement binary, Gray >>codes lie on a number circle, with the largest represented quantity >>being adjacent to the smallest. In the case of Gray, that is also a >>one-bit difference. Many operations make use of the circularity, >>including the circular buffer you diagrammed and overflows washing out >>in a well behaved two's-complement sum. Assign numbers to the states >>above, and I think that what I meant will come clear. >> >>Gray 000 001 011 010 110 111 101 100 >>binary 000 001 010 011 100 101 110 111 >>octal 0 1 2 3 4 5 6 7 > > > so, maybe what you're trying to say is: > > "A Gray code is one in which -- with a single exception -- codes that > differ by only one bit are for adjacent states."
That doesn't do it. Gray codes for 1, 3, and 7 above differ from the code for zero in one bit position. 0-7 is the exception I mentioned if circularity isn't admitted, and 1 is what we expect. 3 shows that you can't reason backward here. (Converse, obverse, and all that.) Maybe 0 isn't a good anchor. Aside from the expected 2 and 4, 0 also differs from 3 in only one bit. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Jerry Avins November 14, 20052005-11-14
mk wrote:

   ...

> Sorry didn't help :-) My interpretation of this: "A Gray code is one > in which -- with a single exception -- codes for adjacent states > differ by only one bit." was that there was an exception case in gray > code where codes for adjacent states differed more than one bit. It > must be the coffee. Or lack of it. > > >>Gray 000 001 011 010 110 111 101 100 >>binary 000 001 010 011 100 101 110 111 >>octal 0 1 2 3 4 5 6 7
Forgive me for being unclear at first and obtuse afterward. Adjacent states in a Gray code always differ by one bit. MIN and MAX differ by one bit also, but are not necessarily taken to be adjacent. Does that clear it up? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by mk November 14, 20052005-11-14
On Mon, 14 Nov 2005 12:29:00 -0500, robert bristow-johnson
<rbj@audioimagination.com> wrote:

>in article 2KKdnTSDMsMdXOXeRVn-sA@rcn.net, Jerry Avins at jya@ieee.org wrote >on 11/14/2005 11:55: > >> mk wrote: >>> On Mon, 14 Nov 2005 09:15:27 -0500, Jerry Avins <jya@ieee.org> wrote: >>> >>> >>>> robert bristow-johnson wrote: >>>> >>>>> in article AaadnfuiMfkDneXenZ2dnUVZ_sudnZ2d@rcn.net, Jerry Avins at >>>>> jya@ieee.org wrote on 11/13/2005 22:12: >>>>> >>>>> >>>>> >>>>>> A Gray code is one in which -- with a single exception -- codes for >>>>>> adjacent states differ by only one bit. >>>>> >>>>> >>>>> ??? >>>>> >>>>> what's that single exception, Jerry? >>>> >>>> Wraparound. >>> >>> >>> Then we're talking about different things (said he jumping into the >>> discussion.) All the gray codes I've used so far have no such >>> exception. An asynchronous FIFO pointer synchronization would get very >>> upset if there were such an exception and would fail consistently when >>> it occured. The following code doesn't have an exception: >>> 000 001 011 010 110 111 101 100 >> >> Like straight binary, offset binary and two's-complement binary, Gray >> codes lie on a number circle, with the largest represented quantity >> being adjacent to the smallest. In the case of Gray, that is also a >> one-bit difference. Many operations make use of the circularity, >> including the circular buffer you diagrammed and overflows washing out >> in a well behaved two's-complement sum. Assign numbers to the states >> above, and I think that what I meant will come clear. >> >> Gray 000 001 011 010 110 111 101 100 >> binary 000 001 010 011 100 101 110 111 >> octal 0 1 2 3 4 5 6 7 > >so, maybe what you're trying to say is: > >"A Gray code is one in which -- with a single exception -- codes that >differ by only one bit are for adjacent states."
Even that's not true. For this code: Diff(001, 101) = 1, Diff(011,111) =1, Diff(110,100) = 1.
Reply by Tim Wescott November 14, 20052005-11-14
Jerry Avins wrote:
> mk wrote: > >> On Mon, 14 Nov 2005 09:15:27 -0500, Jerry Avins <jya@ieee.org> wrote: >> >> >>> robert bristow-johnson wrote: >>> >>>> in article AaadnfuiMfkDneXenZ2dnUVZ_sudnZ2d@rcn.net, Jerry Avins at >>>> jya@ieee.org wrote on 11/13/2005 22:12: >>>> >>>> >>>> >>>>> A Gray code is one in which -- with a single exception -- codes for >>>>> adjacent states differ by only one bit. >>>> >>>> >>>> >>>> ??? >>>> >>>> what's that single exception, Jerry? >>> >>> >>> Wraparound. >> >> >> >> Then we're talking about different things (said he jumping into the >> discussion.) All the gray codes I've used so far have no such >> exception. An asynchronous FIFO pointer synchronization would get very >> upset if there were such an exception and would fail consistently when >> it occured. The following code doesn't have an exception: >> 000 001 011 010 110 111 101 100 > > > Like straight binary, offset binary and two's-complement binary, Gray > codes lie on a number circle, with the largest represented quantity > being adjacent to the smallest. In the case of Gray, that is also a > one-bit difference. Many operations make use of the circularity, > including the circular buffer you diagrammed and overflows washing out > in a well behaved two's-complement sum. Assign numbers to the states > above, and I think that what I meant will come clear. > > Gray 000 001 011 010 110 111 101 100 > binary 000 001 010 011 100 101 110 111 > octal 0 1 2 3 4 5 6 7 > > Jerry
100 to 000 changes by more than one bit? -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Reply by mk November 14, 20052005-11-14
On Mon, 14 Nov 2005 11:55:27 -0500, Jerry Avins <jya@ieee.org> wrote:

>mk wrote: >> On Mon, 14 Nov 2005 09:15:27 -0500, Jerry Avins <jya@ieee.org> wrote: >> >> >>>robert bristow-johnson wrote: >>> >>>>in article AaadnfuiMfkDneXenZ2dnUVZ_sudnZ2d@rcn.net, Jerry Avins at >>>>jya@ieee.org wrote on 11/13/2005 22:12: >>>> >>>> >>>> >>>>>A Gray code is one in which -- with a single exception -- codes for >>>>>adjacent states differ by only one bit. >>>> >>>> >>>>??? >>>> >>>>what's that single exception, Jerry? >>> >>>Wraparound. >> >> >> Then we're talking about different things (said he jumping into the >> discussion.) All the gray codes I've used so far have no such >> exception. An asynchronous FIFO pointer synchronization would get very >> upset if there were such an exception and would fail consistently when >> it occured. The following code doesn't have an exception: >> 000 001 011 010 110 111 101 100 > >Like straight binary, offset binary and two's-complement binary, Gray >codes lie on a number circle, with the largest represented quantity >being adjacent to the smallest. In the case of Gray, that is also a >one-bit difference. Many operations make use of the circularity, >including the circular buffer you diagrammed and overflows washing out >in a well behaved two's-complement sum. Assign numbers to the states >above, and I think that what I meant will come clear.
Sorry didn't help :-) My interpretation of this: "A Gray code is one in which -- with a single exception -- codes for adjacent states differ by only one bit." was that there was an exception case in gray code where codes for adjacent states differed more than one bit. It must be the coffee. Or lack of it.
> >Gray 000 001 011 010 110 111 101 100 >binary 000 001 010 011 100 101 110 111 >octal 0 1 2 3 4 5 6 7