0% encontró este documento útil (0 votos)
116 vistas11 páginas

Introducción al Código Gray

El código Gray es un código sin ponderación donde solo varía un bit entre números sucesivos. Se utiliza principalmente en sistemas de posición y fue inventado por Frank Gray para convertir señales analógicas a binario de forma que solo cambie un bit entre transiciones. Para convertir entre binario y Gray, se aplica una operación XOR entre el número y su siguiente versión desplazada un bit.

Cargado por

labakaa
Derechos de autor
© All Rights Reserved
Nos tomamos en serio los derechos de los contenidos. Si sospechas que se trata de tu contenido, reclámalo aquí.
Formatos disponibles
Descarga como PPTX, PDF, TXT o lee en línea desde Scribd
0% encontró este documento útil (0 votos)
116 vistas11 páginas

Introducción al Código Gray

El código Gray es un código sin ponderación donde solo varía un bit entre números sucesivos. Se utiliza principalmente en sistemas de posición y fue inventado por Frank Gray para convertir señales analógicas a binario de forma que solo cambie un bit entre transiciones. Para convertir entre binario y Gray, se aplica una operación XOR entre el número y su siguiente versión desplazada un bit.

Cargado por

labakaa
Derechos de autor
© All Rights Reserved
Nos tomamos en serio los derechos de los contenidos. Si sospechas que se trata de tu contenido, reclámalo aquí.
Formatos disponibles
Descarga como PPTX, PDF, TXT o lee en línea desde Scribd

CODIGO GRAY

SISTEMAS DIGITALES
Ing. Darcy D. Flores Nieblas

Hctor Eduardo Chavez Caldera 148576


Fernando Sandoval
Oscar Robles
Que es el cdigo Gray?

El cdigo gray es un cdigo sin


ponderacin que cambia solo un
bit entre una palabra de cdigo y
la siguiente en una secuencia
Es utilizado principalmente en
sistemas de posicin, ya sea
angular o lineal.
Caractersticas:

Su principal caracterstica es que


2 nmeros sucesivos, cualesquiera,
solo varan en 1 bit.
Es un cdigo continuo, cclico y no
ponderado
Historia:

Frank Gray invent un mtodo


para convertir seales analgicas
a grupos de cdigo binario
reflejado utilizando un aparato
diseado con vlvulas de vaco,
con lo cual garantiz que en
cualquier transicin variara tan
slo un bit.
Aplicaciones:

Sus aplicaciones principales se


encuentran en la industria y en
robtica.
Codificadores de posicin
Torres de Hanoi
Los algoritmos genticos
Ventajas:

La ventaja principal del cdigo de


gray es que este no te arrojara
algn resultado errneo, como lo
hacen otros cdigos(binario).
Es mas fcil corregir los errores en
las comunicaciones digitales
Conversin Binario - Gray

Para convertir un numero binario a cdigo gray, simplemente se le aplica una


operacin XOR con el numero desplazado un bit a la derecha
Ejemplo: convertir el cdigo binario 111000 a cdigo gray:

Operaciones XOR: Binario

1+1=0
0+0=0
Gray
1+0=1
0+1=1
Conversin Gray - Binario

El primer dgito del cdigo Gray ser


el mismo que el del binario
Si el segundo dgito del cdigo
Gray es 0, el segundo dgito
binario es igual al primer digito
binario, si este dgito es 1 el
segundo dgito binario es el inverso
del primer dgito binario.

Gray

Binario
Conversin Binario a Gray:

111000

011001

110101010001
Conversin Gray a Binario:

11101100

10010110

10001101
Bibliografa:
SISTEMAS DIGITALES. PRINCIPIOS Y APLICACIONES. RONALD J. TOCCI. EDITORIAL PRENTICE HALL
HISPANOAMERICA, S. A.
HTTP://[Link]/GONZALO/MAESTRIA/ALGOR/[Link]

Common questions

Con tecnología de IA

Gray code was invented by Frank Gray, who developed a method to convert analog signals into binary code groups using vacuum tube devices. This method was designed to ensure that only one bit would change at any transition, thereby minimizing errors during signal conversion, which was crucial for early digital systems .

While Gray code offers significant advantages in error reduction during bit transitions, its use can be limited by its non-weighted nature, which makes arithmetic operations more complex compared to binary code. This non-weighted aspect can lead to increased complexity in designing systems that require binary arithmetic operations, potentially reducing computational efficiency in such cases .

To convert a binary number to Gray code, apply the XOR operation between each bit and the bit immediately to its right. For example, to convert binary '111000' to Gray code, perform XOR operations as follows: keep the first bit '1'; 1 XOR 1 = 0; 1 XOR 0 = 1; 0 XOR 0 = 0; 0 XOR 0 = 0, ending with '011001' as the Gray code .

Gray code is primarily used in industrial and robotic applications, especially in position encoders for angular or linear motion. Its property that only one bit changes at a time makes it exceptionally suited for these applications, as it reduces error rates during signal transmission and processing. This is crucial for precise control systems, where correct positional information is vital, such as in motor control systems and genetic algorithms where cyclic redundancy checks are important .

The invention of Gray code by Frank Gray involved the use of vacuum tube technology, which was at the cutting edge of analog-to-digital conversions at the time. By ensuring minimal bit changes during state transitions, Gray code significantly impacted digital technologies by improving the reliability and accuracy of data transmission methods. This influence is seen in the evolution of digital systems where error minimization is crucial, setting a foundation for modern binary systems and their applications in computing and communications .

The conversion from Gray code to binary involves maintaining the first digit the same. For subsequent digits, if the Gray code digit is '0', the binary digit is the same as the previous binary digit; if it is '1', the binary digit is the inverse of the previous binary digit. This rule ensures that transitions are calculated correctly backward from Gray to binary, maintaining the one-bit change advantage .

Gray code fundamentally differs from cyclic redundancy checks (CRCs) in that it is primarily designed for state transition minimization where only one bit change occurs between successive numbers, mitigating transition errors. In contrast, CRCs are used for error detection by appending a checksum to data for verifying integrity upon transmission. While Gray code focuses on preventing transitional errors, CRCs are designed to detect errors in data blocks, each serving distinct purposes in error management .

Gray code is advantageous over traditional binary code because it reduces the likelihood of multiple bit errors during state transitions, which can lead to incorrect outputs in sensitive applications. For instance, in rotary encoders used in robotic arms, a single bit error can significantly affect the precision and accuracy of positioning. Gray code's property that only one bit changes ensures that errors are confined and easier to correct, facilitating reliable performance in applications that require high precision .

In genetic algorithms, Gray code is preferred over binary code because it helps maintain genetic diversity and reduce the effect of bit changes during crossover operations. This is crucial because the property of changing only one bit at a time prevents large alterations in parameter values during genetic evolution processes, thereby contributing to a smoother and more stable convergence to optimal solutions .

The Gray code is a non-weighted code that changes only one bit from one code word to the next in a sequence. This unique property minimizes the chance of errors during the transition between states, which is particularly beneficial in digital systems where exact transitions are crucial to avoid errors, such as in positional systems like angular or linear position encoders .

También podría gustarte