6
Cybernetics and Systems Analysis, Vol. 50, No. 5, September, 2014 CYBERNETICS THEORETICAL FOUNDATIONS FOR THE ANALYTICAL COMPUTATION OF COEFFICIENTS OF BASIC NUMBERS OF KRESTENSON’S TRANSFORMATION Ya. M. Nykolaychuk, a† M. M. Kasianchuk, a‡ and I. Z. Yakymenko a†UDC 519.7 Abstract. This paper presents theoretical foundations for the analytical transformation of coefficients of basic numbers of Krestenson’s transformation, which significantly reduces the number of operations required to convert numbers from a residue number system to the decimal number system. An appropriate selection of modules makes it possible to efficiently use all processor registers. Keywords: residue number system, system of modules, basic number, Krestenson transformation, number-theoretical basis. INTRODUCTION At present, one of main trends in developing computer aids is the creation of high-performance computing devices [1]. It is stipulated by the need for the solution of problems that are very important for the theory and practice of mathematics and require computations with integer multidigit numbers or quantities changing in rather large ranges [2]. In this connection, the applied and computational aspects of number theory are intensively being developing and are used in egineering systems to provide the reliability of transmission, storage, and processing of digital information. This leads to the need for the solution of many problems when computations arise in which lengths of integer variables can considerably exceed the format of existing universal computational tools, which is especially urgent with developing cryptographic methods and information protection facilities [3, 4]. ANALYSIS OF PUBLICATIONS Any computational structure is closely connected with number-theoretic bases (NTBs) in which methods are given for coding (representing) elements of some finite model of real numbers by elements of one or several alphabets [5]. Arithmetic properties of any number system that are generated by the corresponding NTB are first of all determined by the nature of the interbit relations arising during the execution of the corresponding arithmetical and logical operations [6]. Investigations show [5, 7] that, within the scope of usual (decimal and binary) positional notations, it is practically impossible to reach a stepwise speedup of execution of the arithmetic operations of addition, subtraction, and multiplication. This results from the fact that the value of each digit of any number except for the least significant digit depends on values of not only the operands with the same name but also on all less significant digits, i.e., a positional notation possesses a rigorously sequential structure and requires the execution of through carries whose number is proportional to the register length in a processor. Thus, the use of positional notations leads to a considerable decrease in the speed and an increase in the computational and time complexities of algorithms being used. This especially implies the urgency of increasing the efficiency of processing multidigit numbers [2]. 649 1060-0396/14/5005-0649 © 2014 Springer Science+Business Media New York a Ternopil National Economic University, Ternopil, Ukraine, [email protected]; [email protected]; †† [email protected]. Translated from Kibernetika i Sistemnyi Analiz, No. 5, pp. 3–8, September–October, 2014. Original article submitted December 03, 2013. DOI 10.1007/s10559-014-9654-0

Theoretical Foundations for the Analytical Computation of Coefficients of Basic Numbers of Krestenson’s Transformation

  • Upload
    i-z

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

Cybernetics and Systems Analysis, Vol. 50, No. 5, September, 2014

CYBERNETICS

THEORETICAL FOUNDATIONS

FOR THE ANALYTICAL COMPUTATION

OF COEFFICIENTS OF BASIC NUMBERS

OF KRESTENSON’S TRANSFORMATION

Ya. M. Nykolaychuk,a†

M. M. Kasianchuk,a‡

and I. Z. Yakymenkoa††

UDC 519.7

Abstract. This paper presents theoretical foundations for the analytical transformation of coefficients

of basic numbers of Krestenson’s transformation, which significantly reduces the number of operations

required to convert numbers from a residue number system to the decimal number system.

An appropriate selection of modules makes it possible to efficiently use all processor registers.

Keywords: residue number system, system of modules, basic number, Krestenson transformation,

number-theoretical basis.

INTRODUCTION

At present, one of main trends in developing computer aids is the creation of high-performance computing devices [1].

It is stipulated by the need for the solution of problems that are very important for the theory and practice of mathematics

and require computations with integer multidigit numbers or quantities changing in rather large ranges [2].

In this connection, the applied and computational aspects of number theory are intensively being developing and are

