Method and apparatus for implementing a type 8B6T encoder and decoder
BACKGROUND OF THE INVENTION 
     The invention relates generally to electric signal and data processing and more particularly to a new and improved means for encoding a binary data word as a ternary code word and for decoding the ternary code word to recapture the binary data word for data transmission in a high speed network. The invention includes circuits for encoding and decoding the ternary code word and for maintaining DC balance in a series of transmitted ternary code words. 
     Binary (two-level) to ternary (three-level) data conversion has long been recognized as being beneficial for placement of data on an electromagnetic channel. Such a channel may be a storage medium such as a disk dive or magnetic tape or may be a transmission medium, such as an electric transmission line (twisted-pair). The three voltage levels (positive, negative, and zero, sometimes represented as the digits +, -, and 0) of ternary signals can provide a number of advantages over binary signals in data transmission and storage. One advantage is that ternary coding inherently carries more data per bit than binary data. For example, six binary bits can represent only 26 or 64 different values, whereas six ternary bits (or trits) can represent 3 6  or 729 different values. This increased data carrying capacity can be effectively used to increase the speed of data transmission and the density of data storage. 
     The three levels of ternary data can also provide a way for eliminating the problem of an accumulated DC signal that can arise in binary data signals. A DC signal may arise in the transmission of a binary signal because the voltage on the signal line varies between a positive voltage level (such as +5) and 0 volts. During transmission of such a signal, the signal line will take on a overall positive charge, and this can increase sensitivity to signal distortion by noise or cross-talk interference. Ternary signals can eliminate this problem so long as the transmitted + and - voltage signals are in balance with each other. In order to effectively maintain DC balance, prior art ternary encoders include sometimes complex adder circuitry to keep a running total of the charge of transmitted ternary digits and have included an inverter circuit to invert selected transmitted ternary words when the accumulated DC voltage level diverges from zero. Some of these prior art encoders include additional information in the transmitted data to indicate when a word has been inverted. 
     Ternary signals can also be designed to incorporate a guaranteed number of voltage transitions on the media during a specified period of time. These guaranteed voltage transitions can be used to maintain data self-clocking and error checking. Some prior art ternary encoder circuits include a &#34;repeat code&#34; or other means to ensure periodic voltage transitions by preventing transmission of long strings of identical digits. 
     A number of binary-to-ternary encoders and decoders have been developed incorporating the above discussed principles, but thus far these circuits have been limited in the size of the binary word that is converted to a ternary code. Various methods and apparatus have been disclosed for translation of 2 binary bits to 1 ternary trit (2B1T), 3 binary bits to 2 ternary trits (3B2T), and 6 binary bits to 4 ternary trit (6B4T). Each of these translation methods claims specific advantages based on the translation used and each is designed for a particular application. 
     For example, U.S. Pat. No. 4,910,750, to Fisher, discloses a 3B2T code with a method for ensuring that no 2T code word is ever repeated during serial transmission. A claimed advantage of this invention is the facilitation of self-clocking by ensuring that a voltage transition occurs at least once during any two transmitted ternary words. The encoder uses a look-up table to accomplish the binary to ternary translation and a comparer with a memory to compare each to-be-transmitted word with the previously transmitted word and to substitute a &#34;repeat&#34; code whenever two words in sequence are identical. The use of the look-up table makes this invention impractical when applied to high speed network applications because the access time for look up table memories is too slow. 
     U.S. Pat. No. 4,779,073, to Iketani, discloses a 3B2T encoder with a look-up table similar to Fisher but including, in a second embodiment, an accumulator circuit and an inverter. The accumulator circuit determines the running &#34;algebraic weight&#34; of the transmitted ternary signals. The algebraic weight is defined as the sum of the ternary digits in the code word, where the two trit ternary code word &#34;+0&#34; would have an algebraic weight of plus one (+1) and the ternary code word &#34;--&#34; would have an algebraic weight of minus two (-2). The inverter is used to change the polarity of selected ternary words when the accumulated algebraic weight of transmitted words deviates from zero. The Iketani system uses a comparer to ensure that no 2T code word is ever repeated during serial transmission by replacing an even numbered pair of ternary symbols whenever two ternary code words in series are identical. DC balance is maintained through use of an inverter which inserts a &#34;synchronous pattern&#34; into the ternary data stream to let the decoder know when a code word has been inverted. One problem with the addition of the &#34;synchronous pattern&#34; into the ternary signal is that it reduces the overall speed of transmitted data and adds a data-dependent delay and circuit complexity to the Iketani system. 
     U.S. Pat. No. 4,387,366 to Chow discloses a 4B3T code converter with a PROM look-up table that stores inversion ternary code words along with non-inverted code words to maintain DC balance. A counter circuit adds up the algebraic weight of transmitted code words and selects the inverted ternary codes from the PROM to maintain DC balance when the balance deviates from zero. A claimed advantage of this invention is the facilitation of self-clocking by ensuring that a voltage transition occurs at least once during any two transmitted ternary words. As in Iketani, the look-up table and DC balance means are particularly unsuited for use in a high-speed network due to the slow access time of available memories that can serve as look-up tables. 
     Another encoder that uses a look-up table for binary to ternary translation is U.S. Pat. No. 4,092,595, to Weir, which discloses a 3B3T encoder. 
     U.S. Pat. No. 3,611,141, to Waters, discloses a 4B3T data transmission terminal that includes a disparity (or algebraic weight) checker and an inverter to maintain a zero DC balance. The binary to ternary translation uses combinatorial logic to translate from binary to ternary and provides a means to ensure that the maximum accumulated algebraic weight is four and that the longest possible string of identical ternary digits in a transmitted data stream is six. According to the system, no attempt is made in the translation to find a translation that uses a small number of logic gates. For this reason and because of the complexity of the disparity checking and inversion circuitry, the Waters system would be ineffective when applied to larger binary to ternary code conversions. 
     U.S. Pat. No. 4,244,052, to Hemsworth, provides a means for detecting misalignment of received words for a 6B4T translation system built according to the Waters system. Other systems that reference the Waters method for binary to ternary translation are U.S. Pat. No. 4,087,642 to Jessop (4B3T), and U.S. Pat. No. 3,902,117 to Sheppard (4B3T). 
     U.S. Pat. No. 4,631,428 to Grimes discloses a system for communicating data between binary chips using a 3B2T code converter that employs combinatorial logic. This system is not concerned with DC balance or other transmission issues and does not include means for addressing those problems. The system first translates the 3B code word to a 6B ternary control word which is used to control the 2T ternary drivers. 
     One specific application for binary to ternary translation that is not effectively addressed by the prior art systems is in high speed data transmission between computers in a network. On Sep. 28, 1993, the Fast Ethernet Alliance, a non-sanctioned technical group of the IEEE, proposed a new standard (the 4T+ Media Specification) for data transmission over four twisted pairs using a modification of the ethernet network protocol and using an 8B6T binary to ternary translation. The proposal was made to the IEEE 802.3 High-Speed Study Group. The 4T+ Media Specification proposes to achieve transmission speeds of 100 megabits per second using available ethernet transmission technology. This represents a 10 fold increase in speed over standard ethernet transmissions. As discussed above, prior art binary to ternary encoders are not well suited to perform the binary to ternary code conversion needed in this system. 
     What is needed is an 8B6T encoder and decoder and 8B to 6T code assignment that can utilize fast combinatorial logic, that efficiently preserves DC balance, that ensures frequent voltage transitions in a transmitted serial data stream and that is suited for high-speed processing and transmission in a computer network. 
     SUMMARY OF THE INVENTION 
     According to the present invention, an apparatus and method for transmitting an 8-bit binary format data word as a 6-trit ternary code word includes an encoder that produces, for each 8-bit data word value, an unique 6-trit ternary code word that is particularly optimized for transmission over twisted-pair cable. The 8-bit data word is first translated by binary logic circuitry into a 12-bit binary coded ternary (BCT) code word, which is easily translated into the 6-trit code word. The logic circuitry of the invention is optimized to accomplish the translation using a small number of combinatorial logic gates (less than 2000). The present invention thus has advantages in size, speed and performance over other possible means for encoding an 8 bit data word to a 6 trit code word. 
     The present invention maps 256 binary-based 8 bit groups into 256 of a possible 729 six trit ternary groups by using combinatorial logic that selects only code words that meet specific criteria that make the code words well suited for transmission. A technique and apparatus is included for ensuring that the accumulated DC balance of the data stream remains at zero. 
     The available six trit code words are characterized in the present invention by two parameters. An algebraic weight (W) of each code word represents the sum of the digits in the six trit code word, with possible values ranging from -6 to +6. A parameter Z of each code word indicates the maximum number of leading or trailing zeros that are present in the code word. The present invention selects values for these parameters that result in very efficient translation from binary to ternary and result in the most effective data transmission. 
     According to the invention, these parameters are selected and allowable 6T code words are determined as follows. Of the 729 possible 6T code words, it will be found that 18 have four or more leading or trailing zeros. If these words are eliminated, of the remaining 711 possible 6T code words, it will be found that 134 have an algebraic weight of 0 and 122 have an algebraic weight (W) of +1, making a total of 256 possible 6T code words with an algebraic weight of either 0 or +1 and having fewer than 4 leading or trailing zeros. Selecting only code words with an algebraic weight of either 0 or +1 immediately reduces the problem of DC balance in the transmitted ternary signal and, as will be seen below, allows for an easy apparatus for ensuring that the D.C. balance is exactly zero. Selecting only code words that have fewer than four leading or trailing zeros eliminates the need for circuitry to prevent the transmission of duplicate ternary words as is present in a number of the prior art references discussed above. This circuitry is not needed because each allowed 6T code word guarantees at least 2 voltage transitions for each six trits of code word transmitted, even if the same code word is repeated indefinitely. The guaranteed voltage transitions provided by the invention allow the transmitted code words to be reliably self clocking. The elimination of the need for compare and substitution circuitry to prevent duplicate code words from being transmitted is one advantage of this invention over prior art binary to ternary converters. 
     In order to process the 6T code words in conventional binary logic circuits, the 6T code words are first represented within the encoder and decoder by a 12 bit, binary coded ternary (BCT) code word, where each trit of the 6T code word is encoded as two bits. This assignment and the assignment of 8B data words to 6T code words according to the invention is done so that the translation from an 8B data word to a 12B binary-coded-ternary (BCT) code word can be accomplished using a simple combinatorial logic scheme. 
     An encoder/transmitter built according to the invention includes a register to receive an 8-bit data word, a combinatorial logic block for translating from the 8-bit data word to a 12-bit BCT code word with an inversion control circuit for inverting every second 12-bit BCT code word that represents a 6-trit ternary word with an algebraic weight of +1 in order to preserve DC balance, a data splitter, a plurality of parallel-in/serial-out shift registers for shifting out the 12-bit code word 2-bits at a time, and a plurality of pulse shapers that produce ternary pulses in response to the 2-bit outputs of the shift registers. 
     In one specific embodiment of the invention, the pulse shapers produce a Nyquist pulse for pulse transmission. 
     A decoder/receiver built according to the invention includes a plurality of pulse detectors that each produce a 2-bit output in response to ternary pulses detected on a transmission line, a plurality of shift registers for assembling the 2-bit outputs into received 12-bit BCT code words, a combinatorial logic circuit for translating from the 12-bit BCT code word to an 8-bit data word with an invertor circuit for inverting every 12-bit BCT code word that has an algebraic weight of -1, and a register for receiving the 8-bit data words. 
     The invention will be understood more completely upon reference to the following detailed description in connection with the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram of a data encoding and transmission system that could effectively employ an 8B6T encoder according to the invention; 
     FIG. 2 is a block diagram of an 8B6T encoder according to an embodiment of the invention; 
     FIGS. 3a, 3b, and 3c together are a table showing the correspondence between 8-bit data words, 12-bit binary coded ternary code words, and 6-trit ternary code words according to a specific embodiment of the invention; 
     FIGS. 4a and 4b show the logic relationships between each digit of an input 8-bit data word and each digit of an output 12-bit binary coded ternary code word according to an embodiment of the invention; 
     FIG. 5 is a block diagram of a data decoding and receiving system that could effectively employ a 8B6T decoder according to an embodiment of the invention; 
     FIG. 6 is a block diagram of a 8B6T decoder according to an embodiment of the invention; and 
     FIG. 7 shows the logic relationships between each digit of an input 12-bit binary coded ternary code word and each digit of an output 8-bit data word according to an embodiment of the invention. 
    
    
     DETAILED DESCRIPTION OF SPECIFIC EMBODIMENTS 
     FIG. 1 shows one type of data transmission system in which the encoder of the present invention may be effectively employed. This transmission system was discussed in the Fast Ethernet Alliance&#39;s 4T+ Media Specification proposal discussed above. The system is designed to transmit data over a total of four twisted-pair transmission lines. It contains a Media Access Controller (MAC) 10, which is connected to the system bus (not shown) of a computer or other data processing unit. MAC 10 receives data from the system bus. In the Fast Ethernet Alliance proposal, the MAC is specified to output that data as 4-bit nibbles at a clock rate of 25 Mhz, giving an effective bit rate of 100 Mbps. 
     The 4-bit nibbles from MAC 10 are received by an 8-bit register 11. Register 11 receives two nibbles and then makes the resulting 8-bit data word available to 8B6T encoder 13. The encoder encodes the 8-bit data word and outputs a 12-bit binary coded ternary (BCT) code word, which represents a 6-trit ternary code word, to data splitter 15. Operation of data splitter 15 is controlled by state machine 14 which is connected to the MAC&#39;s clock and which provides a simple sequential 3-bit select signal to data splitter 15 and encoder 13. The data splitter time de-multiplexes the 12-bit code words among three shift registers 16, 17, and 18 in a round robin fashion in response to the 3-bit select signal from state machine 14. These shift registers shift out 2-bits (representing one trit) of the code words every clock cycle to transmission pulse shapers 20, 23, and 25. The pulse shapers generate pulses in response to their inputs and these pulses are transmitted through filters 28, 30, and 33 onto twisted pairs 35, 38, and 40. The pulse shapers produce a ternary pulse for each two-bit input according to the code shown in Table 1. 
     
                       TABLE 1                                                     
