473,396 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

gray code

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

with regards,
K Srinivas
Nov 13 '05 #1
6 6631
"Srinivas Rao \(Rbin/eds2\)" <sr*********@in.bosch.com> 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
Nov 13 '05 #2
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 ---
Nov 13 '05 #3
"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
jv*@spamfree.virginia.edu
^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/

"Science knows only one commandment: contribute to science."
-- Bertolt Brecht, "Galileo".
Nov 13 '05 #4
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 : bi****@eton.powernet.co.uk
"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
Nov 13 '05 #5
Richard Bos wrote:

"Srinivas Rao \(Rbin/eds2\)" <sr*********@in.bosch.com> 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
Nov 13 '05 #6
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.
Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Akbarr | last post by:
I'm using JAI for reading Tiff images: black and white, 1 bit depth. I want to scale them to reduce their size, but I want to do antialiasing. If I scale them as they are (using the scale operator)...
1
by: susie_richie_30 | last post by:
Hi, I am trying to apply gray scaling to color as well as black/white images. I have tried using the pixel by pixel approach to achieve the scaling. But the particular approach has a issue with...
0
by: Dana Epp | last post by:
I have a ToolBarButton that when I set it to disabled (button.Enabled = false;) causes a really ugly gray masking effect to take place. This is normal and the intended way of the button, but I...
5
by: Newbie! | last post by:
Hello Group, Sorry to be a pain:( Could somebody please tell me how I would gray out some TestBoxs to stop users entering data in them until they click on a Add button for example Thanks in...
2
by: allanon76 | last post by:
I need to create an Image with more then 256 gray scale. this is my code, i've some problem setting correctly the pixel value. any idea? There is another way to create an image with more then...
1
by: Sugan | last post by:
Hi all, I'm creating a custom button control. I need to show a color image when the button control is enabled and a gray shade of the same image when the button control is disabled. How can i...
5
by: MC | last post by:
Hi, I have been looking around for a way to apply the filter that grays out a form or div. I found some examples but the code is pretty complex. Any simple ways to gray that out so I can...
1
by: michelqa | last post by:
Hi, When creating a new toolStip, the default color is the default blue xp control color... How do I change the blue gradient to a gray gradient ?? I want the exact gray color like the one in...
35
by: ValValVal | last post by:
Please sorry for my dumb question but I cannot find information on how I can change settings so that in NetBeans 6.1 I can edit blue guarded areas. I read in FAQ NetBeans Wiki:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.