Abstract:
A magnitude comparator circuit can include a bitwise comparison section that includes two passgates for each bit of two values that are compared to one another. The passgates can be enabled according to corresponding bit values of the two values.

Description:
CROSS-REFERENCE TO RELATED APPLICATION 
     The present application is related to and claims benefit of priority of the filing date of U.S. Provisional Patent Application entitled “Search Engine Architecture and Method”, assigned Ser. No. 60/343,973, filed Dec. 27, 2001, and herein incorporated by reference. 
    
    
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates to content addressable memories. More particularly, this invention relates to circuits and methods for determination of the priority of the selection of the index address based on programmed priority. 
     2. Description of Related Art 
     As is known in the art, a content addressable memory (CAM) has comparand data supplied to the memory and the memory returns an address if a corresponding match is found. The entire CAM can be searched in a single clock cycle and if a match is found, the address returned may be used to retrieve data associated with the search string. Such associated data is typically stored in a separate, discrete memory in a location specified by the result of the CAM search. 
     The structure and function of the CAM permits the determination of the best routing of messages on a network such as an intranet or the Internet. A router employs a CAM to quickly determine the location of the fast route for a message rather than a slower software based search through a standard memory array to determine the path. 
     Generally, when a comparand has multiple matches to locations within the CAM, a priority encoder selects the address or index of the location with the matching content and having the greatest priority dependent on the priority scheme implemented within the CAM. Generally the priority scheme used is fixed and not easily changeable in CAMs as manufactured at the present time. 
     Magnitude comparators are well known in the conventional art for determining the relative magnitude of two binary numbers. A general form of a magnitude comparator compares a group of most significant bits of the two binary numbers for equality and the next less significant bits if they are less than or greater than one another. All the groupings are then logically OR&#39;ed to determine the relative magnitudes of the two binary numbers. The equality of the two binary numbers is determined by performing an exclusive NOR (XNOR) for each bit pair of the two binary numbers. The results of the XNOR&#39;s of each bit pair are then combined with a logical AND. Refer to  FIG. 6  for a discussion of an example of a conventional structure of a magnitude comparator as presented in  Digital Design , Mano, Prentice Hall PTR, Published 1991, pp. 163-165. Each of the exclusive NOR&#39;s U 1 , U 2 , U 3 , and U 4  have a pair of bits (A 3 , B 3 ), (A 2 , B 2 ), (A 1 , B 1 ), (A 0 , B 0 ), respectively representing the digits of each of the two binary numbers connected as inputs. The exclusive NOR function as is known in the art is the function for equivalence in Boolean algebra and therefore each of the XNOR&#39;s U 1 , U 2 , U 3 , and U 4  provides a signal indicating the equality of each of the pairs of bits (A 3 , B 3 ), (A 2 , B 2 ), (A 1 , B 1 ), (A 0 , B 0 ). The XNOR&#39;s U 1 , U 2 , U 3 , and U 4  as is further known in the art has the Boolean function:
 
