first of all i would like to tell you , these type of rotary encoder is totally digital component so you can’t directly replace these with you conventional pots. so lets start what are Incremental Rotary Encoder , Incremental rotary encoders by the looks of it just like a general purpose pot looks like but output is quite different they provide a pair of digital signals that allow a microcontroller to determine the direction of a shaft’s rotation. They can be used to monitor motors and mechanisms, or to provide a control-knob user interface.
for a quick look here is a typical incremental rotary encoder
and hear the output wave form
Decoding with Microcontroller in this examples we will be decoding the rotary encoder with the help of sate machine.