The present invention provides improved line and load regulation of a switching-mode
power converter (300) without requiring additional capacitors (255),
either internally or externally, to stabilize the control loop. The present invention
can provide this by integrating a digital compensator (375) with the pulse-width
modulator ("PWM") of the switching-mode power converter. Such a compensator (375)
can include comparators (310 and 330), digital circuits (340),
and resistors (215, 220, 320, and 325).