Three-Valued Digital Systems
Total Page:16
File Type:pdf, Size:1020Kb
Three-valued digital systems D. I. Porat, M.Sc, Ph.D. Abstract A survey is presented of the developments in algebras and techniques for the realisation of 3-valued switching functions. Digital arithmetic, ternary codes, composition algebras, minimisation, circuits and sequential circuit design are discussed. The feasibility of 3-valued digital systems is demonstrated. 1 Introduction n N = 3 2 + 2 3'(>'l-)2 N negative . (3b) Digital equipment design is based on the binary- i=—m number system because of the availability, low cost and reliability of binary switching and storage elements. Higher The complement of 2 of a ternary number, radix systems are implemented by use of binary coding; how- # = 3" - N - 3~m (4) ever, at least one ternary computer1 has been in operation 2 which incorporates 3-valued elements. Similarly, the complement of 2, A system which is based on a radix higher than 2 and built = 3" - N = + 3 (5) from multivalued elements offers the advantages of: (a) higher speed of serial and someserial-parallel arithmetical operations complementation of 2 is easily implemented through ternary because of the smaller number of digits required for a given inversion: 0<->2, l-e>l, while complementation of 3 is accuracy (it is assumed that ternary-logic elements can operate derived from the interrelation of #3 and N2, eqn. 5. at a speed approaching that of the corresponding binary-logic The rules for shifting (on multiplication or division) are • elements) (b) better utilisation of transmission channels be- analogous to the corresponding rules for binary or b.c.d. cause of the higher information content carried by each line2 arithmetic. (c) more efficient error detection and correction codes3 (d) The above conventions facilitated developing algorithms potentially higher density of information storage. for arithmetic operations. Rules were established governing addition, subtraction, multiplication and division in the three A set of n nodes of a Arvalued gate network can assume k" 4 states. Fewer terminals are thus required in a multivalued representations of ternary numbers. The availability of three system to represent a given number of states, as compared choices at each step in the algorithm was sometimes found to with binary systems. Circuits for operators and compositions simplify such algorithms. of A:-valued algebras are more complex than those required to realise 2-valued switching functions. Integrated circuits are capable of performing complex functions economically, while Ternary codes the number of their terminals is rather limited. It appears reasonable to investigate properties of 3-valued systems as a 3.1 Ternary-coded decimal t.c.d. first step towards exploration, of problems involved in the A minimum of three ternary digits is required to code ten decimal digits. The 33 possible states of three variables in design of multivalued systems. 12 This paper surveys developments in the ternary field and a 3-valued system result in 27!/(27 — 10)! ~ 3-1 x 10 also includes material not published elsewhere before.4 t.c.d. codes. Not all of these codes are fundamentally different. Some exhibit useful properties for coded arithmetic, encoding techniques, error detection, minimum power consumption, etc. 2 Ternary digital arithmetic The consistently weighted 9-3-1 code is shown in Table 1. Algorithms were established4 for arithmetic operations A decimal digit X is given by the sum of the weights, each in three representations: multiplied by its corresponding ternary coefficient Xj l (a) In signed magnitude X = 3 x2 + 3°xl The additive property of this code is useful for t.c.d. arith- N = 3"yn +"S 3«>#- (1) / = — m metic, since the sum of the representation of two digits equals the representation of their sum, except when 'carries' are where yn = 0 for positive, and 2 for negative numbers. present. The ternary number N has (m + n) digits, since / ranges from — m to — 1, and from 0 to (n — 1). Also 0 < y-, < 2. Table 1 (b) In signed complement of —3 9-3-1-CODE 9 3 I = 3"0 N positive . (2a) XI *i m 0 0 0 0 N = 3"2 + 2 3''(j/;)2 + 3~ N negative . (2b) 1 0 0 1 i=—m 2 0 0 2 3 0 1 0 where (j>;)2 symbolises the 2's complement of the ternary 4 0 1 1 digit y,. 5 0 1 2 6 0 2 0 (c) In signed complement —2 7 0 2 1 8 0 2 2 N=3n0 + 2 3^,- TV positive . (3a) 9 1 0 0 Paper 5838 E, first received 17th September 1968 and in revised form A number of conditions have to be fulfilled for constructing 2nd January 1969 t.c.d. codes, and designating the least-significant weight by Dr. Porat was formerly with the Department of Electrical En- ' gineering & Electronics, University of Manchester Institute of Science & iv,, the next w2, and the most significant iv3: Technology, Manchester 1, England, and is now with Stanford Univer- sity, PO Box 4349, Stanford; Calif., USA (a) 9/2 PROC. IEE, Vol. 116, No. 6, JUNE 1969 947 (b) one weight must be 1, irrespective whether the weights Subtraction involves a ternary inversion of all digits followed are all positive or whether negative weights are included by addition (b) results from arithmetic operations are obtained (c) (w, + M>2)2> (w3 — 1), to ensure that all successive with proper sign and magnitude (c) the sign of a number is numbers can be represented by the code easily determined by sensing the sign of each digit, starting id) to enable 10's complementation, 2w,- = 10/2 y •/•-'. (e) for 9 complementation, the sum must equal 9/2. with the most significant, since 3 > ]£ 3' (d) the ternary- o Table 2 shows all the possible positive integral weights for coded decimal includes numbers —9—h9, utilising 19 out of the ternary coding of decimal digits. 27 (70%) possible states. The corresponding percentage utilisations for the ternary 9—3—1 code employing positive Table 2 coefficients only and the binary 8-4-2-1 code are 37 and T.C.D. CODES WITH POSITIVE INTEGRAL WEIGHTS 62 • 5 %, respectively (e) the correction algorithm for decimal addition and subtraction is simple. w2 HI H-2 H Truth tables for sum, carry and product modulo 3 are shown in Table 5. 3 1 10s complementing 7 2 4 1 3 3 Table 4 Table 5 5 1 4 3 2 2 10s complementing 5 3 9-3-1 CODE WITH POSITIVE TRUTH TABLES 3 2 6 3 AND NEGATIVE LEVELS 4 2 7 3 X\ 5 2 8 3 9 3 1 6 2 'natural' 9 3 Sum mod 3 -1 0 + 1 -9 _ 1 0 0 -8 — 0 . + 1 -1 0 To obtain codes which are capable of complementation in -7 — — x2\ 0 -1 0 + 1 the diminished-radix representation, one has to introduce half- -6 — () . 1 + 1 0 +1 -1 integer weights [see condition (e), above]. Codes with weights -5 — 2-2—J- and 2-J-l-l are 9 complementing. -4 0 - — -3 0 - (3 Carry mod 3 -1 0 + 1 Another way of looking at such codes is to consider the -2 0 - weight as being integral, but for a binary, rather than a -I 0 0 - -1 -1 0 0 ternary variable. For example, the weight of the l.s.d. in the 0 0 0 () 0 0 0 0 2-2—J- code is made T, and the truth values in the respective + 1 0 0 0 0 + 1 +2 0 — + 1 column are thus 0 or 1. A coded decimal realisation employ- + 3 0 () ing mixed elements (binary and ternary) could be more +4 0 Product mod 3 -1 0 + 1 economical than either b.c.d. or t.c.d. Consider the weights + 5 — — — () 3,-2h-\b, where the subscripts indicate the radix used; / for + 6 ternary and b for binary. This and the 9 -3,-l, code offer the + 7 — -1 + 1 0 -1 A + 8 0 - 0 0 0 0 advantage of decimal coding with three digits only and in- +9 0 () -1 0 + 1 formation storing, by use of ternary with the less expensive + 1 binary-memory elements. As in all b.c.d. or t.c.d. codes, corrections have to be applied in arithmetic operations whenever a 'carry' or a 'borrow' 3.2 Mixed-radix 'excess' codes occurs, or when the weights do not represent a geometric Codes analogous to the b.c.d. excess-3 code can be progression. When the digits representing the sum (difference) generated by use of mixed radixes. They exhibit some desirable of a 9-3-1 coded t.c.d. are in the same decade as the digits properties, such as simple correction algorithms for arith- of the augend and addend (minuend and subtrahend), no metic, inexpensive hardware realisation, and 9 complementa- correction is required, since a 'carry' ('borrow') from one tion (ternary elements undergo 2 complementation and ternary digit to the next finds the conditions 3'I3'~] = 3. For binary elements 1 complementation). One example is the excess-4 code derived from the 96-3,-l, t.c.d. code. X + Y = Z> 10I0, (122)3 = (17),0 has to be added to the uncorrected sum in order to obtain the correct Z. For 5 < 1010 (no overflow) subtract (011)3; for 5"> 1010 The sum of two ternary-coded decimals in the 9-3-1 code (overflow) add (011)3. does not generate a 'carry', showing an advantage over all The excess-1 code is derived from the 4,-2^-1 b t.c.d.