Научная статья на тему 'Ternary mirror-symmetrical Arithmetic and its application to digital signal processinalexey'

Ternary mirror-symmetrical Arithmetic and its application to digital signal processinalexey Текст научной статьи по специальности «Математика»

CC BY
127
51
i Надоели баннеры? Вы всегда можете отключить рекламу.
Журнал
Компьютерная оптика
Scopus
ВАК
RSCI
ESCI
Область наук
i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «Ternary mirror-symmetrical Arithmetic and its application to digital signal processinalexey»

TERNARY MIRROR-SYMMETRICAL ARITHMETIC AND ITS APPLICATION TO DIGITAL SIGNAL PROCESSING

Alexey Stakhov (Ukraine) e-mail: anna@nest.vinnica.ua

Introduction

Digital signal processing (DSP) puts forward a number of specific demands to processors for realization of DSP. First of all the DSP-processors are arithmetical processors intended for arithmetical processing of big number information (signal samplings), which enter to the DSP-processor in a real scale of a time. At that arithmetical processing is reduced as a rule to realization of arithmetical operations of addition, subtraction and multiplication. Therefore, the main demand to the DSP-processor is a high processing speed. Since the DSP-processors are realized technically as a rule in form of micro-electronic chips the next demand following from micro-electronic technology is a high homogeneity of the DSP-processor structure. Since the DSP-processors are used as a rule as elements of control systems an additional demand is a high reliability and high ability to control errors arising in the DSP-processors.

The presents article is devoted to statement of new approach to design of the DSP-processors based on the original number system called "Ternary Mirror-Symmetrical Number System". The latter is a synthesis of the ternary symmetrical number system [1] used by Nikolay Brousentsov for design of the ternary computer "Setun" and the number system with an irrational base ("Tau System") suggested in 1957 by the American mathematician George Bergman [2]

1. "Ternary principle" and ternary computer "Setun"

The modern computers are based on so-called "binary principle" of computer design ("John von Neumann's principles"), which includes in itself the following ideas: two-valued (Boolean) logic, binary number system, binary logical elements and binary memory element ("flip-flop ").

However, in the history of computing [3] there is well-known so-called "ternary principle" of commuter design suggested in the 50th by the Russian scientist and engineer Nikolay Brousentsov. The "ternary principle" ("Brousentsov's principles") was realized in the ternary computer "Setun" designed in the Moscow University in the 50th. "Brousentsov's principles" include in themselves the following ideas: three-valued logic, ternary symmetrical number system, ternary logical elements and ternary memory element ("flip-flap-flop").

The key element of the "ternary principle" is the ternary symmetrical number system:

n i-1

N = Z b: 3 1 , (1)

i=1 i

where bi (i = 1, 2, ..., n) are the ternary numeral {-1, 0 and 1}of the i-th digit; 31"1 is the "weight" of the i-th digit; number 3 is the base of number system (1).

The basic advantage of number system (1) in comparison to the classical binary number system with the numerals 0 and 1 is a brilliant solution of the "negative number problem". Both positive and negative numbers are represented in the "direct" code and all arithmetical operations are realized in the "direct" code. It is easy to get the representation of the negative number (-N) from the ternary representation of positive number N using the rule of the "ternary inversion":

1 ^ 1, 0 ^ 0, 1^ 1. (2)

The ternary-symmetrical addition and multiplication are based on the trivial identities connecting the powers of the number of 3: 3‘ + 3‘ = 3I+1 - 3‘ (for addition) and 3mx3n = 3m+n (for multiplication) [1].

The ternary-symmetrical subtraction of the numbers A - B is reduced to the addition of the numbers A + (-B) if the rule of ternary inversion of (2) would be applied to the subtrahend B. The ternary-symmetrical division is similar to classical binary division and is reduced to the divisor shift and their subtraction from the dividend [1].

The computer "Setun" was designed on magnetic elements and therefore it did not get a wide practical applications but its architecture based on the "ternary principle" found itself so perfect that at the present time the project of the ternary computer "Setun" attracts for attention of many computer specialists.

The famous Soviet computer specialist professor Pospelov wrote in his book [1]: "The barriers, which stand on the way of the ternary symmetrical number systems application to computers, are the barriers of the technical character. Up to now the economical and effective elements with three stable states have not been elaborated yet. As soon as such elements are developed the majority of computers of the universal kind and many special computers will most probably be designed so that they would work in the ternary symmetrical number system”.

In connection with essential advantages of the "ternary principle" in comparison to the "binary one" Donald Knuth assumed that "the replacement of "flip-flop" by "flip-flap-flop" one a “good” day will nevertheless happen" [4].

2. "Tau System"

T-representation

The American mathematician George Bergman introduced in 1957 [2] the positional number system of the following kind:

A = Z (2)

where A is some real number and ai are the binary numeral, 0 or 1, i = 0, ±1, ±2, ±3, T is the weight of the i-th digit, t is the base of number system (2).

At the first glance, there douse not exists any differences between formulas (2) and (1), for instance, but it is only at the first glance. The difference consists of the fact that Bergman used the irrational number T =

1 +^ called the "golden section" or "golden ratio" as

the base of number system (2). That is why Bergman called it the "number system with an irrational base" or the "Tau System". Although Bergman's paper [2] contained the result of a principal importance for the number system theory however in that period it simply did not be noted neither by mathematicians nor by engineers. And in conclusion of his paper [2] Bergman wrote: "I do not know of any useful application for systems such as this, except as a mental exercise and pastime, though it may be of some service in algebraic number theory. For instance, the numbers expressible in the Tau System in terminating form consists of all the

algebraic integers in R(45) , and some of the properties of numbers in this and other systems might correspond to facts about associated fields".

Let us consider the "Tau System" since computational point of view. Its base t determines all unusual properties of number system (2). And we have to consider some mathematical property of the "golden ratio"

