Digital Electronics (331102)
-
Upload
sohil-vohra -
Category
Documents
-
view
214 -
download
0
Transcript of Digital Electronics (331102)
-
8/14/2019 Digital Electronics (331102)
1/4
DIGITAL ELECTRONICS (331102)
31 | P a g e SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
PRACTICAL: 08
TO STUDY GRAY CODE
1.0 AIM : To study Gray Code and Conversion of Binary code into Gray Code and vice
versa.
2.0 PRIOR CONCEPTS : Knowledge of working of AND, OR, NOT and Ex-OR gate..
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. Thisfeature 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 codegroup changes when going from one number to the next.
Used in applications where the normal sequence of binary numbers may producean 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.
4.0 BINARY TO GRAY CODE CONVERSION : Procedure :
o Write the MSB of the Gray codesame 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.
-
8/14/2019 Digital Electronics (331102)
2/4
DIGITAL ELECTRONICS (331102)
32 | P a g e SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
o Continue the process till the LSB is reached
5.0 GRAY TO BINARY CODE CONVERSION : Procedure:
o Write the MSB of the Binary code, same asMSB of the given Gray code.
o Add the MSB in the binary result with theimmediate right most bit in the Gray code and
write the result as second binary digit.
o Continue the above process till the LSB isreached. Discard carries, if any.
-
8/14/2019 Digital Electronics (331102)
3/4
DIGITAL ELECTRONICS (331102)
33 | P a g e SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
6.0 EXERCISE :6.1 Convert following into Gray code:
1. 1000101011
2. 1000110110
3. 0010100101
4. 1100010101
6.2 Convert following into Binary code:1. 1001010010
2. 0101011001
3. 1001011011
-
8/14/2019 Digital Electronics (331102)
4/4
DIGITAL ELECTRONICS (331102)
34 | P a g e SOHIL VOHRA (LECTURER - SHRI K.J. POLYTECHNIC COLLEGE, BHARUCH (C.E. DEPTT))
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 intoBinary code and show the conversion.
Grades for Exercise: .................................................
Grades for Assignment: .................................................
Signature of Lab Co-ordinators: .................................................