Sign detection in residue arithmetic units