[5]. The latter is the positive root of the following algebraic equation:

Table 1

x2 = x + 1.

(3)

From (3) we can get the following identity, which connects three next powers of the "golden ratio":

Tn = Tn-1 + Tn-2 (4)

In the 19th Century the French mathematician Bi-net proved the following mathematical formula, which allows representing the n-th power of the "golden ratio" t in the "explicit" form [5]:

Tn =-

Ln + F„y[3

2

(5)

where n is an integer (n = 0, ±1, ±2, ±3, .).

Two interesting numerical sequences appear in this formula, the Fibonacci numbers Fn and the Lucas numbers Ln. They are given with the following recurrent formulas:

and

Fn = Fn-1 + Fn-2 ; F1 = F2 = 1

Ln Ln-1 + Ln-2 ; L1 1; L2 3

Table 1 gives these sequences extended to negative values of indices.

n 0 1 2 3 4 5 6 7 8

Fn 0 1 1 2 3 5 8 13 21

F-n 0 1 -1 2 -3 5 -8 13 -21

Ln 2 1 3 4 7 11 18 29 47

L-n 2 -1 3 -4 7 -11 18 -29 47

Let us consider representations of numbers in the "Tau System" (2). It is clear that the number A notation in (2) has the following form:

A = anan1... ala0, a.1a.2 ... a_m. (6)

We can see that the number notation of A is a binary code combination, which is separated with comma into two parts, the left part ananA ... aia0 corresponding to "weights" Tn, Tn-1 , ... t1, t0=1 and the right part a_\a_2 ... a-m corresponding to the "weights" with negative powers: t -1, t "2 , ... T--m . Note that the "weights" t1 (i =0, ±1, ±2, ±3, . ) are given with mathematical formula (5).

For instance, let us consider the binary combination 100101. It is clear that this one represents the real number

A = 100101 = t5 + t2 + t0 . (7)

Using the formula (5) and Table 1 we can get that the number of A in the expression (7) is equal to

11 + 5^5 3 +45

A = 100101 = -------------- +---------- + 1 =

2

2

16 +

6V5

2

= 8 + 3^5 .

Note that the number A =100101 = 8 + 3 V5 is an irrational one. It means that we could represent some irrational number A in the "Tau System" using the code combination 100101 consisted of finite number of bits!

It is clear that the base of the "Tau System" is represented in traditional way:

1+V5

T=

= 10.

2

Note that a possibility to represent some irrational numbers (the powers of the "golden ratio" and their sums) in the "Tau System" using finite number of bits is the first unexpected result following from the "Tau System".

There arises the question about representation of natural numbers in the "Tau System". For that let us consider one more the identity (4). On the code level we can interpret this identity as the following code transformation:

100 = 011.

(8)

How we can use the code transformation of (8)? For that we consider the "golden" notation 100101, which represent the number of (7). If we apply to the higher three digits of (7) the code transformation of (8), we can get the new "golden" notation of the number of (7) namely:

A = t5 + t2 + t0 = 100101 = 011101 =

= t4 + t3 + t2 + t0.

Note that for this case the golden ratio power t5 is replaced with the sum of two next powers t4+t3 according to the fundamental identity (4). Note that this does not change the initial number of (7). At the code level such transformation corresponds to the following code transformation:

100 ^ 011. (9)

This code transformation is called a "devolution"

[6]. The back transformation

011 ^ 100 (10)

is called a "convolution" [6].

Thus, numbers have many-valued representation in the "Tau System". This is the second unexpected result following from the Tau System". Using the above introduced code transformations of "convolution" and "devolution" one may get two extreme representations of some number in the "Tau System". For instance, let us consider the code combination 0111111. If we perform in it all possible "convolutions" (10) we will get the first extreme representation called a minimal form:

0111111= 1001111= 1010011=

= 1010100 ("minimal form").

Note that in the minimal form two binary 1's near do not meet.

Let us consider the code combination 100000,

5 11 + 5^5

which represents the irrational number t = --------------.

Performing in it all possible operations of "devolution" (9) we can get the second extreme representation called

a maximal form:

100000 = 0110000 = 0101100 =

= 0101011 ("maximal form")

Note that in the maximal form two binary 0's near do not meet.

Let us show how one may get all the "golden" notations of natural numbers using the operations of "devolution" and "convolution". We start from number 1. It is clear that number 1 can be represented through the golden ratio in the following manner:

1 = t0

But using the expression of (2) we can represent the number of t0 = 1 as the following:

1 = t0 = 1,00. (11)

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

Note that in the "golden" notation of 1,00 the comma separates the 0th digit from the digits with negative indices.

Then, using "devolution" we can represent the number of (11) as the following:

t0 = 1,00 = 0, 11. (12)

Now we add the binary numeral 1 to the 0th digit of the "golden" notation 0,11. As result we get the "golden" notation of number 2:

2 = 1,11. (13)

Applying the operation of "convolution" to the higher digits of the "golden" notation (13) we get the new "golden" notation of number 2:

2 = 10,01.

Adding the binary numeral 1 to the 0th digit of the "golden" notation of 2 we get the "golden" notation of number 3:

3 = 11,01.

Applying the operation of "convolution" to the higher digits of the "golden" notation of number 3 we get the new "golden" notation of number 3:

3 = 100,01.

Continuing this process one may get the "golden" notations of all natural numbers. This result is the third unexpected result following from the "Tau System".

Z-property of natural numbers

Let us consider now the representation of the arbitrary natural number of N in the "Tau System":

N = Z aT (14)

i

The representation of (14) is called the T-representation of natural number N.

Let us apply Binet's formula (5) to the T-representation of (14) and represent the formula of (14) in the following form:

2N = %aiLi +V5 %aiFi (15)

We can see that the left part of the expression of (15) is natural number; at that this one is even always. The right part of (15) is the sum of two components. The former component is the sum of the Lucas numbers with the binary coefficients. Because an arbitrary Lucas number is integer (see Table 1) then an arbitrary sum of the Lucas numbers is integer.

Let us consider now the latter component. This

one is the product of the irrational number V5 by the sum of the Fibonacci numbers with the binary coefficients 0 or 1. Because an arbitrary Fibonacci number is integer (see Table 1) then an arbitrary sum of the Fibonacci numbers is integer always. Thus, the identity of (15) claims that the natural (even) number 2N is equal to the sum of some integer (the sum of the Lucas number with the binary coefficients) and the product of the other integer (the sum of the Fibonacci numbers with

the binary coefficients) by the irrational number V5.

There arises the question: for what conditions the identity of (15) is true? The answer is univalent. This is possible for the condition if the sum of the Fibonacci numbers in the identity of (15) is equal to 0 identically, that is:

Z aiFi = 0. i

(16)

since Fi+1 =

On the other hand, the number of 2N is even. If we take into consideration the identity of (16) then the sum of the Lucas numbers in the identity of (15) has to be even.

Let us analyze the sum of Z aiLi and Z aiFi in

i i

the identity of (15). These sums were got as a result of substitution of Binet's formula (5) into the expression of (14), which gives the representation of natural number N in the "Tau System". It means that all the binary numerals ai in the sums of Za:L: and Z a:F: coincide

I i

with the corresponding coefficients at in the t-representation (14). Thus, as result of this consideration we have came to the mathematical discovery in the number theory. The essence of it consists of the following:

Z-propertv

If we represent an arbitrary natural number of N in the "Tau Systeme" of (14) and then we replace in the expression of (14) all the powers of the "golden ratio" by the corresponding Fibonacci numbers then the sum obtained in this manner has to be equal to 0 identically independently from the initial natural number of N.

D-property

If we replace in the expression of (14) all the powers of the "Tau System" representation (14) by the corresponding Lucas numbers then the sum obtained in this manner has to be the even number, which is equal to the double value of the initial natural number of N.

These unique properties of the "Tau System" are proved in [7] and called respectively the Z-property (Z means "zero") and the D-property (D means "double").

Of what practical importance could have the new fundamental properties of natural numbers, the Z-property and D-property? To answer this question let us imagine some hypothetical computer network, which uses the "Tau System" for number representation. But for this hypothetical case the natural number properties formulated above is nothing as a new universal check indication of all information in the computer network.

F- and L-representations

One can get two new representations of natural number N if we use the T-representation of (14) and the Z-property of (16). Taking into consideration the Z-property of (16) the expression of (15) can be represented in the following form:

2N = Z aiLi +Z aiFi ii

or

N = Z a

L. + F-

■ = Z aiFi i

iri +1

(17)

2

(see for instance [5]).

The expression of (17) is called the F-representation of natural number N [7].

Note that the binary numerals of the T-repre-sentation of (14) and of the F-representation of (17) coincide. It means that the F-representation of (17) can be got from the T-representation of the same natural number N by means of simple replacing of the golden ratio power Ti in the formula of (14) by the Fibonacci number Fi+i, where i = 0, ±1, ±2, ±3, ... .

Let us represent now the F-representation of (17) in the following form:

N = Z afF

i +1

+ 2 Z a:F: = Z a:L

i +1

(18)

since Li+i = Fi+i + 2Fi (see [5]).

The expression of (18) is called L-representation of natural number N [7].

Note that the binary numerals in the representations of (14) and (18) coincide. There follows from this that the L-representation of N could be got from the T-representation of the same natural number N by means of simple replacing of the golden ratio power T in the t-representation of (14) by the Lucas number L,+i, where i = 0, ±1, ±2, ±3, ... .

It is clear that the L-representation of N could be got also from the F-representation of the same number N by means of simple replacing of the Fibonacci number Fi+1 in the F-representation of the same natural number N by the Lucas number Li+1 .

3. Ternary Mirror-Symmetrical Number System

Conversion rule from the "Binary Tau System" to the "Ternary Tau System"

Let us consider the T-representation of (14) represented in the minimal form. It means that each binary unit ak = 1 would be "enclosed" with two next binary zeros ak-1 = ak+1 = 0.

Let us consider now the following expression for the powers of the golden ratio:

T = T+1 - T-1. (19)

The expression of (19) has the following code interpretation:

k +1 k k -1 0 1 0 t i t

k -1 k k -1 1 0 I (20)

where 1 is a negative unit, i.e. 1 = - 1. There follows from (20) that the positive binary 1 of the kth digit is transformed into two units, the positive unit of the

(k+1)th digit and the negative unit 1 of the (k-1)th digit.

The code transformation of (20) might be used for the conversion of the T-representation (14) represented in the minimal form into the "ternary T-representation".

Let us convert the T-representation of number 5 (the minimal form):

2

4 3 2 1 0 -1 - 2 - 3 - 4

5 = 0100 0, 1 0 0 1 (21)

tit tit

into the "ternary T-representation". To do this we apply the code transformation of (20) simultaneously to all digits being the binary units and having the odd indices (k=2m+1). We can see that the transformation of (20) could be applied for the situation (21) only to 3rd and (-1)th digits being the binary units. As the result of such transformation of (21) we get the following ternary representation of number 5:

4 3 2 1 0 -1 - 2 - 3 - 4

5 = 1010 1, 0 1 0 1

(22)

We can see from (22) that all digits having even indices are equal to 0 identically but the digits with odd

indices take the ternary values from the set {1 , 0, 1}. It means that all digits with the even indices are "non-informative" because their values are equal to 0 identically. Omitting in (22) all the "non-informative" digits we get the following ternary representation of the initial number N:

N = Z b2iT i ^

2i

(23)

where b2iis the ternary numeral of the (2i) digit..

Let us introduce the following digit enumeration for the ternary representation of (23). Each ternary digit b2i is replaced with the ternary digit ci . As a result of such enumeration we get the expression of (23) in the following form:

N = Z ct i

2i

(24)

where c: is the ternary numeral of the ith digit; T1 is the weight of the ith digit; t2 is the base of the number system of (24). With regard to expression (24) the ternary representation of (22) takes the following form:

2 10 -1 -2

- - (25)

5 = 1 1 1, 1 1

The latter is the ternary T-representation of number 5.

The conversion of the T-representation of (14) to the "ternary T-representation" of (24) could be performed [7] by means of a simple combinative logical circuit, which transforms the next three binary digits

a2i+1 a2i a2i-1

of the initial "binary T-representation" (minimal form) into the ternary informative digit b2i = ci of the ternary T-representation in accordance with Table 2.

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

Table 2

a2i+1 a2i a2i-1 ci

0 0 0 0

0 0 1 1

0 1 0 1

1 0 0 1

1 0 1 0

Note that Table 2 uses only 5 binary code combinations because the initial "binary T-representation" has a minimal form and the code combinations 0 1 1, 1 1 0,

1 1 1 are prohibited for it.

The code transformations given with the 2th and

4th rows of Table 2 are trivial. The code transformations given with the 3rd , 5th and 6th rows of Table 2 follow from (20). For instance the code transformation of the

6th row

1 0 1 ^ 0

means that the negative unit arising in accordance to (20) from the left binary digit a2i+1 = 1 is summarized with the positive unit arising from the right binary digit a2i-1 = 1. There follows that their sum is equal to ci = 0.

Let us consider now the "ternary F- and L-representations" following from the ternary T-representation of (23). It is clear that the expressions for the ternary F- and L-representations have the following forms respectively:

N = Z ci F2i +1

N = Z ciL2i+1

(26)

(27)

Note that the values of the ternary digits of the representations of (24), (26), (27) coincide. There follows from this consideration that the ternary t- F-, L-representations of the number 5 from the example of (25) have the next numerical interpretations:

(a) Ternary T-representation

5 = 1xt4 + 1 xT2 + 1xT + 1 xt"2 + 1 x T4 = "2 +F2'

L4 + F4 V5 l2 + f9 Vs

+ 1 -

2

2

l-2 + f-2 + + L-4 + F-4

2

2

= L4 - L2 + 1 = 7 - 3 + 1.

(b) Ternary ¥-representation:

5 = 1xF5 + 1 xF3 + 1xFi + 1 xF-i + 1xF-3 =

= 5 - 2 + 1 - 1 + 2

(c) Ternary L-representation:

5 = 1xL5 + 1 xL3 + 1xLj + 1 xL-1 + 1xL_3 =

= 11 - 4 + 1 + 1 - 4.

Representation of negative numbers

Like to the ternary symmetrical number system of (1) an important advantage of the number system of (24) is a possibility to represent both the positive and the negative numbers in the direct code. The code of the negative number (-N) is got from the ternary t-representation of the initial number N by means of ap-

plication of the rule of a "ternary inversion" (2). Applying this rule to the ternary T-representation (25) of number 5 we get the ternary T-representation of negative number (-5):

2 10 -1 -2

- 5 = 111, 1 1

Mirror-symmetrical property of integers

Considering the ternary T-representation (25) of number 5 we can reveal that the left part (1 1) of the

ternary T-representation (25) of number 5 is mirror-

symmetrical to its right part ( 1 1) regarding to the 0-th digit. It is proved [7] that this property of the "mirror symmetry" is a fundamental property of integers, which arises at their representation in the "Ternary Tau System" of (24). Table 3 demonstrates this property for some natural numbers.

Thus due to these simple investigation we have discovered one more fundamental property of integers, the property of "mirror symmetry", which appears at their representation in the "Ternary Tau System" of (24). That is why the "Ternary Tau System" of (24) is called the "Ternary Mirror-Symmetrical Number System" [7].

Table 3

i 3 2 1 0 -1 -2 -3

T T t4 T2 T t"2 t"4 t-6

F2i+1 13 5 2 1 1 2 5

L2i+1 29 11 4 1 -1 -4 -11

N

0 0 0 0 0, 0 0 0

1 0 0 0 1, 0 0 0

2 0 0 1 1, 1 0 0

3 0 0 1 0, 1 0 0

4 0 0 1 1, 1 0 0

5 0 1 1 1, 1 1 0

6 0 1 0 1, 0 1 0

7 0 1 0 0, 0 1 0

8 0 1 0 1, 0 1 0

9 0 1 1 1, 1 1 0

10 0 1 1 0, 1 1 0

11 0 1 1 1, 1 1 0

The base of the "Ternary Tau System"

There follows from (24) that the base of the ternary T-representation of (24) is the square of the "golden ratio":

3 + V5

T2 =■

2

It means that the number system of (24) is the number system with an irrational base.

The base of the number system (24) has a traditional representation in (24):

t2 = 10.

Range of number representation

Let us consider the question about the range of number representation in the "Ternary Tau System" of (24).

Suppose that the ternary T-representation of (24) has 2m+1 ternary digits. In this case one may represent in the number system of (24) all integers in the range from

Nmax = 11...1 1, 11...1

(28)

m

m

to

(29)

m m

It is clear that Nmin is the ternary inversion of Nm

i.e.

1 N ■ I = N

I 1>min I 1>max •

There follows from here that using the (2m+1)-digit ternary T-representation of (24) one may represent

2 Nmax + 1 (30) integers including the number 0.

For calculation of Nmax let us use the L-repre-sentation of (27) of the initial number of N.. Then we can interpret the code representation of (27) as the abridged notation of the following sum:

Nma = L2m+1 + L2m -1 + ... + L3 + L1 +

+ L-1 + L-3 + ... + L-2m + 1 . (31)

For the odd indices i=2k - 1 we have the following property for the Lucas numbers [5]:

L-2m + 1 = - L2m -1 .

Taking into consideration the property of (32) we get the following value of the sum of (31):

Nmax L2m+1.

Taking into consideration (30) and (33) one may formulate the following theorem.

Theorem 1. Using (2m+1) ternary digits in the ternary T-representation (24) one may represent 2L2m+1 + 1 integers in the range from - L2m+1 to L2m+1, where L2m+1 is the Lucas number.

4. Ternary Mirror-Symmetrical Arithmetic

Mirror-symmetrical addition and subtraction

The following identities for the golden ratio powers underlie the mirror-symmetrical addition:

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

2T = T2(k+1) - T + r2(k~1> ; (34)

3 T = T2(k+1) + 0 + T2(k-1) ; (35)

4T = T2(k+1) + T + T2(k-1) , (36)

where k = 0, ±1, ±2, ±3, ... .

The identity of (34) is the mathematical basis for the mirror-symmetrical addition of two single-digit ternary digits and gives the rule of carry formation (Table 3).

Nmin = 11...1 1, 11...1

Table 3

-4 = 1 1; -3 = 1 0; -2 = 1 1; -1 = 0 1;

;\«k bk 1 0 1

I 111 1 0

0 1 0 1

1 0 1 1 1 1

The principal peculiarity of Table 3 is the addition rule for two ternary units with equal signs, i.e.

2k + k = ck k ck

1 + 1 = 1 1 1

1 + 1 =1 1 T

We can see that at the mirror-symmetrical addition of the ternary units with the same sign there arises the intermediate sum sk with the opposite sign and the carry ck with the same sign. However the carry from the kth digit spreads simultaneously to the next two digits namely to the next left, i.e. (k+1)th digit and to the next right, i.e. (k - 1)th digit.

Table 3 describes an operation of the simplest adder called a single-digit half-adder. The latter is a combinative logical circuit having two ternary inputs ak and bk and two ternary outputs sk and ck and functioning in accordance with Table 3 (Fig.1-a).

a)

b)

