HDL code for DC and stepper motor control