 designed such that the user supplies a data word and the CAM searches its entire memory to see if that data word is stored anywhere in it. If the data word is found, the CAM returns a list of one or more storage addresses where the word was found. In the case of forwarding table search, a simple CAM is not sufficient, due to the fact that what is needed is not a complete identification of the incoming address with the memory content, but the longest prefix has to be found. For this operation, the so-called ternary CAM (TCAM) is needed. TCAM allows a third matching state of "X" or "Don't Care" for one or more bits in the stored data word, thus adding flexibility to the search. For example, a TCAM might have a stored word of "10XX0" which will match any of the four search words "10000," "10010," "10100," or "10110." The forwarding calculation using a TCAM is done with a circuit whose scheme is reported in Figure 7.58. The prefixes are loaded into a TCAM in ascending order, SO that the longer between two prefixes having the same initial bits has the higher TCAM address. Moreover, the correspondence between prefixes and addresses of the forwarding port is loaded into a RAM. When the IP address is sent to the forwarding engine, it is loaded into the TCAM register to have, at the output, all the prefixes compatible with the incoming IP address. The TCAM is set SO to give priority to the prefix that has the higher address, that due to the prefix ordering inside the memory is also the longer [77,78]. The longer prefix is then sent to the RAM where it is associated to an output port address that is selected as the forwarding port address. Priority encoder Prefix-1 prefix Prefix-2 Longest Forward matching Prefix-N prefix Output port address Incoming IP address register Incoming IP address FIGURE 7.58 Block scheme of an IP forwarding engine based on a T-CAM. Telecommunication Networks The use of a TCAM to implement forwarding engines is fast and simple, but it has the drawback to require great power dissipation due to the 