МАТЕМАТИЧНЕ ТА КОМП’ЮТЕРНЕ МОДЕЛЮВАННЯ MATHEMATICAL AND COMPUTER MODELING МАТЕМАТИЧЕСКОЕ И КОМПЬЮТЕРНОЕ МОДЕЛИРОВАНИЕ

Context. Implementation of modular arithmetic operations of addition, subtraction and multiplication by a tabular method based on the use of the tabular multiplication code . The object of the study is the process of tabular implementation of basic arithmetic operations on the residues of numbers represented in the system of residual classes. Objective. The goal of the work is to develop methods for the tabular implementation of the arithmetic operations of multiplication, addition and subtraction of the residues of two numbers based on the use of the tabular multiplication code. Method. Tabular methods for implementing integer arithmetic modular operations of addition, subtraction and multiplication are proposed for consideration. In order to reduce the amount of equipment for a tabular operating unit of computer systems that implements modular operations of addition, subtraction and multiplication by reducing the coincidence circuits AND in the nodes of the tables for implementing arithmetic operations based on the code of table multiplication, two methods for performing arithmetic modular operations of addition and subtraction have been developed. These methods are based on the code of tabular multiplication, the use of which will reduce the amount of equipment of the tabular operating unit. Thus, despite the difference in the digital structure of the tables of modular operations of addition, subtraction and multiplication based on the use of the tabular multiplication code, two new tabular methods for implementing arithmetic modular operations of addition and subtraction have been created. Based on them, algorithms for tabular execution of modular arithmetic operations of addition and subtraction have been developed. Using these algorithms, it is possible to synthesize a structurally simple, highly reliable and fast table operating unit that operates in a system of residual classes, which is based on three separate permanent storage devices (read-only memory), each of which implements only one fourth of the corresponding complete table of values of the modular operation, what is earlier in the theory tabular arithmetic was supposed to be impossible. Results. The developed methods are justified theoretically and studied when performing arithmetic modular operations of addition, subtraction and multiplication using tabular procedures. Conclusions. The conducted examples of the implementation of integer arithmetic modular operations of addition and subtraction can be considered as presented experiments. The results obtained make it possible to recommend them for use in practice in the design of computer systems operating in a non-positional number system in residual classes. Prospects for further research may be to create a tabular method for implementing integer arithmetic modular division operations based on the use of the tabular multiplication code.


ABBREVIATIONS
CS is a computer system; MCA is machine-computer arithmetic; BPNS is a binary positional number system; SRC is a system in residual classes; TMC is a tabular multiplication code; TOU is a tabular operating unit.

INTRODUCTION
It is known that one of the effective ways to increase the speed of a CS operating in the BPNS has led to the need to develop new MCA. MCA is based on the theory of residues of natural numbers and on the results of the proof of the Chinese remainder theorem. In the literature, such an MCA is called a non-positional number system in SRC [1][2][3][4]. Based on the properties of the SRC, its use allows to significantly increasing the speed of performing integer modular arithmetic operations of addition, subtraction and multiplication of the residues of numbers modulo SRC. In addition, such a property of the SRC as the low-bit capacity of the residues, the totality of which determines the non-positional code structure, makes it possible to effectively apply the tabular implementation of arithmetic operations [1,2]. In the general case, the TOU of the CS for the implementation of arithmetic operations that are performed in a unitary code is a twoinput ROM. For each of the ROM inputs, the number of input buses for the l-byte (8l bits) CS is 2 8l . In this case, the total number of logic circuits AND in the ROM nodes (which basically determines the amount of equipment of the TOU of CS in the BPNS) is equal to the value N l BPNS = 2 8l × 2 8l = 2 16l . It is obvious that the table implementation of integer arithmetic operations in the usual BPNS is appropriate only for the value l=1 [5].
The search for ways to increase the efficiency of using tabular arithmetic necessitated the development and improvement of methods for tabular implementation of the main integer modular arithmetic operations: addition, subtraction and multiplication of the residues of numbers, aimed at reducing the number of ROM elements.
The object of study is the process of implementing arithmetic modular operations of addition, subtraction and multiplication in SRC.
The process of implementing arithmetic operations based on the BPNS involves the sequential processing of digits of numbers according to the rules determined by the content of this operation, and cannot be completed until the values of all intermediate results are sequentially determined, taking into account all connections between the digits. This drawback significantly affects the methods for implementing arithmetic operations and limits the speed of data processing. The number system in SRC has the valuable property of independence of the residues of the processed numbers in the accepted base system, which opens up wide opportunities in building not only new machine arithmetic, but also a fundamentally new circuit implementation of the data processing CS with the effective use of tabular methods.
The subject of study is the tabular methods for implementing arithmetic modular operations of addition, subtraction and multiplication.
The known tabular methods are distinguished by the complexity of implementation, low speed of implementation of basic arithmetic operations, as well as an increase in the amount of TOU equipment with an increase in the length of the bit grid, which is typical for the modern trend in the development of powerful computing systems.
The purpose of the work is to increase the efficiency of using tabular methods for performing basic arithmetic operations (addition, subtraction and multiplication) based on the representation of numbers in SRC and the use of a tabular multiplication code.

