The reflected binary code , also known as Gray code after Frank Gray, is a binary numeral system where two successive values differ in only one bit.

The reflected binary code was originally designed to prevent spurious output from electromechanical switches. Today, Gray codes are widely used to facilitate error correction in digital communications such as digital terrestrial television and some cable TV systems.

Name

Bell Labs researcher Frank Gray introduced the term reflected binary code in his 1947 patent application, remarking that the code had "as yet no recognized name". He derived the name from the fact that it "may be built up from the conventional binary code by a sort of reflection process".

The code was later named after Gray by others who used it. Two different 1953 patent applications give "Gray code" as an alternative name for the "reflected binary code"; one of those also lists "minimum error code" and "cyclic permutation code" among the names. A 1954 patent application refers to "the Bell Telephone Gray code".

History and practical application

Reflected binary codes were applied to mathematical puzzles before they became known to engineers. The French engineer Émile Baudot used Gray codes in telegraphy in 1878. He received the French Legion of Honor medal for his work. The Gray code is sometimes attributed, incorrectly, to Elisha Gray (in Principles of Pulse Code Modulation , K. W. Cattermole, for example).

Frank Gray, who became famous for inventing the signaling method that came to be used for compatible color television, invented a method to convert analog signals to reflected binary code groups using vacuum tube-based apparatus. The method and apparatus were patented in 1953 and the name of Gray stuck to the codes. The "PCM tube" apparatus that Gray patented was made by Raymond W. Sears of Bell Labs, working with Gray and William M. Goodall, who credited Gray for the idea of the reflected binary code.

The use of his eponymous codes that Gray was most interested in was to minimize the effect of error in the conversion of analog signals to digital; his codes are still used today for this purpose, and others.

Position encoders

Gray codes are used in position encoders (linear encoders and rotary encoders), in preference to straightforward binary encoding. This avoids the possibility that, when several bits change in the binary representation of an angle, a misread could result from some of the bits changing before others. Rotary encoders benefit from the cyclic nature of Gray codes, because the first and last values of the sequence differ by only one bit.

Tower of Hanoi

The binary-reflected Gray code can also be used to serve as a solution guide for the Tower of Hanoi problem. It also forms a Hamiltonian cycle on a hypercube, where each bit is seen as one dimension.

Genetic algorithms

Due to the Hamming distance properties of Gray codes, they are sometimes used in Genetic Algorithms. They are very useful in this field, since mutations in the code allow for mostly incremental changes, but occasionally a single bit-change can cause a big leap and lead to new properties.

Karnaugh maps

Gray codes are also used in labelling the axes of Karnaugh maps.

Error correction

In modern digital communications, Gray codes play an important role in error correction. For example, in a digital modulation scheme such as QAM where data is typically transmitted in symbols of 4 bits or more, the signal's constellation diagram is arranged so that the bit patterns conveyed by adjacent constellation points differ by only one bit. By combining this with forward error correction capable of correcting single-bit errors, it is possible for a receiver to correct any transmission errors that cause a constellation point to deviate into the area of an adjacent point. This makes the transmission system less susceptible to noise.

Communication between clock domains

Digital logic designers use gray codes extensively for passing multi-bit count information between synchronous logic that operates at different clock frequencies. The logic is considered operating in different "clock domains". It is fundamental to the design of large chips that operate with many different clocking frequencies.

Gray-code counters and arithmetic

A typical use is building a fifo (first-in, first-out) data buffer that has read and write ports that exist in different clock domains. The input and output counters inside such a dual-port FIFO are often stored using gray code to prevent invalid transient states from being captured when the count crosses clock domains. The updated read and write pointers need to be passed between clock domains when they change, to be able to track fifo empty and full status in each domain. Each bit of the pointers is sampled non-deterministically for this clock domain transfer. So for each bit, either the old value or the new value is propagated. Therefore, if more than one bit in the multi-bit pointer is changing at the sampling point, a "wrong" binary value (neither new nor old) can be propagated. By guaranteeing only one bit can be changing, gray codes guarantee that the only possible sampled values are the new or old multi-bit value. Typically gray codes of power-of-two length are used.

