Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Difference between TCAM and CAM

  • Last Updated : 18 Oct, 2021

1. CAM :
Content Addressable Memory (CAM) is a peculiar computer memory used in high-speed search-oriented applications. CAM consists of conventional semiconductor memory, typically SRAM(static RAM) along with connected logic comparison circuitry that makes it perform search operations in a single clock cycle. It can store and query binary inputs i.e. 0 and 1. 

The functioning of CAM is the opposite of the functioning of RAM (Random Access Memory). In the case of RAM, OS (Operating System) performs retrieval of data stored on RAM by giving the memory address which represents the location of stored data. But in the case of CAM, the retrieval of data stored on it is done by looking for the data itself. The memory retrieves the addresses where the data can be detected. 

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

 

The parallel nature of CAM makes it much faster than RAM in search tasks. It performs exact match-based searching that is useful for storing MAC (Media Access Control) addresses because of its fixed length.



2. TCAM :
Ternary Content Addressable Memory is a special type of CAM (Content Addressable Memory) that permits the third state referred to as “don’t care” in one or more bits of stored data. It also performs the entire search task in a single clock cycle. 

The term “ternary” means there are inputs available which the memory can store and query i.e. 0,1 and “don’t care”. The “don’t care” state introduces the flexibility in searching that enables TCAM to perform pattern-based searching. Because of its flexibility, it is used for storing IP addresses where the entire range of IP addresses can be searched at once. 

It is utilized in enhancing the speed of routing table lookups, forwarding, and classification of packets, and ACL (Access Control Lists) commands.

Difference between CAM and TCAM :

S.NO. CAM (Content Addressable Memory) TCAM (Ternary Content Addressable Memory)
    1. CAM stands for Content Addressable Memory. TCAM stands for Ternary Content Addressable Memory.
    2. It is a search engine-based computer memory used for various search applications. It is a specialized version of CAM depicted for quick table lookups.    
    3. It performs the entire search operation in a single clock cycle. It also performs the entire search operation in a single clock cycle.
4. The way it operates is the opposite of RAM (Random Access Memory), thus this makes it much faster than RAM in case of search operations.  It adds a third state to RAM (Random Access Memory) that provides flexibility in functionality for wildcard characters, thus makes it faster than RAM.
5. Unlike RAM, data loaded on CAM can be retrieved by executing a query for the data itself. Operating System utilizes the data and CAM retrieves the address that represents the location of stored data. It allows high-speed routing table lookups when compared to RAM.
6. CAM stores and query binary inputs i.e. 0 and 1. TCAM stores and query ternary inputs i.e. 0,1 and “don’t care”.
7. It is most useful for implementing tables that perform exact match based searching. For example – the MAC address table. It is most useful for implementing tables that perform the longest match-based searching. For example – the IP routing table.
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!