Computer Science Tutorial

Content addressable memory

Generally memory is accessed using a unique address for every word. But, in order to speed up the memory access, we use the content itself to access the memory word. For that we need a special associative logic which can access the content fast enough to match cpu clock. This kind of high speed memory is called Content Addressable or Associative memory.

Now the question comes, if we already have the content then why are we using the content to access the content itself again? The answer to this is, the kind of Associative memory we are talking about is used in cache memory and not it main memory.

Why associative cache memory is complex, faster and costlier than main memory?

The concept of cache memory is bit different where the address of the memory word and the word itself both are stored. When CPU generates an address it is searched as a content using the associative logic. Since, the Content Addressable Memory requires an extra associative to guess the content of the word. It needed extra logic circuitry associated with every word that makes this memory more complex, faster and costlier than main memory.

Why cant we build associative cache memory as large as main memory?

A content addressable memory is more expensive than random access memory because each cell must have storage capability as well as logic circuits for matching its content with external argument. For this reason, we can not build large size content addressable memory. Even if we succeed it will occupy a lots of space and too costly. So, in a computer, we generally have very small size of content addressable associative memory.

Block Diagram of Content addressable Memory

How Content Addressable Memory works

It consists of a memory array of m words with n bits per word, a match register, an argument register and key register. The size of match register is m bits for every word in the memory array. Key register and argument register are each of size n bits which represent every bits in the memory word.

The content or data that is to be searched first stored in the argument register. Every word in the memory array are compared in parallel with the content of argument register. For every word in memory array that matches argument register, the corresponding bit in the match register is set. After the comparison, those bits in the matech register that have been set indicate the fact that correspoinding words in the memory array has matched. Now these matched words in the memory array are accessed sequentially.

The role of key register in associative mapping process is that it provides a mask to choose a particular field. For example, if certain bits in the key register are set to 1 then only corresponding bits of argument register are compared with the bits in the memory word. If all bits are set in key register than all the bits of the argument register are compared with every bit of memory word.

Application of Content Addressable Memory

Because of its architecture content addressable memory is very suitable for parallel searches and it has many application in computer, networking and database field.
  1. Cache Memory
  2. Translation lookaside buffers (TLB)
  3. Computer networking devices like Switch and Routers
  4. Database engines
  5. Data compression hardware
  6. Artificial neural networks
  7. Intrusion prevention system
BN Computer Academy
All Rights Reserved