Using a-d convertor as function