used in egineering systems to provide the reliability of transmission, storage, and processing of digital information. This

leads to the need for the solution of many problems when computations arise in which lengths of integer variables can

considerably exceed the format of existing universal computational tools, which is especially urgent with developing

cryptographic methods and information protection facilities [3, 4].

ANALYSIS OF PUBLICATIONS

Any computational structure is closely connected with number-theoretic bases (NTBs) in which methods are given

for coding (representing) elements of some finite model of real numbers by elements of one or several alphabets [5].

Arithmetic properties of any number system that are generated by the corresponding NTB are first of all determined

by the nature of the interbit relations arising during the execution of the corresponding arithmetical and logical operations

[6]. Investigations show [5, 7] that, within the scope of usual (decimal and binary) positional notations, it is practically

impossible to reach a stepwise speedup of execution of the arithmetic operations of addition, subtraction, and multiplication.

This results from the fact that the value of each digit of any number except for the least significant digit depends on values of

not only the operands with the same name but also on all less significant digits, i.e., a positional notation possesses

a rigorously sequential structure and requires the execution of through carries whose number is proportional to the register

length in a processor. Thus, the use of positional notations leads to a considerable decrease in the speed and an increase in

the computational and time complexities of algorithms being used. This especially implies the urgency of increasing the

efficiency of processing multidigit numbers [2].

6491060-0396/14/5005-0649

©

2014 Springer Science+Business Media New York

a

Ternopil National Economic University, Ternopil, Ukraine,

[email protected];

[email protected];††

[email protected]. Translated from Kibernetika i Sistemnyi Analiz, No. 5, pp. 3–8, September–October, 2014. Original

article submitted December 03, 2013.

DOI 10.1007/s10559-014-9654-0

Thus, the computational power of modern computers may be insufficient to solve many scientific, technical, and

applied problems. Despite the fact that resources of newest computer facilities that function in positional notations are

constantly being improved and increased, they basically cannot be boundless. This means that, within the scope of the

performance provided by modern computer systems, broad classes of existing methods and algorithms cannot be

implemented in practice, i.e., at present, positional notations exhaust their capabilities for constructing high-performance

computer systems. A fundamental strategy of theoretical and practical investigations consists of the use of approaches based

on the wide application of different forms of parallelism in computer systems. Nonpositional codes with parallel structures

possess this distinctive feature. Among them, residue number systems (RNSs) that make it possible to implement the idea of

parallelization at the level of execution of the elementary arithmetic operations of addition, subtraction, and multiplication

are most promising [7, 8]. The representation of operands in the form of residues of division by rather small coprime

modules allows one to avoid interbit carries and to considerably decrease numbers being processed. Moreover, owing to

their natural internal parallelism, RNSs are brought forward in recent years as the most foreground basis for advanced

high-performance computer technologies, in particular, such as multiprocessor [9], supercomputer, neural

network-based [10], etc. ones.

THEORETICAL BASES OF RNS

The fundamental basis for RNSs is number theory, in particular, the Chinese remainder theorem [11]. Any integer

positive number N in the decimal number system is represented in RNS in the form of residues ( , , , )

, , ,

b b bk p p pk12

1 2

of

division of N by each of pairwise coprime modules N b b bk p p pk10 1 2

1 2

� �

( , , , )

, , ,

, where b N pi i� mod and k is the

number of modules. In this case, the condition N P� – 1 ( )P p

i

k

i�

1

must be fulfilled.

The inverse transformation from the Krestenson basis into the decimal number system is rather cumbersome and is

based on the use of the Chinese remainder theorem [12]

N b B Pi i

i

k

1

mod , (1)

where B M mi i i� , M P pi i� / , mi is found from the expression ( )M m pi i imod � 1, and the condition

B Pi

i

k

1

1mod must be fulfilled.

At present, the following three methods of searching for an inverse element are well known: (1) sequential exhaustive

search for mi until the condition M m pi i imod � 1 is satisfied; (2) with the help of the Euler function m M pi i i�

1

mod

M pi

p

ii�( ) 1

mod ; (3) with the help of an extended Euclidean algorithm.

All of them are rather cumbersome, require large computational expenditures and time resources in executing