\ak \h

k+l k-1

ck+l *k']

■v ck

k+l k-1

Fig.1. Mirror-symmetrical single-digit adders:

(a) half-adder; (b) full adder.

Since the carry from the kth digit spreads to the left and to the right digits it means that the mirror-symmetrical single-digit adder has to have two inputs of the carries entering from the (k - 1)th and (k+1)th digits into the carry inputs. Thus the full mirror-symmetrical single-digit adder is a combinative logical circuit having

4 ternary inputs and 2 ternary outputs (Fig.1-b). Let us mark in 2Z the mirror-symmetrical single-digit halfadder having 2 inputs and in 4Z the mirror-symmetrical single-digit full adder having 4 inputs.

Let us describe the logical operation of the mirror-symmetrical full single-digit adder 4Z. Note first of all that the number of all the possible 4-digit ternary input combinations of the mirror-symmetrical full adder is equal to 34 = 81. The values of the output variables sk and ck are the discrete functions of the algebraic sum S of the input ternary variables ak, bk, ckA , ck+u i.e.

S = ak + bk + ck-1 + ck+1 (37)

The sum of (37) takes the values from the set {- 4,

- 3, - 2, - 1, 0, 1, 2, 3, 4}. The operation rule of the mirror-symmetrical full adder 4Z consists of the following. The adder forms the output ternary code combination cksk in accordance with the value of the sum of (37), i.e.