An*Bn+  An *  Bn 
 
     The XNOR&#39;s U 1 , U 2 , U 3 , and U 4  each have two inverters I 1  and I 2  which provide the complement for each of the pairs of bits (A 3 , B 3 ), (A 2 , B 2 ), (A 1 , B 1 ), (A 0 , B 0 ). The AND gate I 3  has the complement of the bit An and the bit Bn as inputs and the AND gate I 4  has the bit An and the complement of the bit Bn as inputs. The output of the AND gate I 3  provides the inequality An&lt;Bn and the output of the AND gate I 4  provides the inequality An&gt;Bn. The inputs of the NOR gate I 5  are the outputs of the AND gates I 3  and I 4 . The output of the NOR gate I 5  is the indication of the equality of the input bits (An, Bn). 
     The AND gates I 6 , I 8 , I 10  combine the equality of the more significant bits and the inequality indicating An&lt;Bn of the lesser significant bit. The outputs of the AND gates I 6 , I 8 , I 10  are combined by the OR gate I 13  to generate the inequality A&lt;B of the two binary numbers. 
     The AND gates I 7 , I 9 , I 11  combine the equality of the more significant bits and the inequality indicating An&gt;Bn of the lesser significant bits. The outputs of the AND gates I 7 , I 9 , I 11  are combined by the OR gate I 14  to generate the inequality A&gt;B of the two binary numbers. 
     The AND gate I 12  has the equality outputs of XNOR&#39;s U 1 , U 2 , U 3 , and U 4 . Since all of the pairs of bits (A 3 , B 3 ), (A 2 , B 2 ), (A 1 , BI), (A 0 , B 0 ) must be equal for the binary numbers to be equal, the output of the AND gate I 12  provides the indication that all the pairs of bits (A 3 , B 3 ), (A 2 , B 2 ), (A 1 , B 1 ), (A 0 , B 0 ) are equal and therefore the indication of the equality of the two binary numbers. 
     The outputs F 1 , F 2 , F 3  of the magnitude comparator provide individual or “one hot” indication of the relative magnitudes of the two binary numbers A and B. Having this conventional structure forces an implementation of the circuit to occupy excess area within an integrated circuit. While the structure of the magnitude comparator as shown is essentially a canonical structure, an actual circuit implementation would require more circuits than shown to implement the function. It is well known in the conventional art that basic function of a CMOS logic circuit is an inverter and that more complex functions formed are normally NAND gates or NOR gates. This requires use of inverted logic and thus extra inverters to accomplish a simple AND or OR function. 
     The implementation of an inequality function as an exclusive OR function using a passgate or transmission gate is explained in Mano pages 430-433 and shown in  FIG. 7 . The two input bits A and B are connected respectively to the inverter circuits I 1  and I 2  to provide the complements for the two input bits A and B. In this implementation, the control of the transmission gates TG 1  and TG 2  is determined by the state of the input bit A. The state of the input bit B or its complement at the output of the inverter I 2  is the connected to transfer through the pass-gates TG 1  or TG 2  as controlled by the state of the input bit A. It is shown in Table 1 that the output F is the exclusive OR (XOR) of the two input bits A and B. 
     
       
         
               
               
               
               
               
             
           
               
                 TABLE 1 
               
               
                   
               
               
                 A 
                 B 
                 TG1 
                 TG2 
                 F 
               
               
                   
               
             
             
               
                 0 
                 0 
                 CLOSED 
                 OPEN 
                 0 
               
               
                 0 
                 1 
                 CLOSED 
                 OPEN 
                 1 
               
               
                 1 
                 0 
                 OPEN 
                 CLOSED 
                 1 
               
               
                 1 
                 1 
                 OPEN 
                 CLOSED 
                 0 
               
               
                   
               
             
          
         
       
     
     It is well known in the conventional art that the exclusive OR as shown in Table 1 is a negative function of the XNOR or an equality function. Thus the function F of Table 1 can be represented as:
 
 F =( A≠B )=  ( A=B ) 
 
     U.S. Pat. No. 5,602,550 (Stein) describes a method and apparatus for compressing a data vector of a predetermined number of data points. The apparatus includes a memory for storing the compressed data vector, a first comparator for determining a largest and smallest data point of the data vector and a second comparator for comparing the largest and smallest data point and when they are equal, causing a first data point of the data vector to be stored in the memory as the compressed data vector. The apparatus also includes a first processor for determining a data field width necessary to uniquely describe a largest relative magnitude data point and a second processor for storing the data points of the data vector as the compressed vector in data fields of memory of the data field width. The apparatus also includes a comparator and register for creating a difference vector of difference values of adjacent data points of the data vector, a first processor for determining a data field width necessary to uniquely describe a largest magnitude difference value of the difference vector, and a second processor for storing the difference points of the difference vector as the compressed vector in data fields of the memory of the determined field width along with a magnitude and sign of the first data point of the data vector. 
     SUMMARY OF THE INVENTION 
     An object of this invention is to provide a content addressable memory having a changeable or programmable priority for the selection of an index or location having contents that match a key value input of the content addressable memory. 
     Another object of this invention is to provide a programmable priority multiplexing circuit for a content addressable memory to select one index or location having contents that match the key value input of the content addressable memory dependant upon a programmable or changeable priority. 
     Further, another object of this invention is to provide a magnitude comparator to compare the index or location values of the content addressable memory that match the key value input and to provide an indication of the relative value of the index or location values. 
     To accomplish at least one of these objects&#39; and other objects, a content addressable memory device has plurality of sub-units having arrays of content addressable memory cells. The plurality of sub-units are connected to receive an externally transmitted key value containing a comparand and each unit compares the comparand to stored data values of the content addressable memory cells and may provide an index value signal indicating a location within each sub-unit where the contents of the locations match the comparand. The content addressable memory further has at least one programmable priority multiplexing circuit. Each programmable priority multiplexing circuit is connected to receive a plurality of index value signals and a changeable priority signal. The changeable priority signal indicates a priority of selection of the plurality of index value signals and from the contents of the index value signals, provides an output having one of the plurality of index value signals. The changeable priority signal may be a portion of the key value transmitted to the content addressable memory for the search of the contents and may be set by a user of the content addressable memory device. 
     The programmable priority multiplexing circuit includes a magnitude comparator. The magnitude comparator is connected to receive the plurality of index value signals or soft priority values from the plurality of index value signals provides a magnitude signal indicating a relative magnitude of each of the plurality of index value signals. 
     The magnitude comparator circuit has a bit comparison circuit. The bit comparison circuit determines equality for each bit of the two binary numbers and if not equal, the relative magnitude for each bit of the two binary numbers. The bit comparison section includes two passgates for each bit of the two binary numbers that are compared. The passgates are enabled according to corresponding bit values of the two binary numbers to determine equality of the corresponding bits to generate a bit equality signal for each bit of the two binary numbers. The bit comparison section further has a first logic circuit for determining the relative magnitude of the bits of the two binary numbers and for providing a bit magnitude signal indicative of the relative magnitude of the binary digits. The bit comparison circuit further has a bit complementing circuit for each bit of the two binary numbers to provide a complement for each bit of the two binary numbers. The bit complementing circuit is connected to the two passgates to provide the complement for each bit to the two pass-gates. 
     The magnitude comparator circuit further contains an equality circuit and a relative magnitude circuit. The equality circuit is in communication with the bit comparison section and receives the bit equality signal of each bit of the two binary numbers to generate a number equality signal, which, when active, indicates the equality of the two binary numbers. The relative magnitude circuit is in communication with the bit comparison section to receive the bit equality signals and the bit magnitude signals for all bits of the two binary numbers, to logically combine the bit equality signals and the bit magnitude signals to determine the relative magnitude of the two binary numbers. 
     The programmable priority multiplexing circuit further includes an index selector and a multiplexer. The index selector is connected to receive the changeable priority signal and the magnitude signal. The index selector provides an index signal, which is generated based on the changeable priority signal indicating which one of the plurality index value signals matches the priority. The multiplexer is connected to receive the plurality of index value signals and the index signal. The multiplexer provides the output having the one of the plurality of index value signals, dependent upon the index signal determined from the priority signal. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  is a block diagram of a content addressable memory according to embodiment of this invention. 
         FIG. 2  block diagram of a programmable priority multiplexing circuit according to embodiments of this invention. 
         FIG. 3  is schematic diagram of a first embodiment of a magnitude comparator of this invention. 
         FIG. 4  is schematic diagram of a second embodiment of a magnitude comparator of this invention. 
         FIG. 5  is a flow diagram of the method for programmably selecting a location or index containing a match of the key value from multiple matches of the key value within a content addressable memory. 
         FIG. 6  is schematic diagram of a magnitude comparator of the conventional art. 
         FIG. 7  is a schematic diagram of an inequality or exclusive OR circuit of the conventional art. 
     
    
    
     DETAILED DESCRIPTION OF THE EMBODIMENTS 
     Refer now to  FIG. 1  for an overview of the content addressable memory (CAM) of this invention. The content addressable memory is formed of small sub-block of ternary CAM cells  100   a , . . . ,  100   n  arranged in groups of blocks  105   a , . . . ,  105   n . Groups of the blocks  105   a , . . . ,  105   n  of sub-blocks of ternary CAM cells  100   a , . . . ,  1001   n  are further arranged in super-blocks I 10   a , . . . , I 10   n . To perform a search within the CAM the key value  145  is applied to the decode and control circuitry  140 . The decode and control circuitry  140  decodes and separates the key value  145  into the command and comparand that is to be applied through each super-block I 10   a , . . . , I 10   n  to each block  105   a , . . . ,  105   n  and then to each sub-block  100   a , . . . ,  100   n . The priority portion  155  of the key value  145  is applied through the super-block I 10   a , . . . , I 10   n  to each block  105   a , . . . ,  105   n  and then to each programmable priority multiplexing circuit I 15   a , . . . , I 15   n , I 20   a , . . . , I 20   n , I 25   a , . . . , I 25   n , I 30   a , . . . , I 30   n , I 35 . In the preferred embodiment of the CAM of this invention, the sub-blocks  100   a , . . . ,  100   n  have a fixed priority as designed within the fundamental circuitry. The programmable priority multiplexing circuit of this invention is thus not included within the basic sub-block structure  100   a , . . . ,  100   n . However, it is in keeping with the intent of this invention that the programmable priority multiplexing circuit may be incorporated with or within the basic sub-block structure  100   a , . . . ,  100   n.    
     As is known in the art, the comparand is compared with the contents of each CAM array cell of each of the sub-blocks  100   a , . . . ,  100   n  of CAM arrays. Whenever there is a match of the comparand with any of the contents of the CAM array cells, an index value signal indicating the location of the match is generated by the CAM array. If there are multiple matches within a single sub-block  100   a , . . . ,  100   n , a priority encoder within the sub-block  100   a , . . . ,  100   n  determines which of the index value signals is to be transferred from the sub-block  100   a , . . . ,  100   n . The index value signal having the highest priority is transferred from pairs of the sub-blocks  100   a , . . . ,  100   n  to one of the programmable priority multiplexing circuits I 15   a , . . . , I 15   n . Based on the priority  155  as embedded in the key value  145  one of the index value signals from a pair of sub-blocks  100   a ,  100   n  is chosen to be passed to a programmable priority multiplexing circuit I 20   a , . . . , I 20   n . The programmable priority multiplexing circuit I 20   a , . . . , I 20   n  is shown as receiving multiple index value signals, however, the basic structure of the programmable priority multiplexing circuit I 20   a , . . . , I 20   n  determines the index value signal having the highest priority in a pair-wise fashion incorporating circuitry that may be identical to the programmable priority multiplexing circuits I 15   a , . . . , I 15   n . The winning index value signal or the signal having the highest priority for each block is transferred from the programmable priority multiplexing circuits I 20   a , . . . , I 20   n  to the programmable priority multiplexing circuit I 25   a , . . . , I 25   n  to determine the winning index value signal for each of the super blocks I 10   a ,  100   n . Then the winning index value signals from each super block I 10   a , . . . , I 10   n  is transferred to the programmable priority multiplexing circuits I 30   a , . . . , I 30   n , and I 35  to determine the ultimate winning address index value signal  165 . The winning address index value signal  165  may then be transferred to an output terminal. 
     Refer now to  FIG. 2  for an illustration of the fundamental structure of the programmable priority multiplexing circuits I 15   a , . . . , I 15   n , I 20   a , I 20   n , I 25   a , . . . , I 25   n , I 30   a , . . . , I 30   n , I 35  according to embodiments of this invention. The index values signals  200  and  205  are the inputs to the magnitude comparator  210 . The magnitude comparator determines the relative magnitude of the two binary numbers of the index value signals  200  and  205  and provides two output signals indicating whether the index value signal  200  is equal to the index value signal  205  (A=B) or the index value signal  200  is greater than the index value signal  205  (A&gt;B). 
     As discussed above, the magnitude comparator of the conventional art employs the “one hot” coding of three outputs and therefore the additional circuitry to determine whether the input signal A is less than the input signal B (A&lt;B) of  FIG. 6 . In the magnitude comparator of this invention the magnitude comparator employs the two output signals (A=B) and (A&gt;B) to determine whether the index value signal  200  is less than the index value signal  205  (A&lt;B) by decoding the two output signals (A=B) and (A&gt;B). If neither of the two output signals (A=B) nor (A&gt;B) are active, then the index value signal  200  must be less than the index value signal  205  (A&lt;B). Of course, the inverted values,  (A&gt;B)  or  (A=B) , may also be formed as output signals of the magnitude comparator  210 . 
     The index value signals  200  and  205  are inputs to the multiplexing circuit  230 . The multiplexer chooses which of the index value signals  200  or  205  to transfer as the output index value signal  235  dependent on the select signal  240 . The select signal is generated by the index selector  225  according to the values of the two output signals (A=B) and (A&gt;B) of the magnitude comparator  210  and the priority signal  155 . The priority signal  155  as developed from the key value  145  of  FIG. 1  is retained in a priority register  215  for transfer to the index selector  225 . 
     The first embodiment of the magnitude comparator of this invention is shown in  FIG. 3 . The magnitude comparator as shown in the preferred implementation of the first embodiment is for receiving two eight-bit index value signals (A and B) and comparing these eight-bit index value signals (A and B) to determine their relative magnitude. Each bit pair (A 0  and B 0 ), . . . , (A 7  and B 7 ) of the index value signals (A and B) are connected to be received by the bit magnitude comparator circuits  300   a , . . . ,  300   h  to determine the relative magnitude of each bit pair (A 0  and B 0 ), . . . , (A 7  and B 7 ). The structure of each of the bit magnitude comparator circuits  300   b , . . . ,  300   h  is the same as shown for the bit magnitude comparator circuit  300   a . The bit magnitude comparator  300   a  has the bit pair (A 7  and B 7 ) of the index value signals (A and B) connected to be received respectively by the inverters I 1  and I 2 . The inverters I 1  and I 2  provide the complement of the bit pair (A 7  and B 7 ). The bit A 7  and its complement are connected to the gate terminals of the transmission gates or passgates TG 1  and TG 2  to provide the control signals for the passgates TG 1  and TG 2 . The bit B 7  and its complement are connected to the input terminals of the pass-gates TG 1  and TG 2  to be selectively transferred through the passgates TG 1  and TG 2 . The output terminals of the passgates TG 1  and TG 2  are connected together to form the equality indicator output terminal  305   a    (A 7 =B 7 )  of the magnitude comparator  300   a . The bit A 7  and the complement of the bit B 7  are the input signals to the NAND gate I 20 . The NAND gate I 20  logically combines the bit A 7  and the complement of the bit B 7  to form the relative magnitude signal  (A 7 &gt;B 7 )  at the relative magnitude output terminal  310   a.    
     The relative magnitude circuits  315   a , . . . ,  315   g  are NOR and NAND or inverter circuits configured to determine the bit-wise relative magnitude of the binary numbers of the index value signals A and B according to the Boolean logic formula: 
     
       
         
           
             
               
                 
                   
                     RM 
                     i 
                   
                   = 
                   
                     
                       
                         ( 
                         
                           
                             A 
                             i 
                           
                           &gt; 
                           
                             B 
                             i 
                           
                         
                         ) 
                       
                       _ 
                     
                     * 
                     
                       
                         ∏ 
                         
                           i 
                           = 
                           1 
                         
                         n 
                       
                       ⁢ 
                       
                         
                           ( 
                           
                             
                               A 
                               
                                 i 
                                 + 
                                 1 
                               
                             
                             = 
                             
                               B 
                               
                                 i 
                                 + 
                                 1 
                               
                             
                           
                           ) 
                         
                         _ 
                       
                     
                   
                 
               
               
                 
                   Eq 
                   . 
                   
                       
                   
                   ⁢ 
                   1 
                 
               
             
           
         
       
         
         
           
             where:
           RM i  is the relative magnitude of the ith bit of the binary numbers of the index value signals A and B.   is the bit being evaluated for the determining the relative magnitude of the binary numbers of the index value signals A and B.   n is the total number of bits present in the binary numbers of the index value signals A and B.   
         
           
         
       
    
     The outputs of the relative magnitude circuits  315   a , . . . ,  315   g  and the relative magnitude signal  (A 7 &gt;B 7 )  for the most significant bit at the relative magnitude output terminal  310   a  are logically combined in the relative magnitude circuit  325  to determine the relative magnitude of the binary numbers A and B. The relative magnitude circuit is formed of two NAND gates whose outputs are connected to a NOR gate to form the relative magnitude output signal  (A&gt;B)  at its output terminal  330 . 
     Equality circuit  320  is formed of NOR gates having their outputs connected to a NAND gate. The equality circuit  320  determines if there is bit-wise equality of the binary numbers of the index value signals A and B according to the Boolean logic formula: 
     
       
         
           
             
               
                 
                   EQ 
                   = 
                   
                     
                       ∏ 
                       
                         i 
                         = 
                         1 
                       
                       n 
                     
                     ⁢ 
                     
                       
                         ( 
                         
                           
                             A 
                             i 
                           
                           = 
                           
                             B 
                             i 
                           
                         
                         ) 
                       
                       _ 
                     
                   
                 
               
               
                 
                   Eq 
                   . 
                   
                       
                   
                   ⁢ 
                   2 
                 
               
             
           
         
       
         
         
           
             where:
           EQ is the indication of the equality of the binary numbers of the index value signals A and B.   i is the bit being evaluated for the determining the equality of the binary numbers of the index value signals A and B.   n is the total number of bits present in the binary numbers of the index value signals A and B.   
         
           
         
       
    
     The second embodiment of the magnitude comparator of this invention is shown in  FIG. 4 . The magnitude comparator as shown in the preferred implementation of the second embodiment is for receiving two eight-bit index value signals (A and B) and comparing these eight-bit index value signals (A and B) to determine their relative magnitude. Each bit pair (A 0  and B 0 ), . . . , (A 7  and B 7 ) of the index value signals (A and B) are connected to be received by the bit magnitude comparator circuits  400   a , . . . ,  400   h  to determine the relative magnitude of each bit pair (A 0  and B 0 ), . . . , (A 7  and B 7 ). The structure of each of the bit magnitude comparator circuits  400   b , . . . ,  400   h  is the same as shown for the bit magnitude comparator circuit  400   a . The bit magnitude comparator  400   a  has the bit pair (A 7  and B 7 ) of the index value signals (A and B) connected to be received respectively by the inverters I 1  and I 2 . The inverters I 1  and I 2  provide the complement of the bit pair (A 7  and B 7 ). The bit A 7  and its complement are connected to the gate terminals of the transmission gates or passgates TG 1  and TG 2  to provide the control signals for the passgates TG 1  and TG 2 . The bit B 7  and its complement are connected to the input terminals of the passgates TG 1  and TG 2  to be selectively transferred through the passgates TG 1  and TG 2 . The output terminals of the passgates TG 1  and TG 2  are connected together to form the equality indicator output terminal  405   a  (A 7 =B 7 ) of the magnitude comparator  400   a . The bit A 7  and the complement of the bit B 7  are the input signals to the NAND gate I 20 . The NAND gate I 20  and the inverter I 3  logically combine the bit A 7  and the complement of the bit B 7  to form the relative magnitude signal (A 7 &gt;B 7 ) at the relative magnitude output terminal  410   a.    
     The relative magnitude circuits  435   a , . . . ,  435   g  of the second embodiment are NAND and NOR or inverter circuits configured to determine the bit-wise relative magnitude of the binary numbers of the index value signals A and B according to the Boolean logic formula of Eq. 1. 
     The outputs of the relative magnitude circuits  435   a , . . . ,  435   g  and the relative magnitude signal (A 7 &gt;B 7 ) for the most significant bit at the relative magnitude output terminal  410   a  are logically combined in the relative magnitude circuit  445  to determine the relative magnitude of the binary numbers A and B. The relative magnitude circuit  445  is formed of two NOR gates whose outputs are connected to a NAND gate to form the relative magnitude output signal (A&gt;B) at its output terminal  450 . 
     Equality circuit  440  is formed of NAND gates having their outputs connected to a NOR gate. The equality circuit determines if there is bit-wise equality of the binary numbers of the index value signals A and B according to the Boolean logic formula Eq. 2. 
     The equality function (A=B), which is shown as NOR gates in the magnitude comparator of the conventional art of  FIG. 6 , is implemented as a transmission gate XNOR structure in bit magnitude comparator circuits  300   a , . . . ,  300   h  of the first embodiment of this invention using existing inversion of signals in the relative magnitude circuit I 20  (A&gt;B) circuit for the complement of the input B. The structure of magnitude comparator of this invention differs from the magnitude comparator of the conventional art in that the bit magnitude comparator circuits  300   a , . . . ,  300   h  of the first embodiment of this invention are faster than magnitude comparator of the conventional art, because it has only 6 gate delays, while magnitude comparator of the conventional art version has eight logic gate delays. The bit magnitude comparator circuits  300   a , . . . ,  300   h  of the first embodiment of this invention employs a negative logic implementation to reduce the integrated circuit area required for the physical implementation, which because of the reduced area further increases speed. Since, the bit magnitude comparator circuits  300   a , . . . ,  300   h  of the first embodiment this invention is used many times in the chip, the area reduction of this unit block is an important factor. As noted above, the outputs of magnitude comparator of the conventional art are “one hot”. The third output can be derived by decoding the other two outputs. Therefore the bit magnitude comparator circuits  300   a , . . . ,  300   h  has only two outputs  (A&gt;B)  and  (A=B)  to further reduce the area of the integrated circuit further. 
     The equality (A=B) circuit of the bit magnitude comparator circuits  300   a , . . . ,  300   h  of the first embodiment of this invention, which is implemented using transmission gates TG 1  and TG 2 , works in parallel with the relative magnitude circuit (A&gt;B) circuit, which makes the bit magnitude comparator circuits  300   a , . . . ,  300   h  faster than magnitude comparator of the conventional art. The magnitude comparator of the conventional art has the equality circuit (A=B) in series with the relative magnitude circuit (A&gt;B). Having the equality circuit (A=B) in parallel with relative magnitude circuit (A&gt;B), is important in that relative magnitude signal (A&gt;B) is more timing critical in terms of using it for decision making by the logic receiving the relative magnitude signal (A&gt;B). It should be noted that the worst-case. delay is through the least significant bit (A 0  and B 0 ), which generate (A 0 &gt;B 0 ) logic, and are waiting for all the equality results from (A 7 =B 7 ), . . . , (A 1 =B 1 ), to complete. Making the equality function (A=B) in parallel with the relative magnitude function (A&gt;B), improved the performance of this critical path. 
       FIG. 5  illustrates a method for selecting an index value indicating a location of at least one match of a comparand with contents of a CAM. The priority of the selection of the index value of the CAM allows determination of which of the index values is to be selected, when multiple index values indicate that the comparand is matching multiple locations of the content addressable memory. Conventionally, the priority of a sub-block of a CAM array is fixed and determined by the priority encoder constructed within the CAM array. However, it is keeping with the intent of this invention that the priority of the sub-block be set (Box  500 ) and the priority of the sub-block established within the priority index flags  505  for the sub-block. As described above, the priority for the sub-block may be provided as a separate programmable command or embedded within the key value with the comparand and separated by control circuitry for placement (Box  500 ) in the sub-block priority index flags  505 . The priority for the block may be similarly set (Box  510 ) within the block priority index flags  515 , and the priority for the super-block may be set (Box  520 ) within the super-block priority index flags  525 . If the sub-block priority is set (Box  500 ) and the block priority and the super-block priority are not set (Box  510 ) and (Box  520 ), the priority setting (Box  510 ) and (Box  520 ) is omitted. 
     The comparand is transferred to each sub-block of the CAM to search (Box  540 ) for locations where the contents of the CAM match the comparand. If the contents of one or more locations of each sub-block indicate a matching of its contents with the comparand, a plurality index values indicative of each of the locations is activated and input to a priority encoder to select the highest priority sub-block match. 
     The relative magnitude of the index values within a sub-block is established and, dependent upon the priority value (either fixed or programmable), one of the index values for each sub-block is determined (Box  545 ) and transferred (Box  550 ) to the block. At the block level, the relative magnitude of the index values for the block is established and dependent upon the priority value, one of the index values for each block is determined (Box  555 ) and transferred (Box  560 ) to the super-block. Finally at the super block level, the relative magnitude of the index values for the super-block is established and dependent upon the priority value, one of the index values for each super-block is determined (Box  565 ) and transferred (Box  570 ) to an output terminal. 
     While this invention has been particularly shown and described with reference to the preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made without departing from the spirit and scope of the invention.