divisions with residues, exponentiation, and finding of Euler’s function. At the same time, all operations must be executed

over very large numbers, which can lead to register overflows. The absence of the possibility of an analytical definition of an

inverse element can also be considered as a drawback.

Ya. M. Nykolaychuk proposed the perfect form of RNS (PF RNS) in which the selection of modules is such that

M pi imod � 1, i.e., mi � 1 [13]. This theory is further developed in [14, 15]. A method for choosing a system of modules for

the PF RNS is shown and its modification is developed in which mi � �1. However, in these cases, processor registers whose

number, as a rule, is equal to a power of two are not quite rationally used.

Proceeding from the aforesaid, the objective of this publication is the development of methods of selection of

modules for the efficient use of processor registers and also the derivation of an analytical formula for searching for an

inverse element for an appropriate selection of modules.

650

THEORETICAL FOUNDATIONS FOR ANALYTICALLY

FINDING COEFFICIENTS OF BASIC RNS NUMBERS

We consider the following collection of modules:

ð

ð

ð

ð

p

p

n

n

n

n

i

ni

1

2

3

2

4

4

2

2 1

2 1

2 1

2 1

2 1

2

� �

� �

� �

� �

– ,

,

,

,

,

k

n

k

n

k

k

p

� �

� �

1

2

2

2 1

2 1

3

2

,

.

(2)

It is easy to see from system (2) that each subsequent module is larger by two than the product of all the previous

ones. This determines the relative primality of modules since all of them are odd. Moreover, the range of the decimal

numbers being considered for possible computations is bounded by the expression Pn

k

2 1

2

1

, where n is a power of two

in the module ð1

.

To find an inverse element m M pi i i�

1

mod , we write the following system of equations:

Mn n n n n

n

i

1

2 4 2

2

2 1 2 1 2 1 2 1 2 1

2

2

mod ( ) ( )( )( ) ( )

(

� � � � �

� �

k kn n

n n nM

� �

� � �

3 2

1 2 1 2 1

2 1 2 1 2

2

2

2

)( ) ( );

( ) ( )(

mod

mod 1 2 1 2 1

2 1 2 1 2

4 2

2 2

2

3 2

)( ) ( )

( )( ) (

n n

n n n

i

k k

� �

� �

� �

� �

mod �

� � � �

1

2 1 2 1 2 1 2 1

2

3

2 2 4 2

2

2

);

( ) ( )( ) ( )

(

Mn n n n

n

i

k

mod � �

� � �

3 2

1 2 1 2 1

2 2

)( ) ( )

n nk

M

mod ;

����������������������

i

n n n ni i k k

mod ( ) ( ) ... ( )(2 1 2 1 2 1 2

2 2 2 2

2 2 3 2

� � � �

� � � � 1 2 1

2

2

1

2

) ( )

(

mod ;

mod

n

k

n

i

M

����������������������

2 2 2 2

3 3 2 3

1 2 1 2 1 2 1

k k k kn n n

kM

� � � �

� � �

) ( )( ) ( )mod ;

mod ( ) ( ) ( )2 1 2 1 2 1

2 2 2

2 2 2

n n nk k k

� � �

� � �mod .

(3)

In the first equation of system (3), the residue 2 is obtained for each multiplier in the right side and, hence,

Mn k n

1

1

2 1 2 2 1mod mod( ) ( ) �

. In the second equation of system (3), the residue of the first multiplier equals 2, all the

others equal 2, and, hence, Mn k n

2

1

2 1 2 2 1mod mod( ) ( )� � �

.

In all the other equations, by analogy with the second one, the first residue of the multiplier equals 2, the others

equal 2, and, at the same time, with increasing the number of an equation by one, the number of multipliers (and,

respectively, twos) also decreases by one. As a result of these computations, we obtain the system

651

M

M

n k n

n k n

1

1

2

1

2 1 2 2 1

2 1 2 2

mod mod ;

mod mod

( ) ( )

( ) (

� � �

1

2 1 2 2 1

3

2 2 2

)

( ) ( )

;

mod mod ;

m

M

M

n k n

i

� � �

���������������

od mod( ) ( );

( )

2 1 2 2 1