0 = 0 0; 1 = 0 1; 2 = 1 1; 3 = 1 0; 4 = 1 1.

The lower digit of such 2-digit ternary representation is the value of the intermediate sum sk and the higher digit is the value of the carry ck , which spreads to the next (to the left and to the right) digits.

The multi-digit combinative mirror symmetrical adder realizing the addition of two (2m+1)-digit mirror-symmetrical numbers is a combinative logical circuit consisting of 2m+1 ternary mirror-symmetrical full single-digit adders 4Z (Fig. 2).

il ii ii ii ii

T 4^2 T 4Z, T 4*0 T 42, T 4L_2 T 4Z-m

Sm S2 S1 S0 S-1 S-2 S-m

Fig.2. Mirror-symmetrical multi-digit adder.

As example let us consider the addition of two numbers 5 + 10 in the "Ternary Tau System":

5 = 0

10 = 0

0

1 1,

1 0,

0 1,

1 o 1

1 o 1

5 = 1 1 1 1, 1 1 1

Note the sign o marks the process of the carry spreading.

As it was noted above the important advantage of the "Ternary Tau System" is a possibility to summarize all integers (positive and negative) in the true (direct) code, i.e. without using the notions of inverse and additional codes. As example let us consider the addition of the negative number (-24) with the positive number 15:

