I caught the long thread here on the quadrature rotary encoder from 2 weeks ago. Like the OP in that thread, I am new to combinatorial logic and describing it with VHDL.
The problem on the surface seems so enticingly simple. Peter's solution presented with the "high" speed clock strikes me as wasteful. (I'll gratefully accept your guidance and correction, of course.)
The quadrature decoder itself seems reasonably well defined by a single D flipflop with clock enable. One encoder switch (call it q1) clocks the dff on its rising edge. Debouncing logic drives the clock-enable. The second encoder switch (q2) drives D, making Q the direction of rotation. Direction and some strobe can feed the direction and clock on an up/down counter.
The "some strobe" part could be problematic. Is there no way to generate this without an external clock? If I drive the counter clock from the debounced q1, it arrives before direction is valid. (Maybe that's good enough and usable. I only want to get this into the starter kit, marvel at some moving LEDs, and then move on. At this point, I can live with a little backlash and some inaccuracy at direction changes.) It seems I can simply gate q1 with an inverted debounce signal, using a simple AND2 with one inverted input, to drive the counter strobe.
Debouncing seems on the surface pretty simple also: ignore further changes on q1 until q2 changes sense. And this seems to be where I'm stuck. I want to sample q2 on the rising edge of q1, and compare q2 with its value with the old q2 value when debouncing started. Alternatively, I want to clock "something" on the next arriving rising _or_ falling edge of q2. XST doesn't like either one, and my head is likewise in a pretzel here. Isn't there any way to do this part without an external clock?
(I left school 25 years. This is self assigned homework, and usenet and amazon.com are my only classrooms. Your help is really the only help I'll get.)
Regards, Mike.