PROBLEM STATEMENT
In a formalized form, the statement of the problem of the article can be represented as a realization of two analytical relations. For the first method of performing a modular addition operation through the result of a modular subtraction operation, the first analytical relation is represented as: For the second method of performing a modular subtraction operation through the result of a modular addition operation, the second analytical relation is represented as:  These methods implement the operations of modular addition and subtraction for the original two numbers А and В represented in the SRC as a set of residues an arbitrary modulo i m SRC, i.e. residues , ) the residues are obtained from the successive division of the initial number by a set of mutually pairwise prime numbers i m called bases or SRC modules. Such a representation of numbers (coding) makes it possible to construct data processing CSs in which the processing of all digits (residues) is performed in parallel in time.
Denote the generalized arithmetic operation as  , which will be used as a sign (feature) of the arithmetic operation of modular multiplication, addition or subtraction. For numbers А and В represented by the SRC code The result of the operation can be represented as follows: In this case, it is necessary that the following inequalities hold:

REVIEW OF THE LITERATURE
The results of the search for ways to improve the performance of CS, effective methods for implementing the basic operations of the computational process and as a result of building high-speed and high-reliable systems, carried out over the past decades by various groups of researchers have confirmed in the opinion that within the BPNS one cannot expect significant satisfactory progress in these areas without a significant increasing the operating frequencies of the processor elements and the complication of the hardware part of the CS [1][2][3][4][5][6][7][8][9][10][11][12].
The results of research in the field of the creation of high-speed CS of well-known authors (Aksushskyi I.Ya. and Yuditskyi D.I. [1], Gregory R.T. and Krishnamurthy E.V. [6], Mohan P.V.A. [9] and others) showed that the use of SRC as a system of calculations of CS, intended for the implementation of integer arithmetic operations of addition, subtraction and multiplication numbers in the positive numerical range, significantly increases the speed of the solution of problems of a certain class [13].
In order to be able to build CS in SRC, it was necessary to develop fundamental methods for constructing MCA [1,7,14]. The implementation of the obtained theoretical and practical results will contribute to the creation, development and operation of real CS operating in a nonpositional number system in the residual classes [15][16][17][18][19][20]. Prospects for further research may be to create a tabular method for implementing integer arithmetic modular division operations based on the use of the tabular multiplication code [16].

