Working of a CAM
Let us see how CAM works in hardware. As mentioned earlier CAM can be binary or ternary.
Binary CAM cell
CAM logic will simply have the storage circuitry and comparator logic to provide the match information for the searches performed. In this case a XOR gate is used to compare between the stored data and the searched data.
Ternary CAM cell
A Ternary cam as the name indicates has three states 0,1 and X. A “don’t care” condition exists in a ternary CAM to mask off certain bits for a partial match. The possibility of masking off of certain bits of the data opens up a wide range of applications where partial match is necessary; for instances at the edge of a router, where the router only worries about the destination network address and not the host ID.( An IP address consists of two fields: network ID and host ID).











