Hardware emulation

Hmmm that is a pretty interesting idea. I am somewhat of a beginner. How would I figure out what sort of pulses to program to emulate a rotary encoder?