MATERIALS AND METHODS
Let's first consider the procedure for implementing the arithmetic operation of modular multiplication Using the symmetry properties of the modular multiplication table of the residues of numbers, you can completely restore the complete table of values (mod ) of the multiplication operation of residues using only 0.25 of its part. Hence, it becomes possible to simplify the table (reduce the number of two-input elements AND of the TOU corresponding to the nodes of the complete modular multiplication table. To solve the problem, it is necessary to introduce a sign (feature) that determines the location of the input residues of numbers in each of the four quadrants of the complete modular multiplication table. In [1] this sign is called tabular multiplication code.
Consider of the TMC is introduced defined as follows: The procedure for determining the result of a modular multiplication operation by means of TMC is as follows. If two residues are given modulo where || -the mathematical sign of the concatenation operation (the operation of gluing, the operation of joining) and To get the product of these numbers modulo i m , it is enough to get the product (mod ) i.e. the result of multiplying two residues modulo can be represented as Until now, there are no methods for performing by means of TMC, arithmetic modular operations of adding and subtracting the residues of two numbers, which make it possible to reduce the number of two-input elements AND in the TOU CS. This hinders the further development of SRC in terms of the practical use of tabular arithmetic. The main difficulty lies in the fact that it is quite difficult to synthesize algorithms for performing modular operations due to the fact that tables performing modular operations of multiplication, addition and subtraction are different in their digital structure. When studying the digital properties of tables of modular addition and subtraction operations, the validity of expression (3) is shown: (3) can be interpreted as an analytical dependence of the modular operations of addition and subtraction of the residues modulo numbers presented in the TMC.
It follows from expression (3) that in order to obtain the result of the modular addition operation by means of the TMC, it is sufficient to know the result of the modular subtraction and to obtain the result of the modular subtraction operation by means of the TMC, it is sufficient to know the result of the modular addition. That is, it becomes possible to effectively (from the point of view of reducing the ROM hardware) use the TMC not only to perform the modular multiplication operation, but also to implement the modular addition and subtraction operations.
Let's write expression (3) in the form (4). Expression (4) is the mathematical basis of the tabular method for performing the operation of modular addition using tables that implement the operation of modular subtraction: The method of performing the operation of modular addition using tables that implement the operation of modular subtraction can be represented as follows (Fig. 1).
Determining the result of an operation (γ ||( ) mod ) Via ROM for modular subtraction by input operands i a and i b the result of the operation is determined ( )mod . The index of the result of the operation is formed in accordance with the values of the indices of the corresponding operands, i.e. according to the values (γ 1) mod 2 i a  and γ , The searched result of the modular addition operation Figure 1 -The method of performing the operation of modular addition using tables that implement the operation of modular subtraction The resulting method can be schematically represented in the form of 4 stages: Let's write expression (3) in the form (5). Expression (5) is the mathematical basis of the tabular method for performing the operation of modular subtraction using tables that implement the operation of modular addition: i.e. it is possible to determine the result of the modular subtraction operation by means of a ROM that implements the modular addition operation.
Consider the result of a modular arithmetic operation in the TMC, which is represented as: where γ r -sign of the TMC of the result of a modular arithmetic operation. Expression Φ ( , ) i b  The method of performing the operation of modular subtraction using tables that implement the operation of modular addition can be represented as follows (Fig. 2).
Simplified schematically, the second method can be represented in the form of 3 stages: When jointly implementing the arithmetic operations of addition and subtraction, the second method allows, in comparison with the first method, to implement the arithmetic modular subtraction operation in less time and with less hardware costs. Despite the difference in the digital structure of the tables of modular operations of addition, subtraction and multiplication (for example, for 5, i m  these are Tables 2-9), the developed first and second methods of additionsubtraction, which implement arithmetic modular operations, can reduce the number of elements of the TOU CS. This is achieved by simultaneously using only fourth part of each of the three complete addition, subtraction and multiplication tables by using TMC, which was previously thought to be impossible.

EXPERIMENTS
The experimental base of research is based on the theory of residues of natural numbers and on the results of the proof of the Chinese remainder theorem. The initial data in the form of bases (modules) i m SRC are represented by a set of mutually pairwise prime numbers.
In the developing of the methods, the influence of the main properties of the SRC on the structure and principles of the functioning of the CS was used. Due to the low-bit capacity of the computational paths of the data processing CS presented in the SRC, there are possibilities for using (unlike the BPNS) tabular arithmetic, where the arithmetic operations of addition, subtraction and multiplication are performed almost in one clock cycle. The low-bit capacity of residuals in the representation of numbers in the SRC makes it possible to choose a wide range of options for system engineering solutions in the implementation of modular arithmetic operations tabular principle basis (based on the use of small ROM).
Tabular methods for the implementation of arithmetic modular operations of addition, subtraction and multiplication based on the use of the TMC are proposed for consideration. In the performing, using the tabular methods of modular arithmetic operations developed in the article, it was possible to reduce the amount of equipment of the TOU through which these operations are implemented. Note that with an increase in the length of the bit grid, which is typical for the modern trend in the development of powerful computing systems, the efficiency of using the proposed tabular methods for performing modular arithmetic operations increases significantly.
As experiments carried out in this article, we can consider a brief description of the structures and content of two methods (Fig. 1, 2) and two algorithms for the tabular implementation of modular arithmetic operations of addition-subtraction (Tables 10, 11).
The proposed methods are brought to algorithms, on the basis of which classes of patentable devices that implement these algorithms have been developed and for which Ukrainian patent have been received (state patent of Ukraine for the invention № 106343 from 11.08.2014. "A device for tabular implementation of arithmetic operations of multiplication and addition of numbers modulo i m of the residual class.").
Some of the results obtained in the article are a definite contribution to the theory and practice of tabular arithmetic, which can be used to create CS in the SRC.