Sometimes digital buses in electronic systems are used to convey quantities that can only increase or decrease by one at a time, for example the output of an event counter which is being passed between clock domains or to a digital-to-analog converter. The advantage of Gray code in these applications is that differences in the propagation delays of the many wires that represent the bits of the code cannot cause the received value to go through states that are out of the Gray code sequence. This is similar to the advantage of Gray codes in the construction of mechanical encoders, however the source of the Gray code is an electronic counter in this case. The counter itself must count in Gray code, or if the counter runs in binary then the output value from the counter must be reclocked after it has been converted to Gray code, because when a value is converted from binary to Gray code, it is possible that differences in the arrival times of the binary data bits into the binary-to-Gray conversion circuit will mean that the code could go briefly through states that are wildly out of sequence. Adding a clocked register after the circuit that converts the count value to Gray code may introduce a clock cycle of latency, so counting directly in Gray code may be advantageous. A Gray code counter was patented in 1962 US3020481 , and there have been many others since. In recent times a Gray code counter can be implemented as a state machine in Verilog. In order to produce the next count value, it is necessary to have some combinational logic that will increment the current count value that is stored in Gray code. Probably the most obvious way to increment a Gray code number is to convert it into ordinary binary code, add one to it with a standard binary adder, and then convert the result back to Gray code. This approach was discussed in a paper in 1996 Some issues in gray code addressing and then subsequently patented by someone else in 1998 US5754614 . Other, potentially much faster methods of counting in Gray code are discussed in the report The Gray Code by R. W. Doran, including taking the output from the first latches of the master-slave flip flops in a binary ripple counter.

Motivation

Many devices indicate position by closing and opening switches. If that device uses natural binary codes, these two positions would be right next to each other:

                  ...011100...
                

The problem with natural binary codes is that, with real (mechanical) switches, it is very unlikely that switches will change states exactly in synchrony. In the transition between the two states shown above, all three switches change state. In the brief period while all are changing, the switches will read some spurious position. Even without keybounce, the transition might look like 011 — 001 — 101 — 100. When the switches appear to be in position 001, the observer cannot tell if that is the "real" position 001, or a transitional state between two other positions. If the output feeds into a sequential system (possibly via combinational logic) then the sequential system may store a false value.

The reflected binary code solves this problem by changing only one switch at a time, so there is never any ambiguity of position,

                  Dec Gray Binary 0 000 000 1 001 001 2 011 010 3 010 011 4 110 100 5 111 101 6 101 110 7 100 111
                

Notice that state 7 can roll over to state 0 with only one switch change. This is called the "cyclic" property of a Gray code. A good way to remember gray coding is by being aware that the least significant bit follows a repetitive pattern of 2. That is 11, 00, 11 etc. and the second digit follows a pattern

TRANSLATOR, BINARY

TRANSLATOR, BINARY ... The source code for this page is available here. Credit for this idea goes to http://nickciske.com/binary/ in its original form in ...

...

Morse Code Translator

Translate text to Morse Code. See also Morse code DeTranslator, Binary code Translator.

...

Binary translation - Wikipedia, the free encyclopedia

The Code Morphing software acts as a shell ... morphing or translating x86 ... csdl.computer.org/comp/mags/mi/1998/02/m2056abs.htm - FX!32, an x86 to Alpha binary translator ...

...

NickCiske.com | Binary - it's digitalicious!

How this all works: The binary number system (aka base 2) represents values using two symbols, typically 0 and 1. Computers call these bits. A bit is either off (0) or on (1).

...

Binary to Text (ASCII) Conversion

... messsage that only a handful of people can actually crack the code? Well ... Binary, Text, ASCII, Conversion, Binary to Text, Binary Translator, Binary Translation

...

Text to Binary translator « Geek Notes

85 comments for “Text to Binary translator” (RSS) Brian Lester wrote ... 01101001 01110100 okay then thats the instructions in binary code Text to Binary translator ...

...

Binary Code Translator

Binary Code Translator (Beta) Convert text to Binary Code. See also Morse code Translator.

...

Scratch | Project | Binary Code Translator v1.0

Scratch: a programming language for everyone. Create interactive stories, games, music and art - and share them online.

...

Undo-Redo, a binary code translator | Get Undo-Redo, a binary code ...

Get Undo-Redo, a binary code translator at SourceForge.net. Fast, secure and free downloads from the largest Open Source applications and software directory

...

SourceForge.net: Matthias Melcher - User Profile

Undo-Redo, a binary code translator. matthiaswm committed revision 9 to the Undo-Redo, a binary code translator SVN repository, changing 2 files. 2006-05-08 20:38:14 UTC in Undo-Redo, a ...

...


Warning : str_repeat() [ function.str-repeat ]: Second argument has to be greater than or equal to 0 in /home/malkuth/domains/things.hobby-site.com/public_html/38/html/main/main.php on line 426