CHAPTER
VII
ASYMPTOTIC ESTIMATION FOR THE COMPLEXITY OF LOGICAL NETS
VII.l. Fundamental concepts. Formulation of the limiting theorem The present chapter will examine in its most general form the problem of constructing an optimum logical net to realise a given bounded-determinate operator. The specific feature of this investigation is that its aim is to discover the asymptotic laws which become evident at high values of the parameters of the bounded-determinate operators (weighting, and number of input or output letters). This approach to the matter was first developed by ShannonI, as applied to the realisation of truth operators in contact circuits; it was he who obtained the first substantial results in this direction. The final solution to the problem formulated by Shannon was obtained by Lupanov, who generalized the problem to cover other types of circuit, including logical (truth) nets2. Section 2 is devoted to this body of questions. The following sections contain the material necessary to extend the Shannon-Lupanov limiting theorem to cover logical nets with memory. In the present section, we shall introduce a number of concepts and notations required for our subsequent exposition, and we shall state the fundamental theorems. These theorems will be proved and the designs which correspond to them illustrated in the following sections. In this section we shall confine ourselves to a few preliminary explanations. We shall examine all kinds of logical nets3 formed of a given arbitrary though fixed - system of elements {%JI,>, the sole stipulation being that it be complete; we shall term such a system of elements the basis. In order to state the problem of finding an optimum net to realise a given operator, an
1 C. E. Shannon, The synthesis of two-terminal switching circuits, BSTJ (1949) 82, p. 59-98. 2 0. B. Lupanov, A method of circuit synthesis, Izv. vyssh. uchebn. zaved, Radiofizika (1958) no. 1. 3 Henceforth we shall sometimes omit the word “logical”. 288
VII.11
FUNDAMENTAL CONCEPTS
289
objective criterion must be available by which dfferent nets can be compared (for complexity, cost, reliability or other factors). In accordance with such a criterion, let each net Q be assigned a positive real number L(Q), to be termed the index of simplicity or the cost of Q. Every bounded-determinate operator 8 can be realised by nets of {%Xi} (by virtue of the completeness of this system), and generally speaking by different nets, perhaps distinguished by their indices of simplicity. We shall designate by L(8) the least of the indices of simplicity. The problem of optimum realisation of the operator 8 consists of constructing any of the nets which realise it, whose index of simplicity is exactly L(8). For example, the index of simplicity in a net composed of valves could be taken as the number of all the control grids in the net; in that case, the construction of an optimum net would mean the construction of a net with a minimum number of control grids. Optimum generation obviously depends on the system chosen to evaluate the complexity of the nets. In the theory expounded below, thls choice may be unrestricted, provided the following two demands are satisfied: I. Every element %Xi of the basis in question has a positive index of simplicity
L(%X,)> 0
(where
i = 1,2, ...,p),
where p is the number of elements in the basis. 11. The index of simplicity of a net is equal to the sum of the indices of simplicity of the elements of which it is composed. Consequently, the indices of simplicity of nets are numbers of the form
An evaluation of complexity which satisfies these postulates has perhaps the disadvantage that it fails to reflect the character of the connections between elements, and indicates only their total number in the net concerned. Otherwise, the naturalness and justification for the postulates as stated are quite evident. From postulates I and I1 and the definition of a logical net, there follows a trivial algorithm for solving the problem of the optimum realisation of a given operator 8. This algorithm is based on the following considerations: 1. The numbers which express the indices of simplicity of all possible
290
logical nets of
ASYMPTOTIC ESTIMATION
pIII.1
{m,} can be effectively arranged as an increasing sequence: L , , L,, ...)Lj, ...
Obviously, L , is the index of simplicity of a net consisting of one element, namely the “simplest” element. 2. For every number L j there exists only a finite set of different nets SLj with an index of simplicity not greater than L j , and all these nets can be constructed one after the other. Given now some operator 0 (we can suppose, for example, that it is specified by its canonical tables), for which it is required to find an optimum realisation. Then, for a fixed L j , we begin to construct nets of SLj one after the other; each net so constructed can be analysed, and by comparing it with the canonical tables for the operator 0 it can be established whether or not the net realises 8. Beginning this process with nets of the set S,,, and then proceeding to S,,, SLB,..., we continue the procedure until the first net is found which realises 0; the net thus found will be the desired minimum net. The proposed algorithm thus solves the problem as stated, the underlying idea being extremely simple, being essentially an inspection of a large quantity of nets. It can be easily shown that the number of nets in S, increasing by intervals of L increases as (cL)cL, where c is a constant; the enumeration algorithm is therefore practically impossible to apply, even for relatively small values of the parameters. But besides its cumbrousness, this trivial algorithm also possesses a serious disadvantage; it is impossible to derive from it any preliminary notion of the complexity of the net obtained as a result of applying it. The principal content of the present chapter is devoted to investigating effective methods of solving the optimization problem, which do not call for an inspection of a whole quantity of nets. Application of these methods enables one not only to obtain almost optimum nets (in a given sense), but also to estimate in advance their indices of simplicity. In order to clarify this body of questions, some important concepts and notations must first be introduced. We will consider the class of all bounded-determinate operators with a logarithmic weight k (i.e. with a weight A=2k= 1, 2, 3, ...), for which the input letters are all the possible groups of length rn of ones and zeros ( m = I , 2, 3, ...), while the output letters are similar groups of length n (n= I , 2, 3, ...). This class, which for any fixed m, n, k is finite, will be The number of operators in the class will be denoted denoted
VII. 1J
29 1
FUNDAMESTAL CONCEWS
N (m, n, k). Obviously 8m,n,kconsists of such operators as can be specified by a system of canonical equations of the form: ( t ) = qi [XI ( t > 7 . * . y x m ( t ) , 41 (t>, *..)qii(t)] q j ( t ) = + j [xi ( t ) , ..., x m (t>,4 1 (t>7 ... qii(t)I zi
7
9
7
)
5
(7.1)
where 2‘- < 1= 2k< 2k.Following C. E. Shannon, we introduce the function L ( m , n , k ) equal to the least number L, such that any operator of class Om,n,k can be realked in any net, the cost of whch does not exceed L. It is obvious that L ( m 7 n , k )= maxL(O), (7.2) OE Om,n,k *
1
We have referred above to a trivial algorithm for solving the problem of optimization. Clearly, this algorithm also solves the problem of accurately computing the values of L(m, n, k). To do this, one need only construct (according to this trivial algorithm) optimum realisations of all the operators of (the number of operators being finite), and choose the highest number out of all the numbers L(8) found for them. Meanwhile, the considerations advanced above, that the algorithm is cumbersome and practically unacceptable, are automatically transferred to the computation of L(m, n7 k). It is easy to realize that the procedure for computing L(m, n, k ) is completely unacceptable. For this reason it is of interest to devise methods by which L(m7n, k ) could be evaluated if, only approximately, though effectively enough, for example by an adequate and easily-grasped formula. For this purpose we shall consider the behaviour of L(m, n, k ) when m + k tends to infinity and when certain limitations are imposed on the rise of n. The meaning of these limitations is as follows. We know that for the operators in question the output letter z ( t ) of an operator i s uniquely defined by a pair of input letters x ( t ) , q(t). The number of letters in the output alphabet which are actuaZZy used to specify the operator, is therefore not greater than the product of the number of letters in the input alphabet times that of the alphabet of states: If all (or “almost” all) the output code groups are used, then n 6 m+k. (7.3) 2” < 2m-2k, that is However, not all the 2” code groups are actually employed as a rule as output letters (for example, a redundant code is often used specially for reasons of reliability). Therefore n may even be greater than m + k . This
292
WII.1
ASYMPTOTIC ESTIMATION
redundancy is not precluded henceforth, though we stipulate that it should not be too great. More precisely, we assume the condition
On this condition, the asymptotic behaviour of L(m, n, k) can be successfully computedl. It will appear quite natural for the asymptotic formula which expresses L ( m , n, k) to incorporate not only the parameters m, n, k which characterize operators of the class ern,,& which we intend to realise, but also the parameters which characterize the system of elements forming the logical nets which realise these operators, and furthermore the method adopted to evaluate their complexity. For the present we shall confine ourselves to complete systems of elements containing elements of the following two types: 1) elements, each of which has one output channel and realises one function in the algebra of logic; 2) elements, each of which has one input channel and realises any bounded-determinate operator. The generality of the following arguments is ensured by the fact that the limitations we have imposed on the systems of elements are not very restrictive and are usually satisfied. As a typical example, we may refer to a system of electronic valves (type 1 elements) and a delay element or a single-input flip-flop (type 2 element). Note that the type 1 elements are bound to contain at least one which realises a function in the algebra of logic, which is essentially in more than one variable. Otherwise the system of elements would not be complete, for elements of such a system could not be employed to construct logical nets to realise functions in the algebra of logic which are essentially in more than one variable. We will agree to call the speczfi cost of any such element fm, the number L(YJl,)/(n- l), where L(YJl,) i s the cost of an element, and n is the number of variables essentially comprising the function to be realised by it. We will also denote by p the least specific cost of the elements. This number p is the only parameter of the basis group and of the method adopted for evaluating the costs, which enters into the formula expressing the asymptotic evaluation of L(m, n, k ) . In fact, the following theorem can be proved.
-
.-.
We would recall that two quantities p , v are termed usymptoricully equal in some process (F v), if in this process lim ( f i / v ) = 1 ;this means that the relative error produced by replacing one of these quantities by the other tends to zero.
vII.11
FUNDAMENTAL CONCEPTS
LIMITING THEOREM. I f m +k+ L (m, 11, k)
00
293
and lg n/(m +k)+O, then
- ne m2m.2k + +k ___
ke
(2" - 1).2k m+k
(7.5)
Meanwhile, under the conditions stated in this theorem (and even under rather more general conditions) the following asymptotic equation is valid : lgN(m,n,k)-(2"-
1)-2k(n-t k ) + n * 2 k .
(7.6)
This enables (7.5) to be converted to the following less complicated form:
In particular, when k = 0 and n = 1, (7.7) takes the form : L ( m ) = L(m,1,0)
-
2" m
@-.
(7.8)
The function L(m) was first introduced by Shannon to evaluate the complexity of the realisations of functions in the algebra of logic in m variables by switching circuits z. Lupanov has investigated L(m) as applied to switching circuits and to logical nets3 (termed by him circuits of functional elements) and has established an asymptotic evaluation for them (7.8). We obtained formula (7.5) by extending the method of Lupanov4, used by him to investigate the realisation of functions in the algebra of logic (that is, essentially truth operators), to cover operators with memory5. Formula (7.5) is evidence that the behaviour of L(m, n, k ) depends little on the nature of the elements forming the logical net, and is determined only by the minimum specific cost of type 1 elements. As regards the type 2 elements, their parameters are not reflected in any way in the asymptotic formula. This means, for example, that the behaviour of L(m, n, k ) essentially does not vary if, besides the standard elements, single-input flip-flops We would recall that N (m,n, k ) is the number of all the operators in Om, L. C. E. Shannon, The synthesis of two-terminal switching circuits, BSTJ (1949) 28, pp. 59-98. 0. B. Lupanov, The possibility of synthesizing circuits from arbitrary elements, Trudy matem. in-ta im. Steklova (1958) 51. 0. B. Lupanov, A method of circuit synthesis, Izv. vyssh. uchebn. zaved. Radiolizika (1958) no. 1. B. A. Trakhtenbrot, Asymptotic evaluation of the complexity of logical nets with memory, DAN SSSR (1959) 127, no. 2. 1
294
ASYMPTOTIC ESTIMATION
[VII.1
are employed, or elements which generate periodic sequences. The choice of a particular basis group of elements may seriously affect the cost of realising operators with small parameters m, n, k . The increase of these parameters is governed by the asymptotic law (7.5). The limiting theorem is a direct consequence of two theorems: the theorem of the upper bound and the theorem of the lower bound, which are true for the same conditions imposed on the basis elements as in the limiting theorem. The second of the above theorems establishes that, however small a fixed number E > O may be, operators O E Om,& exist for which it is valid that
2"-2k
(2" - 1)2k m+k
that is :
In reality however, a far stronger assertion is true, expressed in the theorem of the lower bound. THEOREM OF THE LOWER BOUND. For anyJixed E >0, the ratio of the number of operators of the class 6m,n,k, for which (7.9) is true, to the number of all the operators of om,n,k tends to I as m + k tends to injinity and lg nl(m + k ) tends to zero. Thus, the inequality (7.9) is true of the overwhelming majority of operators in the class 8n,,n,k. THEOREM OF THE UPPER BOUND. For whatever E >0, there exists a v >0 such that, if m + k > v, for any operator 6 E Om,n,k the following inequality is valid:
(7.10) The proof of this theorem consists in describing an effective method of synthesis (which does not reduce to a mere enumeration, as in the case of the trivial algorithm), whlch, for large m + k (when m+k+oo), for any 0 E 6,n,n,k constructs a logical net, the cost of which satisfies inequality (7.10). A comparison of these two theorems not only justifies the limiting formula ( 7 . 9 , but it also establishes something more. It is found, in fact, that for almost all operators 6' E Om,n,k the function L(8) is close to the function L ( m , n, k ) , that is almost all the operators in the class O,n,n,k are as complex to synthesize as the most complex operator in the class Meanwhile,
VIT.21
A FUNCTION I N THE ALGEBRA OF LOGIC
295
the method of synthesis which guarantees the upper bound (7.10) is almost optimumfor almost all of these operators. Thus in a certain sense, this method of synthesis solves the problem of constructing an optimum net. Admittedly, a complete solution of this problem demands more, namely, a method of synthesis which would make it possible to discover precisely optimum realisation procedures for all operators. However, in the light of some recent results obtained by Yablonskii, it appears likely that a complete solution in this sense is impossible by any other method than a trivial enumeration of the set of all netsl. In the succeeding sections, the principal attention will be paid to expounding various methods of synthesis, by which ultimately (Section 6) we shall succeed in deriving the theorem of the upper bound. We shall not state a proof of the theorem of the lower bound nor of formula (7.6), though we shall be referring both to the theorem and to the formula. VII.2. Synthesis of a net to realise a function in the algebra of logic; upper bounds for the complexity of a net
We shall now discuss various efficient2 methods of synthesizing nets to realise functions in the algebra of logicf(x,, ..., xm),and we shall estimate the cost of these nets for m-+co. For each method A we shall denote by LA(m)the least L such that, for any function in m variables, A yields a net to realise it, at a cost not exceeding L. A method B is naturally considered to be stronger than A, if LB(m)
296
pII.2
ASYMPTOTIC FSTIUATION
Under paragraphs 1, 2, 3 and 4 below, we shall discuss the methods of synthesizing nets of V-, &- and 1-cells (which corresponds to the usual specification of functions in the algebra of logic by the operations of disjunction, conjunction and negation). Paragraph 5 will deal with the most general case, which takes into account the particular nature of the elements forming the basis. In paragraph 6 , the results previously established for functions in the algebra of logic are extended to systems of such funtions (the general case of a truth operator). 1 . Simulation of the perfect disjunctive normal form (p.d.n.f.). The realisation of the function f ( X I , xz,...) x,), proceeding from its p.d.n.f., requires not more than m 1-cells (to form the negations f , , Zz, ..., 2")) not more than ( m - 1) x 2" &-cells (forming all terms of the type xy' xy ... xLm) and not more than 2" V-cells. The cost of directly simulating the formula is subject to the inequality:
L,.(f)< mL,
+ ( m - 1)2"L, + 2"L,
The following inequality is obviously true for m+co L , . ( f ) < m2"L,[1
+ o(l)].
1:
(7.11)
This estimate can be improved by taking into account that either the functionfitself or its negationfhas a p.d.n.f. with a number of conjunctive terms <+2" (see Chap. 1). Simulation off orf(depending on which has the shorter p.d.n.f.), subsequently taking its negation (in the second case) reduces the estimate (7.1 1) by a factor of two: (7.11')
2. The use of a universal decoder. In method 1 the principal cost falls on the &-cells required to form all conjunctions of the type xy' xy ... x",". We shall term the net which realises all these 2" conjunctions a universal decoder (u.d.) in m variables x l rxz,..., x,. The more economical manner of realising the universal decoder (as compared with the separate formation of 2" terms) is evident from the following (see also Chap. VI). ~~
We recall the notations: o (j?) signifies that a/j? 0, a = O ( b ) signifies that, for some constants m,M (0 < rn < M ) , m < a/B < M is true. I n particular, o ( 1 ) denotes a quantity which tends to zero in this process. a =
+.
v1r.21
297
A FUNCTION IN THE ALGEBRA OF LOGIC
The number of &-cells required to realise (separately) the terms
Also, not more than 2"' &-cells (combining all the possible pairs of short conjunctions) are required to obtain "long" conjunctions. Thus, when m-, co : L(u.d.) < (m-2*" + 2")L,
+ mL,
= 2"L,[1
+ o(l)].
(7.12)
To realise the functionf(x,, ..., xm), given a universal decoder, also requires not more than 2"' V-cells. Consequently : L,.(nz) < 2"[L,
+ L"] [l + 0(1)].
(7.13)
3. Shannon's method '. A further improvement of the method of synthesis, whereby the estimate (7.13) is considerably reduced, can be obtained by expanding the function j: Let the number of variables m=Z+n. We now investigate the expansion (see Chap. I):
f (x17
* ' * 9
YIY
.'.Y
yfl) = Vx;'
'.' xp'f
(Ol?
YlY
''.>Y n )
(7*14)
when l-+co, n+co. By (7.12), not more than 2'[1 +o(l)] &-cells will be expended in realising conjunctions of the type xyl x? ... xp'. Not more than 22" different functions f ( o , , ..., o , y , , ..., y,,) exist, and each costs not more than 2"(L,+Lv) [I +o(l)] to realise. Furthermore, another 2' &-cells and as many V-cells are needed to form the right-hand side of (7.14). We thus have :
The right-hand side of (7.15) depends on the method of decomposing the number m into components 1 and n. This expansion must be performed so as to minimize the estimate for the function L(m). Taking n =Ig(m - 3 lg m), 1
C. E. Shannon, The synthesis of two-terminal switching circuits, BSTJ (1949) 28,
pp. 59-98.
298
[VII.2
ASYMPTOTIC ESTIMATION
Z=m-lg[m-3
[
m -Ylg
lg m ] , the right-hand side of (7.15) takes the form1: ni
[2L,
Consequently,
+ L , ] + Tni2" (
m - 3 lg n z ) ( L ,
2" L3"(ni)< -[2L, m
+ L,)
+ L , ] [t + 0(1)].
1+ [I
0(1)].
(7.16)
This method was first used by C . E. Shannon in the theory of switching circuits. The foregoing discussion demonstrates that, when Shannon's method is used, two factors are involved in reducing the cost of the net: a) the economical realisation of a universal decoder in 1 variables with a total cost 62'[l +o(l)] L,, by paragraph 2 of this section; b) expansion of the function to be realised with respect to certain o f the variables; in so doing, a suitable number of these variables is chosen: 1 = nz - Ig (nz - 3 lg I n ) .
4. We shall now proceed to examine Lupanov's method 2, which produces a still more economical realisation than that of Shannon. We shall begin by expounding Lupanov's method as applied to the special case when, as in previous cases, the net is constructed of &-, V - and ?-cells. We shall then consider the general case, when the net is constructed of elements of an arbitrary basis. This exposition makes the purpose of the separate stages simpler to understand. We divide the m variables of the function f into three groups X17X2,
...,x,?,
01, v2,
...' U P ,
Yl7
Y2,
-..,Y v >
(where il+ p + v = rn) and specifyf by the matrix illustrated in Table VIT. 1 ; the rows of the matrix are numbered by groups of values of the variables y , , ..., yv, and the columns by those of the variables xl,..., x,, ul, ..., up, (cf. Table 1.10, in which the variables xl,x 2 are assigned to the rows, and xg,x4,x5 to the columns). .
.
~-
Both here and later we take the slight liberty of using the logarithm instead of nearest whole number not less than this logarithm. This substitution is unimportant for our estimates. '' 0. B. Lupanov, A method of circuit synthesis, Izv. vyssh. uchebn. zaved., Radiofizika (1958) no. 1. I
vII.21
299
A FUNCTION IN THE ALGEBRA OF LOGIC
TABLEVII. 1 XI
XA
v1
my2 ~
0
. . . 7”
o . . .0
1
5 P
AI
I
t’P
AZ
4142
.. . q v
. . . . . . . . f ( r l , . . ., T A , 01,
. . .,ow, qi,
. . .,4 9 )
1,1, ... 1
Where no inconsistency arises, we shall write x instead of the group of variables x,, ..., x,; in precisely the same manner, u, y and z will denote the other groups of variables or groups of their values. This will give expressions such asf(x, u, y ) , f ( z , u, y), where z is the group zl, ..., ,z, and so on. TheJirst stage in constructing a net. The rows of the matrix are divided into groups A , , A,, ..., A,, each of S rows (perhaps with the exception of one group, say A,, which will contain a lesser number of rows when 2’ is not exactly divisible by S ) . Letf,(x, 0, y ) be a function which coincides with f ( x , u, y ) on group A , and is equal to zero on the remaining rows. Then the following is obviously true (7.17)
REMARK 1. Let zl,..., z, o,,..., o,,be some fixed values (0 or 1) substituted for the variables x,, ..., x,, u,, ..., up. A column of the values of any of the functionsf,(z,, ..., ,z, ol,..., op,y,, ..., y,) contains not more than S ones1. Consequently: 1) its p.d.n.f. contains not more than S conjunctive Since ones may be present only at the intersections of this column with the group At.
fvII.2
ASYMPTOTIC ESTIMATION
300
terms; 2) for a given i the number of functions,fi(t, 0,y)<2', while their total number is not more than p x 2' < ((2'/S) 1) x 2'. The second stage in constructing a net consists of expanding each of the functionsfi(x, u, y ) with respect to the variables x:
+
v
ji(X,U,Y) =
x?, ..., X?ji(zl, ..., Z I , O , Y ) .
(7.18)
II,...,ZTL
Consequently :
P
f(x,u,y)=
V V
X'fi(z,u,y)*
(7.19)
i = 1 TI,...,I>.
REMARK 2. The total number of all functions f i ( z , u, y ) does not exceed p x 2 I < ((2"/S) 1) 2a.
+
Thirdstage. For each of the functionsfi(z, v, y ) , we consider the expansion with respect to the variables v : ,.(if
0,
y) =
v
0 19 . . .
v? .aw
...V P f
(z,
01,
..., 0&,Y ) .
(7.20)
In accordance with this representation, the circuit which realises f is constructed of separate blocks (Fig. 7.1). The inputs of each of them are either connected to outputs of blocks previously constructed or are inputs of the whole circuit. The functional characteristics of these blocks (see Fig. 7. I) and an evaluation of their cost are given below.
...... ..
;j
L Fig. 7.1
(i\l
VII.21
301
A FUNCTION IN THE ALGEBRA OF LOGIC
Blocks A, By C are universal decoders for the groups of variables y , u, x respectively. Assuming that v+ co and p-+ co and I + co,we have the following evaluations of their costs (see (7.12)):
L(A) < 2'L,[1
+
0(1)], L(B) < 2"L,[1 L ( C ) < 2&[1 o(l)].
+
+ o(l)],
Block A* realises all functions of the typefi(z, CT,y), the number of which is not greater than ((2'/S) + 1) x 2' (cf. Remark 1). Each function is realised as a disjunction of the corresponding conjunctions arriving from A; this requires not more than S V-cells (cf. Remark 1). We thus have:
(: )
L(A*)< - + 1
2'SLV
Block D realises all possible functions of the type v;'u;2... V P f (z,
cr1,
...),'rc
y1,
...)y , )
by conjunctively combining the functions realised in block A* to those realised in the decoder B. The total number of such functions does not exceed the product of the number of all functions from A* and those from B. Consequently :
G )
L(D)< - + 1
2'*2'L,.
Block G realises all functions f i ( z , v, y ) , the number of which does not exceed ((2'/S) + 1) 2* (cf. Remark 2), proceeding from functions realised by block D. Not more than 2" V-cells are required to realise each function f i ( z , 0, Y ) . Consequently : L(G)<
6-+ )
1 2"2'LV.
Block H realises the functionf(see (7.19)), proceeding from the functions of blocks C and G . It contains not more than ((2"/S) + 1) 2* &-cells to realise each conjunction of the type x;l ... xyJ(zl, ..., z, v, y ) and not more than ((2'/S) + 1) 2A V -cells to realise the function f from these conjunctions. Consequently,
L(H) <
:(-+ )
1 2*(L, + L " ) .
We now evaluate the cost of the individual blocks when m+
00
and under
302
WII.2
ASYMPTOTIC ESTIMATION
the condition that the foltowing values are taken for the parameters v, p, A, S : p=[lgm], ) I =m - v-p.)
S=[m-5Igm], v = [2 Ig m],
(7.21)
The following evaluation is easily obtained for the block G :
L(G)
+o(l)]L,;
meanwhile, it is found that each of the quantities
L (A), L (B),
W*), L (D), L (H),
(C),
and hence their sum, is o (2”lm). Consequently the evaluation obtained for the entire circuit is: 2”
W) <-[I + 0(1)]L“. m
(7.22)
This evaluation is substantially better than that yielded by Shannon’s method. 5. We shall now describe the general case, in which the basis is formed of an arbitrary number of elements. We should first note that in the construction considered in the previous division, the whole cost is chiefly accounted for by block G which, together with block D, performs the expansion (7.20) of the functionfi with respect to the variables ul, v 2 , ..., vp. In so doing, block G corresponds to the external functions of the expansion1 (in the case to which we referred, they were 2’-term disjunctions), while block D corresponds to conjugate functions (in our case, conjunctions). This suggests that in the general case it is more expedient to use an expansion of the following form (cf. 1.14) instead of (7.20):
) = F { y o [ui ...)u p , f i ( 7 7 0, -..)0, Y ) ] . . . > O ~ ~ ~ Y ) ] ~y 2. -r .- >1 [u,, . . . , u p , f i ( z , 1 , . . . , 1 7 1 , ~ ) ] , (7.23) X 2 r ( U 1 , ..., up), ..., XN-I(V1, . . . , u p ) > ,
fi (7,u, Y ~1 [ ~ l .,. . , u p ’ f i ( z , O ,
9
9
whereby the external function of the expansion F permits the most economical method of realisation. For example, let a cell cp, which realises the function cp(x,, ..., x,), being essentially a function of r variables, have a cost L,, while its specific cost cp, equal to L v / ( r - I), is the lowest cost of the specific costs of the elementary cells. The external function of the expansion F is constructed by repeated 1
See Chap. I, Sec. 4.
v11.21
A FUNCTION IN THE ALGEBRA OF LCIGIC
303
superimposition of the function cp. Since the number of times the superimposition is made <(2"/(r- I)+ l ) , then for the cost L, of block T, which realises F, proceeding from the cells cp, we have:
(L+ l)., = Q.2" + L,.
L, < r - 1
If there are no 1-, &- or V-cells among the elements in the basis, then, by virtue of the completeness of the basis, it is possible to construct the corresponding 1-, &- and V-blocks, for whose cost we shall retain the notation L,, L , and LV. It is therefore possible to reproduce - wholly or partly - the construction in the previous division, while retaining the evaluations obtained there; this refers in particular to the major blocks A, B, C , A*, H, whose construction we shall leave in its original form. A s regards blocks D and G, instead of them we construct blocks D' and G', which together must realise all functions of the form.fi(z, u, y), as represented in (7.23). Block D' realises all functions Yi[ u l , ..., v,,, ,fi(t,(rl ..., cp,y ) ] ,the number of which1 does not .exceed p2'x 2', and all functions x i ( u , , ..., up), the number of which is not greater than r .2 If functions Y j in p + 1 variables and functions xi in p variables are realised as indicated in Division 2, tbe cost of each of them will be not more than 2" [1 +o( l ) ] L,. The following inequality is therefore valid : L(D') < p*2s2p2p+'[l
+ o(l)]L,.
Block G' realises all functions of the formA(s, u, y ) , proceeding from the functions realised by block D'. Block T, alone is required to realise each functionA(z, u, y ) (see relation (7.23)). Therefore
Retaining the values in (7.21) for the parameters A, p, v, S, when m-, co we obtain the evaluation L(G')
WII.2
ASYMPTOTIC ESTIMATION
304
REMARK.In a special case, if V-cells were also included among elements in the basis with a minimum specific cost cp, we should have cp = L v / ( 2 - 1) = LV ; in that case, the evaluation (7.24) assumes the form of (7.22). 6 . We shall now consider the function L(m, n) = L(m, n, 0), i.e. whose value is as follows: the lowest number L such that any truth operator 0E can be realised by a logical net with a cost not exceeding L. The operator O E O r n , , , is determined by specifying a system of n functions in the algebra of logic, each of m variables. The simplest method of realising 0 is to realise separately each of the n component functions zi =fi(xl, ..., xm), where i = I , 2, ...,n, by any one of the methods discussed above. In particular, Lupanov's method is applicable in this case with the evaluation: Q.2"
q e ) < n-[1m
+ o(l)]
(7.25)
When we were explaining some practical methods of synthesizing a multioutput net (see Chap. VI), it was indicated that an economical net can often be obtained by combining the common parts of the nets which realise the component functions, which is possible, for example, by using the cascade method. This suggests that the estimate in (7.25) is on the h g h side, and also that an improvement can be obtained by discarding the principle of separate realisation and by devising suitable principles for an efficient joint realisation of the functionfi (where i 6 n ) . For individual sub-classes of the class of all truth operators, this is indeed the position. (This refers in particular, for instance, to the sub-class of monotonic operators, which is discussed in the next section.) However, for the class of all truth operators, with the extremely general limitation imposed on the increase of the parameters m, n, the estimate (7.25) cannot be improved. This limitation amounts to requiring that lini ((lg n)/m)=O, which constitutes a special case (when k=O) of the condition (7.4), demonstrated to be entirely natural in Sec. 1. In fact, when this condition is fulfilled, the general theorem of the lower bound established that, with increasing m, the fraction of those truth operators for which 2"an (7.25') L(8) 3 @-[l -E l , m tends to 1 ( E > O i s an arbitrary fixed number). Thus L ( m , n ) e*-n *m2 m (withg+O,m+m
-
).
(7.25")
VII.31
A SIMPLE REALISATION
305
VII.3. Operators which admit a simple realisation The fact that the exponential type of estimate established in the foregoing section admits of no improvement may lead to discouraging conclusions that it is impossible to obtain simple systems of realisation for the overwhelming majority of thinkable bounded-determinate operators. In a certain sense this is indeed the case. However, when solving practical problems, one has chiefly to deal not with any operators taken at random, but with a relatively small stock of simple operators possessing a fairly easily-camprehended internal structure. Comparatively uncomplicated methods of realisation can usually be found for such operators, sometimes with a power (and in special cases linear) estimate in terms of m and n. It is therefore an important problem to devise various special methods of synthesis with respect to different classes of operator, which are of practical significance. Important results in this direction have been obtained by Yablonskii1, Gavrilov2, Povarov 3, Lupanov and other authors. In the present section we shall discuss some special classes of truth operators which can be realised with a substantially lower estimate of their cost than that which was established for the class of all truth operators. The chief aim pursued here is not to obtain precise and final asymptotic estimates, but to survey certain typical situations in which simple methods of realisation can be achieved. 1. Given that some determinate operator transforms input words of length p of the form x ( l ) , x(2), ..., x ( p ) in the alphabet (0, l} into the output words z(l), 2(2), ..., z(p). For a fixed p one can state the problem of realising this transformation of information in a device which simultaneously detects a word x l , x2,..., xp on the input binary channels and realises a word z1,
...)zp.4
We thus arrive at the consideration of a truth operator (zl, ..., zp)= ..., x p ] , characterized by the fact that ziis not (essentially)a function
= O[x,,
1 S. V. Yablonskii, A family of classes of functions which permit simple generation by a circuit, UMN (1957) 12. M. A. Gavrilov, The theory of relay-contact circuits, Izd. AN SSSR, MoscowLeningrad 1950. G. N. Povarov, A new method of synthesizing symmetrical switching circuits, DAN USSR (1955) 2, pp. 115-117. 4 This is the case, for example, when a parallel adder is used instead of a serial adder.
306
pII.3
ASYMPTOTIC ESTIMATION
of the variables x i + l ,x i + 2 ,..., x,: z1
=Vl(XJ?
z2
= (P2(Xl?X2),
Z”
= 4op(X1,Xz,
. . . . . .
...J ”).
In this case it is natural to expect that a separate realisation of the component functions q l ,q2,..., qp results in a better estimate than (7.25). We shall demonstrate that this is in fact the case. Let n < p ; then each of the n functions q l ,..., q,,depends on not more than n variables, while each of the remaining I functions (where I = p - n ) : qn+ ..., qp depends on n 1, n +2, ..., p variables respectively. We set I= Ig p 2 , n = p - lg p2 and perform a separate realisation of the functions q l ,..., qp. Then when p-00 the realisation is effected with the following estimate:
+
and consequently :
and finally:
@.2”+1 L ( 0 ) < -* P
+ 0 (111
3
(7.26)
which is substantially better than the estimate in (7.25)1. I t is clear that the considerations advanced above do not concern the “parallel” realisation of a determinate operator, but refer in general to the case where, in an operator (zl,..., z,)=O[xl, ..., xm] (it is not obligatory that n=m), zidoes not depend on all variables x j , but only on a certain number of them, S ( i ) . According to what these numbers S ( i ) are, different simplified estimates of the type (7.26) can be obtained. 2. I n the previous section, no account was taken of the weight of the operator (or more precisely, the weight of the finite tree of height p). We propose that the weight in question should not exceed 2k, and consequently the operator can be described by the canonical equations : Z(t) = @
qj(t + l)=
[X(f),41(t),...,4k(t)],
vj[X(t),41(t),...,qk(t)].
(7.27)
The corresponding theorem of the lower estimate is also valid, hence the estimate (7.26) cannot be improved.
VII.31
307
A SIMPLE REALISATION
The transition from the serial circuit which realises the operator (7.27) (illustrated in Fig. 7.2) to the parallel circuit which realises the corresponding truth operator
(Ql7 1\
(9 = Q, (9Y4 4 ( t + 1) = q X ( t M t ) ] Y
(7.27')
Fig. 1.2
and the corresponding truth operator is described by conditions not containing the variable t : z, = @[X,, S l l , q z = y [ X i , 411 9
ZZ = Q,CXz9q213 q3
= ~ [ X ZqY 219
z3 1..
.
= @Cx3,q31Y
If we denote by C the cost of the circuit illustrated in Fig. 7.2 (not counting the delay element), the cost of the circuit in Fig. 7.3 will be C x p7 where C is a constant not depending on p. It may be said that the reduction in operating time by a factor of p involves a p-fold increase of the equipment.
308
wII.3
ASYMPTOTIC ESTIMATION
Thus the truth operators
('1,
z1 = 4 c.119 = '2
'2)
[Ix17
.21?
. . . . . . . . . . . (z1 z2
... zp>= 0, [Xl, x2, ..., .,I ,
and so on, corresponding to trees of height 1,2, ..., p, ... of a given operator with a finite weight are generated with an estimate of their cost which is linear with respect to p. Of course this is also true when the input and output letters of the initial operator are not merely 0 and 1 but groups of 1's and 0's.
EXAMPLES A. Required to determine an estimate of the cost of a logical net of the operator z= x + y which transforms the binary notations of p-digit numbers x, y into the least significant p digits of their sum (note that, when this operator is reatised, a shift operator is simultaneously realised). In solving this problem, we shall proceed from the fact that the binary digits of the sum (zl, z,, .... z,) and the shift (Sl,S,, ..., S,) are in the following recursive relation : z1 = x 1 0 s10 Y, z2 = x2 0 s, 0 Y,, 9
. . . . . . . . . . . . . . .
z , = x, 0s, 0 Y , s, = 0 , sz = x1 ( Y , v Sl) v YlSl, 9
. . . . . . . . . . . . . .
s, = X p - l ( Y , - l
v S,-J v Y,-l.S,-l.
These relations immediately disclose a linear estimate of the cost of the net for the operator in question, with a coefficient C<2(L, + L , + L v ) . In particular, for the operator z = x + 1, we have: zi = xi 0 Si,
S i + l= x i s i ,
S,
=1
(wherei
=
1,2, ...,p).
Consequently C < L , +La, and similarly with z=x-y. B. We shall now examine a parallel-acting circuit for comparing numbers. It is intended to realise the function z,,=fn(xl, .... x,,, yl, .... y,,), equal to 1, if and only if x < y is valid for the numbers x, y with the binary notations x,,x,,- ... x1 and y,,y,,- ... yl. Proceeding from the corresponding operator with memory z ( t )= Z(t)'Y(t) v [ Z ( t ) O Y ( t ) ] ' Z ( f - l),
VLI.31
309
A SIMPLE REALISATION
we have the recursive relation zi= X i ‘ yi
v [Xi0 yi3
‘Zi-
1
,
from which also follows a linear estimate with the coefficient: C < L , + 2 L , + L ” +L,.
C . We shall now turn to parallel-acting circuits for multiplication and division. By algorithms which are commonly known, the performance of these operations on a pair of p-digit binary numbers reduces to the p-fold iteration of the operations with a linear estimate of complexity (addition, subtraction, comparison, ...). This easily yields a quadratic estimate of the cost for multiplication and division. A cubic estimate for the operation 2 can be established in exactly the same way. We shall entirely omit the calculations here. We shall henceforth have recourse to the fact that a function in the algebra of logicf(x,, x2,..., x,, y,, yz, ..., y,), signifying “a number having the binary notation
3
310
vII.3
ASYMPTOTIC ESTIMATION
a better estimate is valid:
L(f) < e
number of all groups A"" S
L-1+
4)l-
Henceforth lxtr ..., xI, denotes the number with the binarynotation x1 ... x ., In classes K,, K,, K , on inessential sequences, the functions are equal to zero. The class Ka of functions f ( x , , ..., x,). A" consists of the A sequences (2"'<<<2'), for which Ixl ... x,l
xm+'
The class K , of functions f ( x , , ..., ,x, q t , ..., 4'). consists of the 2 " x A sequences x1 ... x, q1 ... qr, for which lqt ... qrl
2"l. L ( f ) < -[l m+k
+ o(l)]
with
f E K ~ , m + &+
00.
The class K,, of functions f ( x l , ..., x ,, q l , ..., qr). I,+' consists of the (2,-1)A sequences xt ... x,qt ... qr, for which lql ... qEl
m+k"-+co.
The classes K,', K,. differ from Ks, K , only in the method by which they are further defined on inessential sequences. In fact, we select a sequence 'sl ... zk such that 17, ... 71 ' A and into the same sequence q1 _..qr in other cases. Obviously, L ( f ' ) < L ( J ' ) + L ( d ) ;at the same time, the summand L(0) is majored by the linear function (see the comparison circuit) and it can be neglected. We shall now undertake the synthesis and estimate for K,; there is no difficulty in transferring these results to K , and K,, and it will not be discussed here.
-1.31
311
A SIMPLE REALISAllON
Let A7=1' x 2' be the lowest number, being a multiple of 2' which itself is not less than 1. We then havel: 2s- 1 Q 1 Q 1, = 1'.2' Q 2". We set p = s - v ; now A'Q2". The function f can be represented in the form:
, x,+')=O with lo1 ... o,l 21'. From this represince f (ol,..., o,, x , + ~..., sentation, it is clear that L ( f ) < CL[f(%
...,fl,lr,X,+l,
...,XIC+J]+ LP,) + A'@&
+ L"),
where D, is a universal decoder which is a function of the variables xl,...,x,, and consequently (see (7.12))L(D,)=O(2') with p+m. If we set p = 3 lgs, v=s-3 Igs and take into account that, when s+co, 1' x 2' = A v I, then we easily obtain: N
4. Let Q be the set of all 2a;sequences of length k of zeros and ones, and let Q' c Q be a subset of it consisting of A sequences. Let us examine the mapping T of the set containing 2" x 1 sequences of length m +k" (essential sequences) x1 ... x, q1 ... qa;, for which (ql ... qE)E Q', into the set of sequences (4; ... 4); E Q'. For an arbitrary truth operator 8 qS(t) = yj(xl(f),
.--7xm(t),ql(t),
...,qn(t))
(where j = 1,2, ..., l),coinciding with T on essential sequences, realisation can be guaranteed only with the estimate (when m +k+ co) : ?m+X
L(8) < QR"-
m+k"
[l + 0(1)].
In this connection, we shall examine a special class of operators (class &), whose behaviour on inessential sequences is characterized by the condition described below. 1
It is henceforth assumed that v
< s.
312
ASYMPTOTIC ESTIMATION
mI.3
A sequence z1 ... zi, exists in the set Q' such that, for any sequence q1 ... qk not contained in Q', it is true that (which means that all such sequences are indistinguishable from z1 ... zk). We shall now indicate a method of synthesis for operators 0 of class Kb which guarantees the estimate : (7.28) with m+E+co, 2"<1gm. (The fact that (7.28) is better than (*) can be tested simply for the case: m+ co,k = 2,A = 3. In this case (7.28) is better even than the result which could be obtained by the method referred to previously, if the functions !Pj belonged to the class KBt.) Choice of parameters. We will divide the set of variables x1 ... x, into two subsets: xl, ..., x, andx,., ... x,. Howeverwefixx,+,=o,+,, ...,x,=o, the operator 8 induces the operator Oun+ which maps the sequences x1 .._x, q1 ... qi, into the sequences q; ... q; of Q'. Taking (**) into account, it is easy to see that the number of diflerent operators 8u,+l.,,bm (we will denote it p) is not greater than A'? ,' whereas the number of methods of fixing the sequence x, , ... x, equals 2"-". Under our conditions (i.e. when A
Y/i"(x,,..., xn,ql ,..., qk), where j = 1 7 2 , . . . , k 7 describing 8,; b) a function V,(x,+ ..., xm),equal to 1 only on those sequence c,+ .cm, for which durn+ coincides with 8,. It is then obvious that the function Y j ( j = 1,2, ..., k), which specifies the operator 8 permits the representation: yj(x1,*..,xn,xz+1).-.,xrn,41,**.74i;) =
v vv(x,+l, P
=
v= 1
...,xm).y~(xl,...7Xn,q1, . . . , q k ) .
VII.31
313
A SIMPLE REALJSATION
In accordance with this representation, the logical net is constructed from the following blocks (see Fig. 7.4). Block H,. This block realises an operator which transforms any of the sequences on+ ... nminto the binary notation u1 ... ulgPof a number v(v < p )
ri .....
......
.....
v;
Y ;
~v,
F VP
associated with the operator OUn+ functions in m--R variables
......
%
With separate realisation of the Igp 2"-
Wl)< kp-e-. 112 - 7l
c1 + 4111 *
Block H,. To realise the functions V,(X,+~, .... xm), we have yet to construct a universal decoder with input variables u,, .... ulgpand outputs V,, .... V,, .... V,. This is also block H,, for which (see (7.12)):
JwL< ) eYJ-P+ O ( l ) l * Block U. This block realises all the 2'-'* functions in the variables xl, .... xn,q,, .... qn (including the functions Y J ) therefore ; L(U) < @.22"+E.2Z+E Block F. This block realises the functions Y j , proceeding from the functions V,, realisedby block H,, and from the functions YyY realised by block U; F is composed of k x p &cells and as many V -cells. Thus:
L(F) = k p [ L ,
+L,].
314
[VII.3
ASYMPTOTIC ESTIMATION
Now, as indicated above, let:
meaning that: (m-n)-m-(m +&). Then it can be easily verified that:
L(H,) < ~;1*2"*lg 2
2"-
m--71 ~
while
[l
+ ~ ( l ) =] e lg A-
2"-1 m
[l
+ ~(l)],
Since, under our conditions, m +lg I-m, this proves (7.28). We should note further that both (7.28) and the estimates established with respect to the classes K,, K,, K,, Kpj and K,. cannot be improved. This follows from an appropriate modification of the theorem of the lower bound, which - as with the proof of the theorem itself - we shall not enlarge upon. 5. A comparatively simple realisation of arithmetic operations by a circuit may serve as a basis for obtaining simple realisations of operators which, owing to their peculiar properties, can be described (if only partially) in terms of arithmetical operations and relations. We shall illustrate this by the example of monotonic operators. DEFINITION. A truth operator (z,, ..., z,) = 0 [xi,_.., x.] is termed monotonic if the numerical function z=p(x)1 which it induces is monotonic (not necessarily strictly monotonic). The method of synthesis which takes account of the monotonicity of the operator (in order to be definite, we shall consider a monotonically increasing operator) will be discussed for the case when m = n = k . We will denote by b - ' ( v ) the lowest value of the variable x for which p ( x ) 3 v. We shall give v in binary notation. Table VII.2 specifies a monotonically-increasing operator (the decimal notation is also given for the argument x). In the present instance /?- (1000) =7, for, beginning at x = 7 , p(x) becomes greater than or equal to (1000); p - ( 1 100)= 10. For the component zk (the most-significant place of the number z), the obvious relation zk = [x 3 8- (10.. .o)] holds true.
'
1
If we interpret (ZI,
...,z,)
and (XI, ..., x,) as binary notations of the numbers z, x .
VII.31
315
A SIMPLE REALISATTON
~____
0 0 0
0 0
0
0
1
3 4 5 6
0 0
0 1
0
0
0
1
01
01
I
0
0
:I
1
0
1 0
1
1 1
1
1
1
8 9
0 0
0 0
0
10
1 1 1 1
0 0
0
1 1
1 1 0 0
0
1 1
1 1
0
11
12 13
15
1
1 1
0 0
1 1 1
0 0 1
1 1 1 1
0 0 0 0
1 1 1 1
1 1 1
0 0 0
0 0 0
0 0 1
1 1 1
1 1 1 1
0 0
0 0
0 0 0 0
1 1
1 1
1 1
0 0 0
0
1 : 1
1
0
Similarly, for components .+I, Zk-,, ... we obtain:
[p-'(olo ... 0) < x < fi-y100 ...0) v [fi-'(llO Zk-2=[fi-1(0010...0) < x
... 0) < X I ,
1I
(7.29)
Returning to our example, we note that, for the operator specified by Table VII.2, we shall have: z4 = [7 <
XI,
z3 = [3
< x < 71 V [lo < XI.
Let us suppose that we have expressed in this manner the j most-significant digits of the number z. On the right-hand sides of the respective defining equations will figure: a) functions of the form x 2 p - ' ( v ) and their negations of the form
316
wII.3
ASYMPTOTIC ESTIMATION
x
1 + 2 + 22 + ... + 2j-1
= 2j
- 1 < 2j;
b) disjunctions, whose total number < I + 2 + . . . +2j-’<2j; c) conjunctions, whose total number is also <2’. Proceeding from this, the estimate of the joint realisation of t h e j mostsignificant components, in conformity with (7.29) (remembering that the comparisons x > p- (v) are realised with a linear estimate < C Sk), will have the following form: cj < 2 q C . k + L , + L” + L , ) . For the remaining m - j places separate realisation by Lupanov’s method can be used, with an estimate (when k-j-tco) 2k
EL-j
= L(0) of
(7.30)
7
while for operators 0 E a k , k , o , it is only possible to guarantee in general that
-
L(O)
k2k k
Q -=
e 2k
(see (7.25”)).
REMARK. I n obtaining an estimate for the cost of a monotonic operator, the property of monotonicity was not exploited to the full. This is clear from the mere fact that the expressions for z4 and z3, which were found with respect to the operator specified by Table VII.2, also remain valid if, without changing the column xl, x2, x3 and x4 into that for zl, z2, z3 and z4, we arbitrarily interchange the rows between two adjacent horizontal lines (thereby violating the monotonicjty). The class of operators which permit a representation in the form of (7.29) for t h e j most-significant digits is wider than the class of monotonic operators, and for this class of operators, the estimate (7.30) cannot be improved. As regards monotonic operators, a synthesis with a better estimate appears to be possiblel.
+
0. B. Lupanov has recently obtained a better estimate: L ( 0 ) < 2p(2”/k) [l o (l)]; see 0. B. Lupanov, On the principle of local coding and the realisation of functions of certain classes by circuits of functional elements, DAN SSSR (1961) 140, no. 2.
VII.41
CHOICE OF A CODE
317
VII.4. Choice of a code 1. The estimates established in the foregoing sections refer to the case when the input and output alphabets are in binary code. When the choice of code groups for input and output letters is not predetermined by the conditions of the problem, it is natural to hope for a simplification of the circuit by means of a successful choice of code groups. In practice, this circumstance is always taken into account. For example, in arithmetic devices operating in the decimal system, certain simplifications in design can be achieved by an appropriate choice of 4-digit binary code groups (termed tetrads) for the numbers 0, 1, 2, ..., 9 (which serve simultaneously as input and output letters). In this section, we shall examine in greater detail the situation which arises in generalizing the problem of the choice of tetrads, and we shall discover some possible means of simplifying the circuits by the appropriate coding. Suppose that a truth operator 8 has one alphabet A , consisting of a set of K letters, and that this alphabet is both the input and output alphabet. The operator 8 specifies a unique mapping of the set of letters of operator A into itself (that is, into a part of A ) or on to itself (that is, on to all the letters of A ) . If 2k-
+
L ( 8 ) < @.2k[1 0(1)].
(7.31)
The question now arises: can the estimate be substantially improved by a choice of code groups which takes account of the specific properties of a given operator? A positive answer to this question follows from the coding methods to be described below; henceforth we shall confine ourselves to examining the case when K is a power of two: K = 2 k . 2. We will specify a truth operator (a mapping) 6 by means of an oriented graph as follows. Suppose that the letters of an alphabet A are mapped by the points (nodes) of the graph, while the arrows joining them indicate for each point the point into which it is mapped.
EXAMPLES. Corresponding to the mappings specified by Tables VII.3 and V11.4 are the oriented graphs illustrated in Figs. 7.5a and b respectively. The first is a one-to-one mapping of the set A on to itself, and its graph therefore breaks down into separate cycles; in the present case we have one
318
wII.4
ASYMPTOTIC ESTIMATION
TABLE VII. 3 Input
output
II
i
Input
output
i
1
j
i
k
0
P k I m n
P
0
I In
n
TABLE VII. 4 Input
output
Input
output
i
I
j
k
rn b
I
I
IIZ
0
n 0
m P
P
0
cycle each of length 6, 5 and 3 and two single-element cycles (of length I). The second is not a one-to-one mapping, and its graph therefore consists of cycles, some of whose nodes axe connected to the roots of oriented trees (the boughs in the tree are oriented towards the root); for example, the cycle of length 3 is joined to two trees (at nodes b and k). To the nodes of the oriented graphs thus obtained we ascribe ranks as follows: 1 ) the nodes lying on cycles are assigned zero rank; 2) every node from which an arrow issues, leading to a node of rank i (only one arrow issues from each node) is assigned the rank i + 1. In other words, the rank of a node indicates the length of the oriented path leading from a given node to a node of a cycle. For example, in Fig. 7.5b
VII.41
CHOICE OF A CODE
319
node e has the highest rank, equal to 3. The ranks of nodesf, i, p are respectively 2, 1 , O . Obviously the coding of the alphabet A is equivalent to establishing the numeration of the nodes of the corresponding graph; here the binary notations of these numbers are also the codes of the letters. We shall describe
(b)
Fig. 1.5
below a method of numbering the nodes in which the induced mapping of the numbers will be described by arithmetic operations and a monotonic operator; in accordance with the results of the foregoing section, the realisation by means of a circuit will thereby undergo a certain simplification. 3 . The numbering of nodes. Given Kinodes of the i-th rank in the graph
320
ASYMPTOTIC ESTIMATION
wII.4
(where i=O, 1, ..., S ) . To the rank zero nodes we assign the numbers 0, 1, 2, ..., K O - I ; to the nodes of rank one we assign the numbers KO, KO+ 1, ..., K , + K , - I , and so on. The numbers are distributed among nodes of a given fixed rank as follows. 1) The first nodes to be considered are those of zero rank (that is, those lying on cycles). Cycles are arranged in increasing order of length. Any node is selected in the first of them, to which the number 0 is assigned; the arrow then indicates the node to which the number I is to be assigned, and so on until numbers have been assigned to all the nodes. Next, a node is selected in the following cycle, to which is assigned the lowest of the numbers not yet occupied, and so on. 2) Suppose that the numbers 0, 1, 2, ..., Ko+K, +... +Ki-1 have ready been assigned to nodes of rank i and less than i. Then the numbers K,+K,+ ...+Ki,K o+K l+ ...+K i + l , ..., K o + K 1 + . . . + K i + K i + l - l are assigned to the Ki+ nodes of rank i + 1; in so doing, the following requirement is observed: if the arrows issuing from nodes a, b (of rank i+ 1) lead to nodes a', 6' (of rank i) such that the number a' is less than the number b', then the number a is less than the number b. The numbers of nodes established by the above rule are entered in brackets in Fig. 7.5. 4. We shall now note the properties of the (mapping) operator 8 as they follow from the numbering system adopted. a) The operator 8 generates a monotonically-increasing mapping of the numbers KO,KO+ I , ..., K - I assigned to nodes of non-zero rank, into the set of all numbers. We shall denote by 0, the mapping which coincides with 8 on the set of numbers > K O and converts all the numbers less than KO to zero. It is obvious that 8, is a monotonic mapping determined on the set of all numbers 0, 1, ..., K - I . b) Suppose that all the cycles of the mapping in question include exactly v cycles whose lengths are mutually distinguishable; we denote these lengths I,, I,, ..., 1,. Then there exists an increasing sequence of numbers: 0 = 6 o , G 1 , ..., Dv-1 , G ,
= KO
such that the numbers x of nodes of all cycles of length li, and they alone, satisfy the inequality < x< di. Proceeding from this, the one-to-one mapping of the section of the number series 0, 1, 2, ...,KO- 1 on itself, performed by 8, can be characterized in the following manner.
VI1.41
321
CHOICE OF A CODE
Given that ui-l < x < a i . Then: 1) if x is one of the numbers ci-l +Zi-ly +2Zi- 1, ...)ciPlthat is, if ( X - G ~ - +1) ~ i Z i , l then T ( x ) = x - ( Z i - l ) ; 2 ) otherwise T ( x )=x + 1. In Fig. 7.6 this situation is illustrated for ci- = 5, Ii=3, oi=26, where 8(l0)=Sy8(24)=25 etc. The properties of the mapping 8 to which have referred suggest the following method of synthesis. 5. The synthesis and estimate. The circuit which realises the operator z=O(x) consists of the major blocks A, ByC described below (see Fig. 7.7). C T ~ - ~
Fig. 7.6
Y A
1
I
Fig. 7.7
BLOCKA. For any group x l x z ... x,, forming the code (number) of one of the K = 2 k letters of the alphabet, the use of 8 is reduced to one of the following operations :
1) subtraction of Zi- 1 (i= 1, 2, ..., v); 2) the addition of unity; 3) the use of the monotonic operator 8,. Which of these operations should actually be applied is “disclosed” by block A; this “disclosure” is produced by generating the functions in the 1
a i b indicates that a is exactly divisible by b.
322
wII.4
ASYMPTOTIC ESTIMATION
algebra of logic:
(where i
q i ( x l , . --, xk)
=
1,2, ..., v),
S(x1, ...,xk), t(x17
.*.yXk)
(which we shall denote for short by (pi(x),S(x), t ( x ) ) ; here: (pi(.)
= [ai-,
< x
&[(x - CT-1
S(X)= [x < av & qi(x)]
+ 1): 41,
3
i$v
t ( x ) = [av
< XI.
For this purpose, the first to be generated are v comparisons o i < x and w tests of divisibility by li, and then 4 v &-cells and 2v 1-cells (including v 1-cells to form comparisons x 3 ai in terms of ai >x) the functions (pi,t , S are generated. Taking into account the linear estimate for the cost of the comparison and the quadratic estimate for that of testing divisibility, we obtain L(A) < v-[C,k C2k2 4L, 2L,].
+
+
+
+
BLOCKB. This block realises the operators: Fi(x)= [x-Zi 11, where i= 1,2, ..., v ; O,(x) and x + l . Taking into account the linear estimate for subtraction and addition, and also the estimate for the monotonic operator
O,, we have (when k-+co) the following estimate: L(B) < v.C,k
2k Ig k + C , k + 2~-[l +~(l)]. k
BLOCK C. This block realises the operator 8, proceeding from functions in the algebra of logic and from the operators realised in blocks A and B, and consists of v +2 k-term conjunctions and as many k-term disjunctions. Consequently: L,]. L(C) = (V 2)*k[L,
+
+
+
Obviously, when k-+ GO, in estimating the value of L(8) equal to L ( A ) L(B) + L(C), all the summands can beignored, except C2vk2and 2 ~ 2 ~ (k)/ l g k. We shall examine the first of them. Clearly, the highest possible value of the number v of cycles of different Length is obtained if one considers that there is one cycle each of length 1, one each of length 2 and so on; meanwhile the sum of the lengths of the cycles does not exceed 2k (the number of all the letters in the alphabet). Consequently,
1 + 2 + 3 + ... + V = +(l + V ) V
< 2k,
SYNTHESIS OF NETS H A V I N G A MEMORY
VI1.51
from which it follows that
323
< 23(k'1)
Finally we obtain:
It is plain from this that, if the mapping 8 is one-to-one (all nodes are of zero rank), then L(8) < C k 2 * 2 f ( k + 1 ) . (7.32) In the general case we have (7.33) These estimates are in fact better than (7.31), which can be guaranteed for any arbitrary coding method. VII.5. Synthesis of nets having a memory In this section we shall be describing a method of synthesis for operators 8 of the class 8m,n,k,leading to the upper bound p log N,,,,n,k/loglog Nm,n,k, quoted in Section 1. We shall begin with one remark concerning the method of coding the letters in the alphabets of the operators in question. Codes for the input and output letters of the net which is being synthesized are usually specified beforehand: the former are adapted to the source from which information enters the net, and the latter to the receiver of the information emitted by the net. As regards the codes of states, they are intended to represent the information circulating in the system itself, and their choice may be subordinated in particular to considerations of simplifying the net. We will suppose that the input and output letters of a given operator are coded respectively by the sequences (xl, x2, ..., x,,,) and (zl, z2, ..., zn). We shall further suppose that the letters of states are coded in some manner (at present arbitrary) by the groups qlqz ... qa, where k is the least natural number such that the weight of the operator is not greater than 2'. The canonical equations of the operator are in the form : z i ( t ) = ~ i ( x ~ ( t,...,x ) ~(~),4~(t),...,~E(t)),~
qj(t
+ 1) = ~ j ( x 1 ( t ) , . . . , x m ( t ) , q l ( t ) ..-,q~(t)),j ,
-
(7.34)
where i= 1 , 2 , ..., n ; j = 1, 2, ..., k . We shall now estimate the cost L of the net obtained by separate realisation,
324
WII.5
ASYMPTOTIC ESTIMATION
+
+
using Lupanov's method, of the n k" functions in rn f variables each, subsequently forming feedback loops through the f delay elements (one delay element will be said to cost Ld). Obviously, when rn + k"+ 00, and ignoring LLd,we have:
(7.35) We now assume the following conditions to be satisfied: 1) the weight of the operator is a power of two, and therefore exactly equal to 2'; 2) m+cc (this condition is stronger than rn +k+00). Under these conditions k=k", (2"- 1 ) ~ 2 "and therefore a comparison with the theorem of the lower bound demonstrates that the estimate (7.35) cannot be improved and we have asymptotically:
In this case, separate generation of the functions Qi, !Pias represented in (7.34) yields for almost all operators the nets which generate them, with an asymptotically minimum possible cost. However, should even one of the conditions 1) and 2) be violated, a lacuna is produced between the upper and lower bounds. This suggests that the method of synthesis can be improved by introducing some additional principles concerning the method by which the alphabet of states is coded. We shall now proceed to examine one such method of synthesis. Consider an operator 8, whose weight 1 may perhaps not be a power of two: 2'-
...?
4n-1
-
Assume that the canonical equations of the operator have the form:
VIIS]
SYNTHESIS OF NETS HAVING A MEMORY
325
by adding p letters (where p = 2'- A) qn,qA+1, ..., q2n- 1, which specify states not distinguishable from a state qr, defined as follows. We consider the mapping Y(0, ..., 0, q ) of the set Q' into itself and the numbering of the nodes of the corresponding oriented graph (refer to Sec. 4). The state represented by the node with the highest number is taken as qz. We shall ensure the indistinguishability of the associated states qn, ..., q2fi-1 by further defining the functions Qi and Y as follows: Qi(X1,
..., X m , 4 j )
= Qi(X1,
y ( x i , - . - , x m , q j ) = YJ (
..., X m , 4 J , )
~ 1 ,
-.a>
xm,
4,)
7
(7.36)
5
wherej=A,A+l, ..., 2'--1. In accordance with the procedure described in Sec. 4, we now assign, to the 2Eletters of Q, codes of length k" such that: (I) the mapping Y(0,...,0,q ) of the set Q into itself can be realised by a logical net at a cost 0(2' (Ig i ) / k ) ; (11) the code (number) of each letter qj ( j 2 1) is the binary notation of the numberj. (Conventionally, (11) is ensured by the fact that the letters qn, qnfl, ..., like q,, are represented in the oriented graph as the nodes of maximum rank.) We shall demonstrate that, by this method of coding the states, operator 8, which now has cononical equations of the form zi(t) = Qji(xl(t), **.,xrn(t),41 (t),
4j(t
qe(t)) ) 9
+ 1) = Y j ( x l ( t ) ,..., X . r n ( t ) , q l ( t ) , . . . , q E ( t ) ) , )
(7.37)
is realised at a cost
The logical net which realises 0 consists of a block which realises the system of functions ( @ J i G n , a block which realises the system {!PjIj6',and of k" delay elements; consequently:
q e )<
+ L { Y ~ ]+~&. , ~
(7.38')
We shall now examine separately each of the constituent parts: A. For each of the functions Q i ( i = 1,2, ..., n), by (7.36) and using the adopted coding method, it is valid for a fixed group (zl ... T ~ that: ) Qi(x1, -*.,Xm,41,
if lql ... qEl
. . . , 4 ~= ) Qi(X1,
...,Xm,tl,
..*PA),
326
ASYMPTOTIC ESTIMATION
yvII.5
Thus, the function Qibelongs to the class Kfl,Consequently, (see p. 310):
since m+R-m+k. B. In generating the system { Y j } j swe~ shall consider two constructions, depending on whether (when in +k+co) 2E> lg m or 2n
Since ( 2 " - 1 ) ~ 2when ~ m-ico, then (7.38) is derived from (7.39) and and that the summands ELd can be ignored in (7.38'). B,. Finally, we shall consider the case when 2' 2 lg m, and consequently, when m+k"+co, it is the case that 2'+ca and A+w. Let Y;(x,, ..., x,, q l , ..., qE)equal 0 when x 1 = x 2 = ...=x,=O, and coincide with Yj(xl, ..., x, q,, ..., qn) in other cases. Then whenj= 1, 2, ..., k, we have :
(7.40), taking into account that m+k=(m+lg A))-(m+k)
Yj(X,,
... x,, 41, ..., qn) = 2-,TT., ... fmYj(O,...,o,q1, ..., qr) v )
v ! q X 1 , . . . , X , , q l , ..., a).
It directly follows from this representation that: L { Y j } j < nG L{YIJI}j
+
L{YIJI}j
c
j
< Re.
(2" - 1)n
in + R
Since 2 4 co, then k k (in particular, g+ with (I) (p. 325) when k"+co, we have: N
00).
"1
+
+
+ 0(1)].
Meanwhile, in accordance
VII.51
SYNTHESIS OF NETS HAVING A MEMORY
327
Therefore this summand is o(kp(2"- 1) A/(m+E)), and it can be ignored. Thus (2* - 1 ) A (7.41) .[1 0(1)]. L{!Pj}jQli < m+R f e e -
As already indicated, k(7.41).
+
k. Therefore (7.38) again follows from (7.39) and
We would make one further remark. Given that 8 ' 3 8 means: for any state of the operator 8 there exists a state of 8' which is indistinguishable from it (the converse, generally speaking, is not necessarily true). The logical net which realises 8' also realises 8 in some sense. However, when the condition for realisation is weakened in this manner, in general no improvement of the upper bound is obtained.