24 = 1 1 0 1, 0 1 1

15 = 1 1 1 1, 1 1 1

0 1 1 1, 1 1 0

1 o 1

1 o- 1 1 o 1

9 = 1 1 1 1, 1 1 1

Subtraction of two mirror-symmetrical numbers N - N2 is reduced to addition if we represent their difference in the following form:

N - N2 = N + (- N2). (38)

There follows from (38) that before subtraction it is necessary to take the ternary inversion of number N2 .

As example let us consider the subtraction of the number of 16 = 1 0 1 1, 1 0 1 from the negative number (- 8) = 0 1 0 1, 0 1 0 . Then in accordance with (38) it is necessary to take the ternary inversion of number 16:

(- 16) = 1 0 1 1, 1 0 1 and then to summarize numbers (- 8) and (- 16).

"Swing"-phenomenon

Let us summarize two equal numbers 5 + 5 represented in the "Ternary Tau System":

5 = 0 1 1 1, 1 1 0

5 = 0 1 1 1, 1 1 0

0 1 1 1, 1 1 0

I 1 o 1 I

1 o 1 1 o 1

1 o 1 I

1 o 1

1 1 0 0, 0 1 1

1 o 1

1 o 1 I

I 1 o 1

1 o 1 1 o 1

0 1 1 1, 1 1 0

