Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > gray code

Reply
Thread Tools

gray code

 
 
Srinivas Rao \(Rbin/eds2\)
Guest
Posts: n/a
 
      10-22-2003
HI all,
Can any one tell me what the term "gray coding" mean in C programming.

with regards,
K Srinivas


 
Reply With Quote
 
 
 
 
Richard Bos
Guest
Posts: n/a
 
      10-22-2003
"Srinivas Rao \(Rbin/eds2\)" <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
 
Joe Wright
Guest
Posts: n/a
 
      10-22-2003
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 ---
 
Reply With Quote
 
Julian V. Noble
Guest
Posts: n/a
 
      10-22-2003
"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://www.velocityreviews.com/forums/(E-Mail Removed)
^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/

"Science knows only one commandment: contribute to science."
-- Bertolt Brecht, "Galileo".
 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      10-23-2003
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 : (E-Mail Removed)
"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
 
Reply With Quote
 
pete
Guest
Posts: n/a
 
      10-23-2003
Richard Bos wrote:
>
> "Srinivas Rao \(Rbin/eds2\)" <(E-Mail Removed)> 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?&sel...97F4%40acm.org
 
Reply With Quote
 
Dave Von Pless
Guest
Posts: n/a
 
      10-24-2003
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gray Code sarovarc VHDL 1 03-02-2011 04:41 AM
VHDL Code for binary/Gray counter help please baigsku VHDL 1 12-14-2009 03:36 PM
Now all I get is a gray window? B. Peg Firefox 2 06-12-2005 09:55 AM
C# question: how do I make the ProgressBar dimmed/gray Maka Sili ASP .Net 0 08-25-2004 02:42 PM
C# question: how do I make the ProgressBar dimmed/gray Maka Sili ASP .Net 0 08-25-2004 02:27 PM



Advertisments