2 1 2

2 2

n k i ni i

� �

� � �

���������������

M

M

k

n

k

n

k

k

� �

� �

1

2

2

2 1 4

2 1 2

3

2

mod

mod

( ) ;

( ) .

(4)

Now we search for quantities m M pi i i�

1

mod . In the first equation, we write a power of two in the right side as

follows: k a n k � �1

1 1

, where 0

1

� �k n. Then 2 2 1 2 2 2 1 2 2 1

1

1 1

k n n a k n k n

� � � mod mod mod( ) ( ) ( ) ( ) . It is obvious

from this that

m

n

k

n k

1

2

2

2

1

1

� �

. (5)

Similarly, from the second equation, we have k a n k � �1

2 2

. Then

� � � � � �

2 2 1 2 2 2 1 1 2

1

2 2 2 2

k n n a k n a kmod mod mod( ) ( ) ( ) ( ) ( )2 1

n�

� � � �

( ) ( )

( ), ,

1 2 2 1

2 2 1

2

2 2

2

2

1

2

a k nk n

k

amod

mod is odd

mod is even.( ),2 1

2

na�

Let us consider two possible cases.

1. à2

is odd; the module 2 1

n� should be added to 2 2

n� so many times that the sum can be divided by 2

2

k(i.e., the

second addend must be equal to 2

2

k). Thus,

2 2 2 1 2 2 2 2 2 2 2 2 2 2 2

2 2 2 2

n n k n n k k n n k n� � � � � � � � � �

� �

( )( ) 2

2

k.

After dividing it by 2

2

k, we obtain its inverse element m

n n k

2

2 2 1

2

� �

.

2. à2

is even; the obtained value of m2

should be written with the opposite sign and the module

mn n k n n k

2

2 2 1 2 1 2

2 2

� � � �

( ) ( )mod should be added to it. Thus, the final formula is of the form

ma

a

n n k

n k2

2

2

2 2 1

2

2

2

,

,

is odd,

is even.

(6)

Similarly, from the third equation, we have

ma

a

n n k

n k3

2 2

3

2

3

2 2 1

2

3

3

,

,

is odd,

is even,

(7)

where k3

and à3

are determined from the equality k na k � �2 2

3 3

.

From the ith equation, we have

ma

a

i

n n k

i

n k

i

i i

i

i

i

� �

2 2 1

2

2 2

2

2 2

2

,

,

is odd,

is even,

(8)

where k³

and à³

are determined from the equality k i na ki

i i � �

( )1 2

2

.

Let us consider the ( )k 1 th equation. There is no need to write out ki 1

since 2 2

2 2

3

nk

. After the twofold

addition of the module to 2 2

2

3

nk

� and the division of the result by 4, we obtain

mk

nk

1

2 2

2

3

. (9)

652

Similarly, for the last kth equation, we have

2 2

2

2 1

2

2 1

2

2

nn

k

k�

� �( ) . Adding the module, we obtain

mk

nk

2

2 1

2

. (10)

Table 1 presents values of pi , M i , and mi and also the range of possible computations for k � 5 and different values

of n. It is seen in the table that the quantities M1

, m1

, M2

, and m2

can assume different values when n is small, which

depends on the evenness or oddness of the coefficient à³ . The other values of M ³ and m³ are of the form corresponding to

a power of two.

Figure 1 presents the logarithmic dependence of the power of n for the module ð1

on the number of modules k for

a 512-bit processor according to the expression nk

2

10

. As is seen from the figure, log

2

n linearly decreases with

increasing the number of modules k.

CONCLUSIONS

The selection of appropriate modules allows one to provide the efficient use of all processor registers and also to

obtain an analytical formula for searching for an inverse element mi , which appreciably decreases the number of operations

necessary for converting numbers from RNS to the decimal number system.

REFERENCES

1. A. A. Melnik, Computer Architecture [in Russian], Volynsk. Oblast. Tipogr., Lutsk (2008).

2. V. K. Zadiraka and O. S. Oleksyuk, Computer Arithmetic of Multidigit Numbers [in Ukrainian], Vyshcha Shkola,

Kyiv (2008).

653

TABLE 1

