There is a chip for that... like the MAX662 for example.
http://datasheets.maxim-ic.com/en/ds/MAX662A.pdf