Digital PWM Rtl design
Digital pwm is build by only two units [1] counter [2] comparator , and its out put is pwm output, you can take either 'greater' or 'less' as output. For demo purpose i took 5 bit wide.you can take according to your need. The comparator 2nd input act as duty cycle value input.
From wave form we can notice that the width of pulse is change with respective to the input DC value. This design can be useful to control the speed of motor , dimming application of light, or DAC application using single wire and small RC filter at the output. Hope you get the design idea. In later time i will share all the code on my github space. Stay connected.