A universal analogue to digital converter