1 o 1

1 o 1 I

I 1 o 1

1 o 1 1 o 1

There follows from this example that we have found a special addition case called a "swing". If the addition process goes on then starting from some step the process of the carry formation turns out to be repetitive and hence, the addition becomes infinite. The "swing"-phenomenon is some variety of the "races" arising in the digit automatons when the elements are switching.

To eliminate the "swing"-phenomenon one may use the following effective "technical" method [7]. Let us delay the input signals of single-digit adders with odd indices (k = ±1, ±3, ±5, ... ) by one addition step. With this aim in mind the adders with the even indices (k = 0, ±2, ±4, ...) form on the first addition step intermediate sums and corresponding carries to the singledigit adders with the odd indices. On the second addition step the carries formed on the first step are summarized with the corresponding ternary variables of the odd digits of summarized numbers. Thanks to such approach the "swing"-phenomenon is eliminated.

Let us demonstrate the method above considered for the preceding example of adding 5+5:

5 = 0 1 1 1, 1 1 0

5 = 0 1 1 1, 1 1 0

0 1 1 1, 1 1 0

0 1 I 1 0

1 o 1

1 o 1 1 o 1

10 = 1 1 0 1, 0 1 1

The first step of mirror-symmetrical addition is carry formation from all the digits with the even indices (0, 2, -2). The numerals of all the input digits with the odd indices (1, 3, -1, -3) are preserved without exchange on the second step. The second step is the addition of all the carries arising on the first step with the intermediate sum and the numerals of the digits with the odd indices.

The analysis of all the considered examples of the ternary mirror-symmetrical addition shows that both the final addition result and all the intermediate addition results are mirror-symmetrical numbers, i.e. the property of the mirror symmetry is the invariant of the mirror-symmetrical addition.

Mirror-symmetrical multiplication The following trivial identity for the golden ratio powers underlies the mirror-symmetrical multiplication: T2n X T2m = T2(n+m) . (39)

The rule of the mirror-symmetrical multiplication of two single digits is given in Table 4.

The multiplication is performed in the true (direct) code. The general algorithm of two multi-digit mirror-symmetrical numbers multiplication is reduced to forming the partial products in accordance with Table 4 and their addition in accordance with the rule of the mirror-symmetrical addition. For example let us multiply the negative number - 6 = 1 0 1, 0 1 by the positive number 2 = 1 1, 1:

1 0 1, 0 1 1 1, 1

1 0, 1 0 1

1 0 1, 0 1 1 0 1 0, 1

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

1 1 0 1, 0 1 1

The multiplication result in the above-considered example is formed as the sum of the three partial products. The first partial product 1 0, 1 0 1 is the result of the multiplication of the mirror-symmetrical number - 6 = 1 0 1, 0 1 by the lowest positive unit of the mirror-

symmetrical number 2 = =11,1, the second partial product 1 0 1, 0 1 is the result of the multiplication of the same number - 6 = 1 0 1, 0 1 by the middle negative unit of the number 2=1 1, 1, and at least the third partial product 1 0 1, 0 1 is the result of themultipli-cation of the same number - 6 = 1 0 1, 0 1 by the higher positive unit of the number 2 = 1 1, 1.

Note that the product - 12 = 1 1 0 1, 0 1 preserves the property of mirror symmetry. Since its higher digit is a negative unit 1 there follows that the product is a negative number.

Mirror-symmetrical division Mirror-symmetrical division is performed in accordance with the rule of division of the classical ternary symmetrical number system [1]. The general algorithm of the mirror-symmetrical division is reduced to the sequential subtraction of a shifted divisor, which is multiplied by the next ternary numeral of the quotient.

Let us demonstrate the mirror-symmetrical division for the example of the division of the mirror-symmetrical number 24 = 1 1 0 1, 0 1 1 by the mirror-symmetrical number 2 = 1 1, 1.

The first step of the division is shifting the divisor

2 = 1 1, 1 by two digits to the left. As a result we get the shifted divisor in the form 1 1 1 0, 0 0 0. Comparing the dividend with the shifted divisor, i.e. the numbers 1 1 0 1, 0 1 1 and 1 1 1 0, 0 0 0 we can see that the signs of the compared numbers coincide. In this case we write down the positive unit in the 3rd digit of the quotient. Then we have to subtract the shifted divisor from the dividend. The subtraction is reduced to the addition after the ternary inversion of the subtrahend. Hence we summarize on the first step two numbers namely the ternary-symmetrical dividend and the inverse code of the shifted divisor, i.e.

0 1, 0 1 1

I 0, 0 0 0

1 1, 1

1 0 0, 0 = Q1

0 1 1 1, 0 1 1

1 ^ 1

D = 1 1 0 1, 0 1 1

Hence as the result of the division on the first step we get the first intermediate quotient Q1 = 1 0 0, 0 and the first intermediate dividend D1 = 1 1 0 1, 0 1 1.

The second step of the division is the repetition of the first step as to the first intermediate dividend D1 =

1 1 0 1, 0 1 1. Note that the number D1 contains a positive unit in the same higher digit as the initial dividend. It means that the divisor have to be shifted by two digits to the left and then the number D1 have to be compared with the new shifted divisor 1 1 1 0, 0 0 0. Since the signs of the compared numbers coincide we form the following intermediate quotient

Q2 = 1 0 0, 0

on the second step and perform the addition of the number D1 = 1 1 0 1, 0 1 1 with the ternary inverse code of the new shifted divisor. Hence the second step consists of the following:

1 1 0 1, 0 1 1

1 1 1 0, 0 0 0

D2 = 0 0 1 1, 0 1 1

1 1, 1

1 0 0, 0 = &

Hence as the result of the division on the second step we get the second intermediate quotient

Q2 = 1 0 0, 0

and the second intermediate dividend

D2 = 0 0 1 1, 0 1 1.

