gray code

Discussion in 'C Programming' started by Srinivas Rao \(Rbin/eds2\), Oct 22, 2003.

  1. HI all,
    Can any one tell me what the term "gray coding" mean in C programming.

    with regards,
    K Srinivas
     
    Srinivas Rao \(Rbin/eds2\), Oct 22, 2003
    #1
    1. Advertising

  2. Srinivas Rao \(Rbin/eds2\)

    Richard Bos Guest

    "Srinivas Rao \(Rbin/eds2\)" <> wrote:

    > Can any one tell me what the term "gray coding" mean in C programming.


    In C programming, it means nothing. Gray encoding (and note, it's Gray,
    not gray, since it's a proper name - Frank Gray, from Bell Labs) is a
    way to encode integers. It has its advantages and disadvantages compared
    to a pure binary encoding, but in comp.lang.c one of its worst
    disadvantages is that C mandates a pure binary encoding, and so Gray
    encodings are off-topic here, _unless_ you can show code which handles
    Gray encoding "by hand". That'd be possible, but pretty inefficient.

    Richard
     
    Richard Bos, Oct 22, 2003
    #2
    1. Advertising

  3. Srinivas Rao \(Rbin/eds2\)

    Joe Wright Guest

    Srinivas Rao (Rbin/eds2) wrote:
    >
    > HI all,
    > Can any one tell me what the term "gray coding" mean in C programming.
    >

    It has no meaning in C. It is a binary counting scheme where only one
    bit changes per count. It can be implemented several ways, I believe.
    --
    Joe Wright http://www.jw-wright.com
    "Everything should be made as simple as possible, but not simpler."
    --- Albert Einstein ---
     
    Joe Wright, Oct 22, 2003
    #3
  4. "Srinivas Rao (Rbin/eds2)" wrote:
    >
    > HI all,
    > Can any one tell me what the term "gray coding" mean in C programming.
    >
    > with regards,
    > K Srinivas


    Look in Knuth.

    --
    Julian V. Noble
    Professor Emeritus of Physics

    ^^^^^^^^
    http://galileo.phys.virginia.edu/~jvn/

    "Science knows only one commandment: contribute to science."
    -- Bertolt Brecht, "Galileo".
     
    Julian V. Noble, Oct 22, 2003
    #4
  5. Julian V. Noble wrote:

    > "Srinivas Rao (Rbin/eds2)" wrote:
    >>
    >> HI all,
    >> Can any one tell me what the term "gray coding" mean in C programming.
    >>
    >> with regards,
    >> K Srinivas

    >
    > Look in Knuth.


    I did so. Gray coding is covered in Chapter 7, which hasn't been published
    yet AFAIK. Having said that, there are sufficient hints in Volume II to
    answer the OP's question.

    --
    Richard Heathfield :
    "Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
    C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
    K&R answers, C books, etc: http://users.powernet.co.uk/eton
     
    Richard Heathfield, Oct 23, 2003
    #5
  6. Srinivas Rao \(Rbin/eds2\)

    pete Guest

    Richard Bos wrote:
    >
    > "Srinivas Rao \(Rbin/eds2\)" <> wrote:
    >
    > > Can any one tell me what the term "gray coding"
    > > mean in C programming.

    >
    > In C programming, it means nothing. Gray encoding
    > (and note, it's Gray,
    > not gray, since it's a proper name - Frank Gray, from Bell Labs) is a
    > way to encode integers. It has its advantages and disadvantages
    > compared
    > to a pure binary encoding, but in comp.lang.c one of its worst
    > disadvantages is that C mandates a pure binary encoding, and so Gray
    > encodings are off-topic here, _unless_ you can show code which handles
    > Gray encoding "by hand". That'd be possible, but pretty inefficient.


    http://groups.google.com/groups?&selm=
     
    pete, Oct 23, 2003
    #6
  7. On Thu, 23 Oct 2003 00:36:40 +0000 (UTC), Richard Heathfield wrote:
    > Julian V. Noble wrote:
    >
    >> "Srinivas Rao (Rbin/eds2)" wrote:
    >>>
    >>> HI all,
    >>> Can any one tell me what the term "gray coding" mean in C programming.
    >>>
    >>> with regards,
    >>> K Srinivas

    >>
    >> Look in Knuth.

    >
    > I did so. Gray coding is covered in Chapter 7, which hasn't been published
    > yet AFAIK. Having said that, there are sufficient hints in Volume II to
    > answer the OP's question.


    Knuth does have Pre-Fascicle 2a available at his web site, which includes
    some Gray code coverage.

    Dave
    --
    You'll need to kill a tree to mail me.
     
    Dave Von Pless, Oct 24, 2003
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Maka Sili
    Replies:
    0
    Views:
    504
    Maka Sili
    Aug 25, 2004
  2. Maka Sili
    Replies:
    0
    Views:
    403
    Maka Sili
    Aug 25, 2004
  3. Leo Duran
    Replies:
    0
    Views:
    907
    Leo Duran
    Aug 6, 2003
  4. baigsku
    Replies:
    1
    Views:
    1,516
    joris
    Dec 14, 2009
  5. sarovarc

    Gray Code

    sarovarc, Mar 2, 2011, in forum: VHDL
    Replies:
    1
    Views:
    1,326
    sarovarc
    Mar 2, 2011
Loading...

Share This Page