n p1 M 1 m1 p2 M 2 m2 p3 M 3 m3 p4 M 4 m4 p5 M 5 m5 P

2 2 1

2

1 1 2 1

2

� 4 4 2 1

4

� 2 7

4

2 2 1

8

� 2 3

8

2

6

2 1

16

� , 2 1

16

2

15

2 1

32

3 2

3 1

2 4 2 1

3

� 2 5 2 1

6

� 2 7

6

2

3

2 1

12

� 2 3

12

2

10

2 1

24

� 2 1

24

2

23

2 1

48

4 2 1

4

1 1 2 1

4

� 1 1 2 1

8

� 2 7

8

– 2

5

2 1

16

� 2 3

16

2

14

2 1

32

� 2 1

32

– 2

31

2 1

64

5 2 1

5

– 16 2 2 1

5

� 2 15

5

– 2 2 1

10

� 2 7

10

– 2

7

2 1

20

� 2 3

20

– 2

18

2 1

40

� 2 1

40

– 2

39

2 1

80

6 2 1

6

– 16 2

2

2 1

6

� 2 15

6

– 2

2

2 1

12

� 2 7

12

– 2

9

2 1

24

� 2 3

24

– 2

22

2 1

48

� 2 1

48

– 2

47

2 1

96

… … … … … … … … … … … … … … … … …

i 2 1

i 16 2

4i 2 1

i� 2 15

i 2

4i 2 1

2i� 2 7

2i– 2

2 3i 2 1

4i� 2 3

4i– 2

4 2i 2 1

8i� 2 1

8i– 2

8 1i 2 1

16i–

Fig. 1. Curve of the logarithmic

dependence of the power of n for

the module ð1

on the number

of modules k.

0 2 4 6 8 k

10

8

6

4

2

log

2

n

3. N. Ferguson and B. Schneier, Practical Cryptography [Russian translation], Izd. Dom “Williams,” Moscow (2005).

4. V. Zadiraka and O. Oleksyuk, Computer Cryptology [in Ukrainian], Vyshcha Shkola, Kyiv (2002).

5. Ya. N. Nykolaychuk, Theory of Information Sources [in Russian], OOO “Terno-Graf,” Ternopil (2010).

6. Z. L. Rabinovich and V. A. Ramanauskas, Standard Computer Operations [in Russian], Tekhnika, Kyiv (1980).

7. I. Ya. Akushskii and D. I. Yuditskii, Machine Arithmetic in Residue Classes [in Russian], Sov. Radio, Moscow

(1968).

8. V. A. Torgashev, A Residue Number System and Computer Reliability [in Russian], Sov. Radio, Moscow (1973).

9. Ya. N. Nykolaychuk, O. I. Volynskii, and S. V. Kulyna, “Theoretical foundations of construction and the structure of

special processors in the Krestenson basis,” Vestn. Khmeln. Nats. Un-ta, 1, No. 3, 85–90 (2007).

10. N. I. Chervyakov, A. I. Galushkin, A. A. Evdokimov, A. V. Lavrinenko, and I. N. Lavrinenko, Application of

Artificial Neural Networks and Residue Number Systems in Cryptography [in Russian], Fizmatlit, Moscow (2012).

11. A. A. Bukhshtab, Number Theory [in Russian], Prosveshcheniye, Moscow (1966).

12. O. I. Borodin, Number Theory [in Russian], Vyshcha Shkola, Kyiv (1970).

13. Ya. M. Nykolaychuk, “Developing the theory and complexes of technological tools for the formation, transmission,

and processing of digital messages in local computer networks of automated systems,” DPhil, V. M. Glushkov

Institute of Cybernetics of AS of UkrSSR, Kyiv (1991).

14. M. N. Kasyanchuk, “Theory and mathematical regularities of a perfect form of a residue number system,” in: Proc.

Intern. Symposium “Issues of optimization of computations (IOC–XXXV),” Vol. 1, Kyiv–Katsiveli (2009),

pp. 306–310.

15. M. Kasyanchuk, “Conception of theoretical tenets of a perfect form of the Krestenson transformation and its practical

application,” Optoelectronic Information and Power Technologies, No. 2 (20), 43–48 (2010).

654