The third step consists of the following. Comparing the negative number D2 = 1 1, 0 1 1 with the divisor

2 =1 1, 1 (the positive number) we form the third intermediate negative quotient

Q3 = 1, 0

and subtract the divisor 2 =1 1, 1 multiplied by the negative unit (i.e. the number - 2 = 1 1, 1) from the number D2. Taking into consideration that the subtraction is the addition of the ternary inverse code of the number - 2 = 1 1, 1 it means that in the case of the negative quotient the division step is reduced to the addition of the divisor with the preceding intermediate dividend D2 , i.e.

1 1,

1 1,

011

1

1 1, 1

1, 0 = &

0 1, 111 1 ^ 1

D3 = 1 1, 0 11

The fourth step:

1 1, 0 1 1 1 1, 1

1 1, 1 1, 0

D4 = 0 0, 1 1 1

The fifth step:

0, 1 1 1 1 1, 1

0, 1 1 1 0, 0 1

0, 0 1 0

1 ^ 1

= Q5

d5 = 0,

1 1 1

The sixth step:

1 1, 1

111 1 1 1

0, 0 1 = Q6

0, 0 0 0

The division is over. The result of the division is formed by means of summing up the intermediate quotients in accordance with the rules of the mirror-symmetrical addition, i.e.

1 0 0, 0

1 0 0, 0

4x3. 4i 2-41z ;,.4z -, . 4z ;2, ^

1, 0

1, 0

0, 0 1

0, 0 1

1 0 1, 0 1

I 1 o 1 I

1 o 1 1 o 1

1 I 0 1, 0 I 1

Note that the division result 12 = 1 1 0 1, 0 1 1 is presented in the mirror-symmetrical form.

5. Matrix and pipeline mirror-symmetrical adders

As is well known the digital signal processors make high demands to speed-acting of arithmetical devices. Different special structures (matrix, pipeline, etc) are elaborated for this purpose. Let us show that the ternary mirror-symmetrical arithmetic contains in itself interesting possibilities for realization of fast arithmetical processors.

Let us consider the matrix multi-digit ternary mirror-symmetrical adder (Fig. 6).

4Z‘3 I -A 4^2 f 4Zi -A 41,1 rf -A 4^-2 r4Ll3 u n r 4Z23

