EE 231
Prelab 12: A Quadrature Decoder for Motor Position Determination

Design a state machine having at least two inputs (CH_A and CH_B) and two outputs (dir and ctr_clk). The outputs should determine the direction of rotation of the motor shaft (dir) and generate a clock signal (ctr_clk) having only one rising edge for each input pattern.  The direction (dir = 1 = clockwise = up; dir = 0 = counter-clockwise = down) and clock (ctr_clk) signals will be used to drive an up/down counter.

  1. Sketch the desired waveforms of your state-machine for the case of clockwise rotation and be sure to include all the inputs (including CH_A and CH_B) and outputs in your sketch.

  2. Sketch the desired waveform of your state-machine for the case of counter-clockwise rotation and be sure to include all the inputs (including CH_A and CH_B) and outputs in your sketch.

  3. Create a detailed state diagram(s)of your design and generate a *.tdf file(s) suitable for implementing your design in ALTERA during the lab session.  Be sure to include a common asynchronous RESET input.

  4. Is your design a Mealy or Moore machine?

  5. What have you done about the lack of an input clock?