Digital Circuits
Digital Codes
12 questions By Tony R. Kuphaldt
-
Question 4 of 12
Explain why Gray code is often used in rotary encoders rather than binary coding. What difference does it make what type of code we use to mark the sectors of an encoder disk, so long as each sector possesses a unique number?
Reveal answerGray code markings are more tolerant of sensor misalignment than binary markings, because there is no need for perfect synchronization of multiple bit transitions between sectors.
Notes:This is perhaps the most important reason for using Gray code in encoder marking, but it is not necessarily obvious why to the new student. I found that making a physical mock-up of a binary-coded wheel versus a Gray-coded wheel helped me better present this concept to students. Those students with better visualization/spatial relations skills will grasp this concept faster than the others, so you might want to solicit their help in explaining it to the rest of the class.
-
Question 5 of 12
Convert the following binary numbers into Gray code:
- 1001102 =
- 1100102 =
- 1010012 =
- 10101001102 =
Reveal answer- 1001102 = 110101Gray
- 1100102 = 101011Gray
- 1010012 = 111101Gray
- 10101001102 = 1111110101Gray
Notes:There are many textbook references for the conversion process between binary and Gray code. Let your students research how the conversions are done!
-
Question 6 of 12
Convert the following Gray code numbers into binary:
- 111110Gray =
- 100001Gray =
- 101110Gray =
- 1110001111Gray =
Reveal answer- 111110Gray = 1010112
- 100001Gray = 1111102
- 101110Gray = 1101002
- 1110001111Gray = 10111101012
Notes:There are many textbook references for the conversion process between binary and Gray code. Let your students research how the conversions are done!