This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.  
Your Personal PLC Tutor Site - Interactive Q & A

"Gray code"

New Here? Please read this important info!!!
Email this topic to a friend
Printer-friendly version of this topic
Locked thread - Read only 
Previous Topic | Next Topic 
Home Conferences Questions/Answers--Early 2001 (Public)
Original message

goody Click to EMail goodyClick to view user profile - (52 posts) Click to check IP address of the poster Jun-25-01, 04:35 PM (EST)
"Gray code"
What is gray code. I do not need to use it (I dont think) but I have heard the term mentioned in conection with PLC's and I did not have a clue what was being discussed. Its only for my own information to fill a few more bytes of brain space.
  Top

 Table of contents

RE: Gray code, Steve Bailey, Jun-25-01, (1)
RE: Gray code, gbradley, Jun-25-01, (2)
RE: Gray code, Jim Dungar, Jun-25-01, (3)
RE: Gray code, Bernie Carlton, Jun-26-01, (4)
RE: Gray code, Jeff C, Jun-26-01, (5)

Lobby | Topics | Previous Topic | Next Topic
Messages in this topic

Steve Bailey Click to EMail Steve Bailey - (749 posts) Click to check IP address of the poster Jun-25-01, 05:15 PM (EST)
1. "RE: Gray code"
I don't remember (if I ever knew) all the details, but its a method of coding numbers such that only one bit changes as you move from one number to the next. I think there has been some discussion of it on this forum. Try checking through the archives.
  Top

gbradley Click to EMail gbradleyClick to view user profile - (132 posts) Click to check IP address of the poster Jun-25-01, 05:27 PM (EST)
2. "RE: Gray code"
Exactly as Steve says only one bit changes at a time.
The following link may help? (Rocket Science to me )
http://hissa.nist.gov/dads/HTML/graycode.html

George Bradley

  Top

Jim Dungar Click to EMail Jim Dungar - (158 posts) Click to check IP address of the poster Jun-25-01, 05:37 PM (EST)
3. "RE: Gray code"
Grey (Gray) code is a specific Binary Coded Decimal (BCD), in which only one bit changes at a time. This operation allows for a very smooth transition between numbers so it is used often in absolute encoders in postioning applications.

There once was a thread on how to convert BCD to Grey and back again.

  Top

Bernie Carlton Click to EMail Bernie Carlton - (36 posts) Click to check IP address of the poster Jun-26-01, 10:16 AM (EST)
4. "RE: Gray code"
The gray code is most helpful when information is transmitted in parallel. As noted, this is usually with absolute encoders, though I have seen some with a serial output. Given the uncertainties of capacitance, inductance, resistance and individual receiver sensitivity, when a parallel transmitted word is received, it may be that not all changing lines will change at the same time thus making, for a brief interval, an incorrect number. With normal coding this may yield a wildly wrong number for that small time period. Since, with gray code, only one bit changes when going from one number to the next, the biggest error would be that the number hadn't changed yet. Another item is an easy error detection. If your receiving system is fast enough to catch every number, then seeing two bits change at the same time indicates a failure. Because of the nature of gray code, it is most often used to transmit a number which is a power of two. If some other number, like 360 for example, is tranmitted, it is sent as the center numbers of the next higher power of two (512). The end two numbers (0 and 359) will be one bit transition apart. When receiving this type you must remember to subtract out the necessary offset (76 in this case).
  Top

Jeff C Click to EMail Jeff C - (2 posts) Click to check IP address of the poster Jun-26-01, 08:49 PM (EST)
5. "RE: Gray code"
Every one has hit the nail on the head, but maybe this comparision of Decimal, straight Binary and Gray Code will help.

Decimal straight Binary Gray Code
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0110 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
-

  Top


Unlock | Archive | Remove

Lobby | Topics | Previous Topic | Next Topic
Rate this topic (1=skip it, 10=must read)? [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 ]
Your Personal PLC Tutor Site Learn Now!!.