A 10b 50MS/s 820uW SAR ADC with on-chip digital calibration