A charging device with anti-theft function includes a power-supplying unit, a load-connecting unit and an anti-theft unit. One method includes increasing a threshold voltage for each of a number of memory cells until the Vt reaches a verify voltage corresponding to a program state among a number of program states. Finally, inserted extra delay gates are deleted based on a timing constraint the clock trees is satisfied or not.