As the mechanical encoder shaft is rotated from one position to the next, the encoder will momentarily generate some of the other output codes before it comes to rest in the detent position of the desired output code. This is due to the fact that more than one bit is changing it’s on-off state as the shaft is rotated from one position to the next. This can be a problem in some applications. With a special output code, called gray code, or true shorting code, only one bit changes state from one switch position to the next.