1. A method for operating a dimmable LED comprising:coupling an LED driver circuit to a rectified output of a dimmer;
providing a current related to an input voltage of the LED driver circuit;
multiplying the value of a reference voltage related to a reference current with a pulse width modulation (PWM) signal having a duty cycle of the LED driver to generate a first voltage, wherein the multiplying includes:
selectively transferring the reference voltage to a multiplication output node based on the PWM signal;
selectively transferring a ground voltage to the multiplication output node based on an inverted version of the PWM signal; and
outputting the first voltage at the multiplication output node;
comparing the first voltage with a second voltage representative of the current through a switch in the LED driver circuit to generate a comparison signal;
using the comparison signal to generate the PWM signal having the duty cycle for controlling the switch and the multiplying.