______________________________________                                    
       Binary                                                             
             Ternary                                                      
______________________________________                                    
       00    -                                                            
       01    0                                                            
       10    0                                                            
       11    +                                                            
______________________________________                                    
 
    
     Collision detect and carrier detect in this system are accomplished over a fourth twisted pair 43. While the system is transmitting, twisted pair 43 is monitored through filter 45 by carrier sense detector circuit 48. If a carrier is detected by circuit 48 while the transmitter is transmitting, circuit 48 sends a signal to MAC 10 alerting it to a collision and MAC 10 halts data transmission and processes the error. 
     FIG. 2 shows encoder 13 in more detail. Once the eight bits of data are available from register 11, the data word is presented to combinatorial logic block 100. Logic block 100 converts the 8-bit data word into a 12-bit binary-coded-ternary (BCT) code word having the algebraic weight and zero properties discussed above. All utilized code words have a ternary algebraic weight of either 0 or +1 and all have fewer than 4 leading or trailing zeros. For any 8-bit data input shown in FIGS. 3a, 3b, and 3c, combinatorial logic block 100 produces the 12-bit BCT output as shown in those figures. Each 12-bit binary code word is representative of a 6-trit ternary code word also as shown in FIGS. 3a, 3b, and 3c. In one embodiment of the invention, combinatorial logic block 100 implements the logic equations shown in FIGS. 4a and 4b. 
     Combinatorial logic block 100 also generates the binary signal W1 in response to the ternary algebraic weight of the BCT code word. Signal W1 is high when the 12-bit BCT code word represents a ternary code word with an algebraic weight of one and low when the 12-bit BCT code word represents a ternary code word with an algebraic weight of zero. As discussed above, the algebraic weight of a ternary code word is determined by adding together all the digits in the code word. For example, the ternary code word &#34;0-+-+0&#34;, which according to the invention is mapped from binary data word &#34;00000001&#34;, has an algebraic weight of zero. 
     Block 100 may be constructed of discrete logic elements, may be a programmable logic array, or may be a custom integrated logic circuit. The logic equations as presented in FIGS. 4a and 4b and the code assignment shown in FIGS. 3a, 3b, and 3c have been selected to minimize the number of logic gates needed to construct block 100. According to the invention, combinatorial logic block 100 may be built with less than 2,000 logic gates. 
     The invention maintains a zero DC balance on each twisted pair for the transmitted ternary signal by inverting every second ternary code word on each twisted pair that has an algebraic weight of +1. This inversion produces an inverted ternary code word with an algebraic weight of -1. For example, the ternary code word &#34;-+00+0&#34; with an algebraic weight of +1, when inverted produces the code word &#34;+-00-0&#34; with an algebraic weight of -1. With inversion of every other ternary code word with an algebraic weight of +1, if the algebraic weights of a series of nine ternary code words decoded by logic block 100 for one twisted pair were +1,0,0,0,+1,+1,0,+1,0, an encoder according to the invention would invert the second and fourth code words with an algebraic weight of +1 to produce nine ternary code words with algebraic weights +1,0,0,0,-1,+1,0,-1,0 thus achieving an overall zero DC balance. It will be noted that with the 2-bit to 1-trit code assignment of Table 1, inversion of the 6-trit code word may be accomplish by simply inverting each bit in the 12-bit BCT code word. 
     Selective inversion on each of the three twisted pairs is accomplished as follows. The signal W1 generated by combinatorial logic block 100 is input to each of three selectable toggle register 120, 122, and 124 that essentially each act as 1-bit memories. The toggle registers operate such that their Q outputs will change from 0 to 1 or 1 to 0 (i.e. will &#34;toggle&#34;) on an active clock edge whenever both their T inputs and their enable (EN) inputs are active. The enable inputs of the toggle registers are connected to one of the three outputs (S1-3) of state machine 14 such that during any given word cycle just one of the toggle registers is enabled. 
     The three toggle registers are each connected to one of the three input AND gates 130, 132, or 134. The AND gates combine the signal W1, the toggle register output, and the select line for each of the twisted pairs to generate a signal that is active during every other data word cycle where a data word with weight +1 for a given twisted pair is input into block 100. 
     OR gate 138 combines the outputs of the three AND gates to form the signal INV --  CNTL which controls whether the code word output to the data splitter will be inverted. Once output by block 100, the 12-bit BCT code word is input to 12-bit XOR gate 140. XOR gate 140 performs an XOR function on each bit of the 12-bit code word with the one-bit signal INV --  CNTL. As described above, the signal INV --  CNTL is generated for each of the three twisted-pair lines based on the select signals generated by state machine 14. When signal INV --  CNTL is high, XOR gate 140 operates so that its 12-bit output is the bit-by-bit inverse of its 12-bit input. When signal INV --  CNTL is low, the 12-bit output of XOR gate 140 is the same as its input. After performing the selective inversion, XOR gate 140 outputs the 12-bit BCT code word to data splitter 15. 
     While a specific configuration for the 1-bit memory function of the toggle registers is shown, it would be obvious to one skilled in the art that there are many other logic circuit configurations that could perform the same function. 
     FIGS. 3a, 3b, and 3c show the particular assignment of the 256 possible 8-bit binary data words to 256 6-trit ternary code words according to the invention. The code assignment according to the invention can best be understood as follows. As discussed above, the 729 available six trit code words are characterized in the present invention by two parameters. An algebraic weight (W) of each code word represents the sum of the digits in the six trit code word, with possible values ranging from -6 to +6. A parameter Z of each code word indicates the maximum number of leading or trailing zeros that are present in the code word. According to the present invention, ternary code words are selected so that the parameter W=0 or +1 and Z=3. 
     Once the 256 allowable ternary code words have been selected, they must be assigned in a unique one to one relationship to the 256 possible 8-bit binary data words. This assignment is shown in FIGS. 3a, 3b, and 3c. The code assignment shown in FIGS. 3a-c was constructed so that a translation between an 8-bit data word and a 12-bit BCT code can be accomplished by a combinatorial logic block such as 100 using the least number of logic gates. 
     FIGS. 4a and 4b show a symbolic representation of the logic relationships that determine the outputs of combinatorial logic block 100 based on the inputs. In one embodiment, combinatorial logic block 100 is constructed from logic gate elements so that its outputs follow its inputs as described by the equations shown in FIGS. 4a and 4b. In the figures, the 8 binary bits that are input to encoder 13 are represented by the symbols B7-B0 with B7 being the most significant bit, and the 12 BCT bits that are output by block 100 are represented by the symbols T11-T0, with T11 being the most significant bit. The symbols m1-7, p1-3, s1-10, t1-3, u1-2, v1-2, and &#34;special&#34; in FIGS. 4a-b, all represent intermediate logic values that are used to generate T11-T0. 
     FIG. 5 shows one type data receiver system in which the decoder of the present invention may be effectively employed. This receiver system was also discussed in the Fast Ethernet Alliance&#39;s 4T+ Media Specification proposal discussed above. The receiver receives serial ternary encoded data over a total of three twisted-pair transmission lines. Serial, DC balanced ternary data is received over the three twisted pair lines 43, 38, and 40. The signals are filtered by filters 150, 153, and 155 and are then input into pulse detectors 158, 160, 163. The pulse detectors detect whether there is a positive pulse, a negative pulse, or no pulse on their connected data transmission channel during a clock cycle and output a 2-bit binary code word for each of these pulses as shown in Table 1. 
     The 2-bit output from the pulse detectors is collected by serial-in/parallel-out shift registers 165, 168, and 170. The shift registers reconstruct the 12-bit transmitted BCT code-words. A signal from one of the pulse detectors, 163, is provided to clock recovery circuit 173, which generates a 25 Mhz clock synchronized to the clock cycle of the recovered data. 
     State machine 175 generates three sequential enable signals EN1, EN2, and EN3, based on the recovered clock which during each clock cycle enables just one of the three shift registers 165, 168, and 170 to output its data to 8B6T decoder 178. Once the 12-bit data has been decoded, it is placed in register 180 and is available for transmission to MAC 10. 
     FIG. 6 is a block diagram of 8B6T decoder 178. The 12 BCT code words are first received by weight-check circuit 203 that determines the ternary algebraic weight of the BCT code word and for each code word with a weight of -1, circuit 203 asserts a signal W2 to XOR gate 205. When W2 is high, the 12-bit BCT output of XOR gate 205 is the bit-by-bit inverse of its 12-bit BCT input. The output of XOR gate 205 is then presented to logic block 208 which makes a determination as to which of the two possible 2-bit codes to use for trits that have a zero value. As can be seen from Table 1, when translating from 12BCT to 6T, both the 2-bit doublets 01 and 10 translate to a 0 trit. When the reverse translation is made, a determination must be made as to how 0 trit digits will be translated to a 2-bit binary doublet. According to the invention, this determination is made by examining each 6-bit half of the 12 BCT code word and determining what is the ternary algebraic weight of that half. Logic block 208 then converts the zero code doublets in the 6-bit half according to the assignment shown in Table 2. 
     
                       TABLE 2                                                     
______________________________________                                    
Ternary   Binary                                                          
______________________________________                                    
-         00                                                              
0         01           If the half has negative                           
                       algebraic weight                                   
0         10           If the half has positive                           
                       algebraic weight                                   
+         11                                                              
______________________________________                                    
 
    
     Logic block 208 contains two identical logic circuits that have as their input one half of the 12-bit BCT code word. Each half of block 208 examines its input to determine if the combined algebraic weight of the three ternary digits represented by that code word is positive, negative, or zero. If the algebraic weight is positive, block 208 assigns the code &#34;01&#34; for any 0 trits on its input. If the algebraic weight is negative, block 208 assigns the code &#34;10&#34; for any 0 trits on its input. For the purposes of making this assignment, block 208 treats the zero algebraic weight halves -1 1 0, 0 -1 1, and 1 0 -1 as having negative algebraic weight and treats the halves 1 -1 0, 0 1 -1, -1 0 1, and 0 0 0 as having positive algebraic weight. While in this specific embodiment the decode functions of logic blocks 208 and 220 are shown as being carried out by two distinct circuit elements, it would be obvious to one of ordinary skill in the art that these logic blocks could be combined into a single logic circuit. 
     The 12-bit BCT code word is then output by circuit 208 to 12BCT to 8B combinatorial logic block 220. Block 220 converts each 12-bit input to an 8-bit output in accordance with the table shown in FIGS. 3a-c and the 8-bit data words are output to register 180 where it is available to MAC 10. 
     FIG. 7 shows a symbolic representation of the logic relationships that determine the outputs of combinatorial logic block 220 based on the inputs. In one embodiment, combinatorial logic block 220 is constructed from logic gate elements so that its outputs follow its inputs as described by the equations shown in FIG. 7. In FIG. 7, the 12 BCT bits that are input to block 220 are represented by the symbols T11-T0 with T11 being the most significant bit, and the 8 binary bits that are output by circuit 220 are represented by the symbols B7-B0 with B7 being the most significant bit. The symbols al, ar, bl, br, cl, cr, dl, dr, el, er, fl, fr, lp0, rp0, ln0, rn0, lp1, ln1, lp2, rp2, ln2, rn2, 10hat, x10, x8, x4, x2, and &#34;special&#34; all represent intermediate logic values that are used in the equations to generate B7-B0. 
     While the above is a complete description of specific embodiments of the invention, various modifications, alternative constructions, and equivalents may be used. The code assignments shown in FIGS. 3a-c could be modified, for example, without changing the essential nature of the invention, or the logical relationships shown in FIGS. 4a-b and FIG. 7 could be written in slightly different form but with equivalent results. Signals that are active low could be substituted for signals that are active high. Processing functions of particular circuit elements could be divided out into separate elements or circuit elements shown in specific embodiments as individual functional blocks could be combined. The specific method for assigning 2-bit codes as shown in Table 1 could be modified without changing the essential nature of the invention by, for example, using a 3-bit binary nibble to represent each trit in the ternary code word. Therefore, the above description should not be taken as limiting the scope of the invention as defined by the claims.