Error codes in residue number systems with magnitude index

The idea of adding a magnitude index to the residue representation of numbers is reconsidered. The range of a given Residue Number System is supposed to be divided into intervals of equal width and the magnitude index of a numberX is defined as an integer locatingX into one of such intervals. It is shown that the redundancy implied by the use of the magnitude index introduced in this paper, beside allowing simplification of non-modular operations, can also provide error detection or correction. The redundancy required to detect or correct single residue digit errors is the same as in Redundant Residue Number Systems and in Product Codes in Residue Number Systems. In addition, the codes under consideration allow detection of any error affecting the residue representation, provided that the magnitude of the error exceeds a given threshold, and, whenever an error is detected, it is possible to replace the wrong number with an approximation of the correct number. The accuracy of the approximation increases as the redundancy increases.