RESULTS
As a demonstration of the effectiveness of the developed methods, consider examples of a specific implementation of arithmetic modular operations of multiplication, addition and subtraction for a module equal to the value 5.
i m  In this case, for the tabular method of the table for the implementation of modular operations of using TMC the initial data are presented in Tables 1-9. The first and second algorithms for performing modular addition and subtraction operations, respectively, by the first and second methods, are presented in Table 10 and Table 11, respectively.
Inversion of the second term ((γ 1) mod 2 || ) The searched result of the modular subtraction operation           In the implementing modular operations using the first algorithm, the TOU CS is based on three ROMs. The first ROM implements the II-quadrant of the complete multiplication table (Table 5); the second and third ROMs implement, respectively, I (Table 7) and II (Table 6) quadrants of the complete subtraction table).
In the implementing modular operations using the second algorithm, the TOU CS is also based on three ROMs, each of which implements 0.25 parts of the corresponding complete table of modular multiplication operations (Table 2) and addition ( Table 3). The first ROM implements the II-quadrant of the complete multiplication table (Table 5); the second and third ROMs implement, respectively, I (Table 9) and II (Table 8) quadrants of the complete addition table. In this regard, the TMC acquired a new quality and became a universal tabular code for performing three arithmetic modular operations: addition, subtraction and multiplication.
In the implementing the arithmetic operations of addition and subtraction, the second proposed universal method makes it possible to implement a modular operation in less time and with less hardware costs (compared to the first method).
The result is determined directly by the values of the nodes in Table 7 Quadrant I is used (Table 7) of the complete table of modular subtraction γ 0 The result is determined directly by the values of the nodes in Table 7 The result is determined directly by the values of the nodes in Table 7 Quadrant I is used ( The result is determined directly by the values of the nodes in Table 6 Quadrant II is used ( Ta Quadrant I is used (Table 9)  of the complete table of  modular addition  γ  γ The result is determined directly by the values of the nodes in Table 9 The result is determined by inverting modulo i m the node values of Table 8 Quadrant II is used ( Ta Table 8 The result is determined directly by the values of the nodes in Table 8 Quadrant II is used ( Ta The result is determined directly by the values of the nodes in Table 9 Quadrant I is used (   (Table 5). Thus, the result of modular arithmetic multiplication ( )mod (2 4)mod5 Table 1, 2 and 5.
Consider the execution of the modular addition operation ( )mod for the first and second algorithms (the first and second methods): The first algorithm (Table 10). The result of the modular addition is presented in the form (γ || Φ ( , )), Table 6). Check: (2 4) 1(mod 5),   see Table 1, 3, 6 and 10.
The second algorithm (Table 11). The result of the modular addition operation is represented in the form (γ || Φ ( , )),  Table 9, the value is 1. The result of the operation will be as follows (γ || Φ ( , )) (0 ||1).   see Table 1, 3, 9 and 11. Consider the operation of modular subtraction for the first and second algorithms (the first and second methods): The first algorithm (Table 10). The result of the modular subtraction operation is represented as (γ || Φ ( , )), 3(mod 5),  see Table 1, 4, 7 and 10. The second algorithm (Table 11). Consider the implementation of the modular subtraction operation in the TMC, the result of the operation will be presented in the form (γ || Φ ( , )), Table 8). The result of the operation of modular subtraction in the TMC, in accordance with the second algorithm, will be equal to (γ || Φ ( , )) (1|| 2).
see Table 1, 4, 8 and 11. The results of the experimental or theoretical data obtained in the article consist in the development of two methods and two algorithms for the implementation of modular arithmetic operations of addition-subtraction in the SRC, by means of the TMC. The obtained scientific and theoretical results of the article represent a significant step forward compared to previous studies in the field of the theory of the implementation of modular operations using the tabular principle. So, Fig. 1 shows a method for performing a modular addition operation using table data that implements a modular subtraction operation, and Fig. 2 shows a method for performing a modular subtraction operation using table data that implements a modular addition operation. For this, digital data of tables for the implementation of integer modular addition-subtraction operations were developed (Tables 1-9). When developing the theoretical part, the methods for performing arithmetic modular operations presented in the article, various methods of cognition were used. For example, when synthesizing a non-positional code structure in the SRC, the induction method was used, and when implementing modular operations in the SRC, the deduction method and others were used. Based on the developed methods, algorithms for performing modular arithmetic operations of addition-subtraction in the SRC are presented (Tables 10, 11).

DISCUSSION
The analysis and assessment of the reliability of the results is based, firstly, on the correct use of the rules of tabular arithmetic. Secondly, on a clear and complete use of the properties of the SRC. And, finally, thirdly, the reliability of the results is confirmed by examples of tabular implementation of arithmetic modular additionsubtraction operations in the SRC, by means of the TMC, for specific values of the residues of numbers in the SRC. The scientific results obtained in this article refute similar results of prominent scientists in the field of implementation of tabular modular operations. So, for example, in chapter 6 "Computer components in the system of residual classes", 6.3 "Fundamentals of tabular arithmetic", on page 337 in the monograph of Aksushskyi I.Ya. and Yuditskyi D.I. "Machine arithmetic in residual classes", who are the founders of scientific and technical developments in the field of the SRC in the USSR, the following is noted "... the tabular multiplication code is fundamentally unsuitable for use in the addition operation ..." [1]. This conclusion contradicts the conclusion of this article about the effective use of the TMC not only for the operation of modular multiplication, but also for the implementation of modular addition-subtraction operations. The practical application of the results of the article is possible when creating a tabular operating device of a computer system operating in the SRC. The expediency of further research in the field of application of tabular arithmetic is due to the fact that this approach makes it possible to create high-speed and reliable computer systems.

CONCLUSIONS
A scientific and technical problem has been solved, which consists in developing methods and algorithms for the tabular implementation of the arithmetic operations of multiplication, addition and subtraction of the residues of two numbers based on the use of the tabular multiplication code.
The scientific novelty of obtained results is that two new tabular methods for the implementation of arithmetic modular operations of addition and subtraction have been created based on the use of the TMC, despite the difference in the digital structure of the tables of these modular operations. The use of the developed methods makes it possible to reduce the number of TOU CS equipment that implements the modular operations of addition, subtraction and multiplication by reducing the matching circuits AND in the nodes of the tables for implementing arithmetic operations based on the TMC. Based on these methods, algorithms for the tabular implementation of modular arithmetic operations of addition and subtraction have been developed. With the help of these algorithms, it is possible to synthesize a structurally simple, high-reliable and high-speed TOU CS operating in the SRC, which is based on three separate ROMs, each of which implements only 0.25 of the corresponding complete table of values of the modular operation, which was previously assumed impossible in the theory of tabular arithmetic.
The practical significance of obtained results is that in the performing, using the tabular methods developed in the article, modular arithmetic operations, it was possible to reduce 75% of the equipment of the TOU CS, through which these operations are implemented. This, in turn, as shown by the calculations, depending on the length of the bit grid of the CS, made it possible to reduce to  (50-60)% of the equipment of the TOU CS in the SRC. Note that with an increase in the bit grid length CS, which is typical for the modern trend in the development of powerful computing systems, the efficiency of using the proposed tabular methods for performing modular arithmetic operations increases significantly. Some of the results obtained in the article are a definite contribution to the theory and practice of tabular arithmetic and it can be used when creating a CS in the SRC.