4Z23 i - 4L\ -1 - 41.2 J 11 y 4Z2, / rL- rf* - 1 - 42» J l/-4X2 / r1- 4L22 -1 4CL[2 -—i-l—

Fig.3. The matrix 7-digit mirror-symmetrical adder.

Each cell of the matrix adder in Fig. 6 is a ternary-symmetrical single-digit full adder having 4 inputs and

2 outputs (Fig. 1-b). The matrix adder in Fig. 6 consists of the 21 single-digit full adders arranged in the form of the 7x3-matrix. Each ternary single-digit adders has the k

designation 4X i where number 4 means that the adder

has 4 ternary inputs, the lower index i means a number of digit in the ternary mirror-symmetrical representation of (24) and the higher index k means a number of row of the matrix adder in Fig. 6.

The inputs of the single-digit adders

4x3 , 4Z 2,4Z 1, Z 0,4Z -1 , 4Z 12,4X-3

of the first row form the multi-digit input of the matrix ternary-symmetrical adder. The output of the intermediate sum of each single-digit adder is connected with the corresponding input of the next single-digit adder of the same column.

The outputs of the intermediate sum of the singledigit adders

of the last row form the multi-digit output of the matrix mirror-symmetrical adder.

The basic peculiarity of the matrix mirror-symmetrical adder in Fig. 6 is a special construction of connections between carry outputs of the single-digit adders and the inputs of the neighboring single-digit adders. The carry outputs of all single-digit adders with the even lower indices (2, 0, -2) are connected with the corresponding inputs of the neighboring single-digit adders disposed in the same row but the carry outputs of all single-digit adders with the odd lower indices (3, 1, -

1, -3) are connected with the corresponding inputs of the neighboring single-digit adders disposed in the lower row. Note that such organization of the carry connections allows eliminating the above-considered "swing" phenomenon.

Let us consider the operation of the matrix mirror-symmetrical adder for a concrete example. Let us need to summarize two equal mirror-symmetrical numbers:

A = 0 1 1 1, 1 1 0 and B = 0 1 1 1, 1 1 0.

The addition consists of 2 stages. Each of the stages is realized by one row of single-digit adders and consists of two steps.

The first stage. In accordance with Fig.6 the first step consists of the following. The single-digit adders of the first row with the even lower indices

(4x2, 4x0, 4X-2) form intermediate sums, which enter the inputs of the second row adders, and the carries, which enter the corresponding inputs of the single-digit adders with the odd lower indices of the first row

(4x3, 4Xp 4X-1, 4X-3). The above-considered

transformation of the code information may be presented in the following form:

0 1 1 1, 1 1 0

0 1 1 1, 1 1 0

111

I 1 o 1 I

1 o 1 1 o 1

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

Hence the first step is the formation of the intermediate sums and the carries on the outputs of the single-digit adders with the even lower indices (2, 0, -2).

On the second step the single-digit adders with the odd lower indices (3, 1, -1, -3) enter into action. In accordance with the entered carries they form the intermediate sums and the carries entering the single-digit adders of the lower row, i.e.

0 1 1 1, 1 10

0 1 1 1, 1 10

111

I 1 o 1 I

I o 1 1 o 1

II 1 1, 1 1 1

1 o 1 I

1o1

The first stage is over. We can see that the results of the first stage are some intermediate sum and some carries entering the adders of the lower row.

The second stage. The single-digit adders of the

2 2

second row with the even lower indices (4x2, 4x0,

2

4x -2) form the intermediate sums entering the corresponding inputs of the lower row adders and the carries entering the corresponding inputs of the same row ad-

222 ders with the odd lower indices (4x3, 4x1 , 4x ^

4x 23), i.e.

11 1 1, 1 11

1 o 1 I

1 o 1

1 0 1 1, 1 01

Since all carries forming on this stage are equal to 0 it means that the addition is over on the second stage. The obtained sum enters the inputs of the lower row ad-

3 3

ders 4x 3 - 4x -3 and then appears on the output of the adder.

There exist two directions for the extension of the functional possibilities of the matrix mirror-symmetrical adder. If we set the registers between the neighboring rows of the single-digit adders then the aboveconsidered matrix adder turns into the pipeline mirror-symmetrical adder. In fact the code information from the preceding row of the single-digit adders is memorized in the corresponding register and the preceding row of the adders is ready for a further processing. Then the adders of the lower row process the code information entering the lower row single-digit adders and simultaneously the top row of the single-digit adders starts to process the new code information. It means that starting since some moment we will get the sums of the numbers A1 + B1 A2 + B2, ..., An + Bn entering the adder input during the time period 2At, where At is the delay time of the single-digit adder.

The other possibility to extend the functional opportunities of the pipeline adder consists of the following. We can see in Fig. 6 that each single-digit adder of the lower rows has a "free" input. We can use these inputs as the new multi-digit outputs of the pipeline adder. Using these multi-digit inputs we can turn the pipeline

adder into the pipeline multiplier. In this case the mirror-symmetrical multiplication of two mirror-symmetrical numbers A(1)xB(1) is performed in the following way. The first row of the single-digit adders

summarizes the first two partial products P1 + P1. This code information enters the second row of the singledigit adders. If we send the 3-d partial product P1 to the "free" input of the second row we will get the sum p!+p2 + p3 on the outputs of the second row. In so doing the first row starts summing up the first two partial products of the next pair of multiplied numbers A(2)xB(2). The "free" input of the 3-d row is used for

receiving the next partial product P41 of the first pair of

the multiplied numbers A(1)xB(1), etc. We can see that the pipeline adder in Fig. 6 allows multiplying many mirror-symmetrical numbers in the pipeline regime. In so doing the multiplication speed-acting is determined by the time 2 At, where At is the delay time of the single-digit adder.

Let us emphasize one more the following important advantages of the above-considered mirror-symmetrical adder and multiplier:

(a) The addition and multiplication of numbers are performed in the direct (true) code.

(b) All the addition and multiplication results are checked in accordance with the mirror symmetry property.

(c) In the pipeline regime the addition and multiplication time is equal to 2 At, where At is the delay time of the single-digit adder.

(d) The structure of the pipeline mirror-symmetrical adder has a high "homogeneity" that is very important since point of view its micro-electronic realization.

Conclusion

As is well known the classical positional number systems were the result of a long historical development. The mirror-symmetrical number system above considered possibly is one of the first number systems, which are a consequence of mathematical investigations.

Modern achievements of the Fibonacci numbers and golden section theory [5] and the Fibonacci and golden ratio codes theory [2,6,7] create real premises for elaboration of the Fibonacci and "golden" computers as a new computer direction. The project of the mirror-symmetrical computers is one of the most interesting applications of the Fibonacci numbers theory to modern computer science.

The mirror-symmetrical number system is a synthesis of three important ideas. First of them is the positional principle of number representation, the second is using three numerals {1, 0, 1} for number representation and the third is the golden ratio, the 2-d power of

3 + \5

which t2 =-----------« 2,618 is the base of the mirror-

2

symmetrical number system.

This unique combination caused the creation of

the number system with unique mathematical and technical properties, namely:

(1) Being the positional number system, the mirror-symmetrical number system keeps all well-known mathematical properties of classical positional number systems, in particular the binary number system.

(2) An use of three numerals for number representation allows representing negative and positive numbers and fulfilling all arithmetical operations on them in the direct code. This simplifies computer arithmetical structures and raises the speed acting of processors.

(3) Being the number system with irrational base (the square of the golden ratio) this one brings to the discovery of a new fundamental mathematical property of integers represented in the ternary mirror-symmetrical number system, the mirror-symmetrical property, which is an invariant about arithmetical operations.

(4) The mirror-symmetrical property brings to design of original pipeline speed-acting processor for realization of digital signal processing. A structure of the processor has a high extent of homogeneity (it is important for micro electronic technology) but the property of mirror symmetry allows to check all arithmetical transformation of numerical information.

(5) The ternary mirror-symmetrical number system is a further development of the classical ternary-

symmetrical number system, which was used in the ternary computer "SETUN" designed in 60th in the Moscow University. The "ternary principle" ("Brousentsov's principles") is one of the fundamental principles of modern computing and its development might became a highly interesting idea for optical computers. That is why the "Ternary Mirror-Symmetrical Arithmetic" considered in the present article might call an interest of the optical computer specialists.

References

1. Pospelov, D.A. Arithmetical Foundations of Digital Computers. Moscow, Publisher "Vyshaja shkola", 1970, 320 p. [In Russian].

2. Bergman, G. "A number system with an irrational base". Mathematics Magazine, No 31, 1957, pp. 98-119.

3. Malinovskiy, B.N. History of computers in faces. Kiev: Publisher "KIT", 1995 [In Russian].

4. Knuth D.E. The art of computer programming. Vol.2. Seminumerical algorithms. - Addison-Wesley, 1969.

5. Hoggat, Verner E. Fibonacci and Lucas Numbers, California: Houghton-Mifflin, Palo Alto, 1969, 92p.

6. Stakhov, A.P. The Golden Ratio Codes. Moscow: Publisher "Radio and Communication", 1984, 140p. [In Russian].

7. Stakhov, A.P. Computer Arithmetic based on Fibonacci Numbers and Golden Section: New Information and Arithmetic Computer Foundations, Toronto, SKILLSET Training, 1997, 379 p.

i Надоели баннеры? Вы всегда можете отключить рекламу.