Documente Academic
Documente Profesional
Documente Cultură
PRACTICAL: 08
To study Gray Code and Conversion of Binary code into Gray Code and vice
versa.
3.0 INTRODUCTION :
Gray Code is a form of binary that uses a different method of incrementing from
one number to the next.
With Gray Code, only one bit changes state from one position to another. This
feature allows a system designer to perform some error checking (i.e. if more
than one bit changes, the data must be incorrect).
Advantage of Gray code over straight binary sequence: Only one bit in the code
group changes when going from one number to the next.
Used in applications where the normal sequence of binary numbers may produce
an error or ambiguity during the transition from one number to the next. Ex: for
encoding shaft position data from machines such as computer-controlled lathes.
Procedure :
o Write the MSB of the Gray code
same as the corresponding MSB in
the binary number.
o Going from left to right, add each
adjacent pair of binary code bits to
get the next Gray code bit. Discard
the carries if any.
31 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
DIGITAL ELECTRONICS (331102)
32 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
DIGITAL ELECTRONICS (331102)
6.0 EXERCISE :
2. 1000110110
3. 0010100101
4. 1100010101
2. 0101011001
3. 1001011011
33 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
DIGITAL ELECTRONICS (331102)
4. 1100010100
7.0 ASSIGNMENT :
7.1 Design a 6 bit Binary to Gray Code convertor and convert (100101) 2 into
Gray code and show the conversion.
7.2 Design a 6 bit Gray to Binary Code convertor and convert (100101) gray into
Binary code and show the conversion.
34 | P a g e
SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))