Pipeline Analog to Digital Converter
The comparison with vref/2 is because that is the place-value of the MSB of the ADC output.

the next bit has a value of 1/4 vref, so the difference value is doubled before comparison with vref/2