What is Gray Code?

1,815 views 5 slides Sep 12, 2020
Slide 1
Slide 1 of 5
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5

About This Presentation

Extremely important topic for Digital electronics, digital circuits, computer architecture and computer science.
Full video is available on Youtube: https://youtu.be/oyOaXqx06pY


Slide Content

What is Gray Code? Mukesh N. Tekwani 7

What is Gray Code? This code is named after Frank Gray, an American physicist and researcher at the Bell Laboratories. It is a non-weighted code – the position of the bit doesn’t carry any weight. Successive code words differ in one bit only. Also called minimum change code, unit-distance code, or minimum error code It is called a cyclic code because successive words differ in one bit position only. This code is also called self-reflecting code. Used in analog -to-digital converters and for error-detection & correction. Gray code will be used when we study Karnaugh maps. Due to change of only one bit, switching operations reduced and power efficient. This code is not suitable for arithmetic operations. Mukesh N. Tekwani

4 bit Gray Code – Properties Mukesh N. Tekwani Decimal Binary Gray Code 0000 0000 1 0001 0001 2 0010 0011 3 00 11 10 4 100 1 10 5 0101 0111 6 0110 0101 7 111 100 8 1000 1 100 9 1001 1101 10 1010 1111 11 1011 1110 12 1100 1010 13 1101 1011 14 1110 1001 15 1111 1000 Non-weighted code Difference of one bit in successive codes (or minimum change code) Self-reflecting code

Gray Code As a Reflected Code Suppose we have a Gray code representation of n-bits. To obtain the Gray code representation of (n+1) bits, we write down the two n-bit representations one below the other, with the second one being a mirror image of the first. We then add (append) a at the beginning of every code in the first group and a 1 at the beginning of every code in the second group. The n least significant bits for Mukesh N. Tekwani

3 bit Gray Code as a Reflective Code Mukesh N. Tekwani Start Mirror 0s and 1s Mirror 0s and 1s 00 00 1 1 1 01 01 1 1 11 11 1 10 10 10 10 11 11 01 01 00 00 GRAY CODE GRAY CODE GRAY CODE