CodiodeCodiode
Home
Problem Solving
Skill Tracks
My Assignments
Contests
Leaderboard
Community
Settings
Codiode/Problems/Combinational Logic

Why Gray Code Is Used in Shaft Encoders

EasyLogic CircuitAnalyze

Physical position sensors use optical or mechanical disks to translate mechanical rotation into digital values. A system compares a standard 3-bit binary encoder disk and a 3-bit Gray code encoder disk side by side. The sensors continuously read the current position as the disks rotate from state 3 to state 4.

In standard binary, this transition is represented by the bit pattern moving from 011 to 100. In Gray code, the exact same physical transition is represented by the bit pattern moving from 010 to 110.

Analyze the intermediate states produced if the physical sensors do not align perfectly when crossing the boundary between these two positions. Determine the potential erroneous outputs for both encoding schemes and identify why one scheme is preferred for mechanical sensing.

Constraints

  • Assume the mechanical sensors can read either the old bit or the new bit independently during a transition.
  • The system samples the encoder asynchronously relative to the physical movement.
  • Standard 3-bit reflected Gray code is used.

Topics

BinaryGray CodeEncodersGlitches

Solve this problem

Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.

This problem is part of Codiode Pro. The statement above is free to read.

Sign in to solveSee what Pro unlocks

The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.

Related problems

  • Binary to HexEasy
  • 1-to-4 Demultiplexer from AND and NOT GatesEasy
  • 2-to-4 Line Decoder with Active-High EnableEasy
  • Hex Nibble to BinaryEasy
  • Odd Parity Bit Generator for 3-bit DataEasy
  • Full Adder from Half AddersEasy
  • Modulo ArithmeticMedium
  • Two's Complement: Encode a Negative DecimalEasy

Browse all problems · Learning tracks