ArticleslgStudy

computer science

Content-addressable memory

Content-addressable memory is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Content-addressable memory rather than just read about it. In short: Content-addressable memory (CAM) is a special type of computer memory used in certain very-high-speed searching applications. It is also known as associative memory or associative storage and compares input search data against a table of stored data, and returns the address of matching data.

Content-addressable memory — main illustration
Content-addressable memory — illustration

Key takeaways

  • Content-addressable memory belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Content-addressable memory to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Content-addressable memory from memory before moving on to harder problems.

Reference excerpt

Content-addressable memory (CAM) is a special type of computer memory used in certain very-high-speed searching applications. It is also known as associative memory or associative storage and compares input search data against a table of stored data, and returns the address of matching data. CAM is frequently used in networking devices where it speeds up forwarding information base and routing table operations. This kind of associative memory is also used in cache memory. In associative cache memory, address and content are stored side by side. When the address matches, the corresponding content is fetched from cache memory.

History Dudley Allen Buck invented the concept of content-addressable memory in 1955. Buck is credited with the idea of recognition unit.

Hardware associative array Unlike standard computer memory, random-access memory (RAM), in which the user supplies a memory address and the RAM returns the data word stored at that address, a CAM is 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. Thus, a CAM is the hardware embodiment of what in software terms would be called an associative array. A similar concept can be found in the data word recognition unit, as proposed by Dudley Allen Buck in 1955.

Standards A major interface definition for CAMs and other network search engines was specified in an interoperability agreement called the Look-Aside Interface (LA-1 and LA-1B) developed by the Network Processing Forum. Numerous devices conforming to the interoperability agreement have been produced by Integrated Device Technology, Cypress Semiconductor, IBM, Broadcom and others. On December 11, 2007, the OIF published the serial look-aside (SLA) interface agreement.

Semiconductor implementations

CAM is much faster than RAM in data search applications. There are cost disadvantages to CAM, however. Unlike a RAM chip, which has simple storage cells, each individual memory bit in a fully parallel CAM must have its own associated comparison circuit to detect a match between the stored bit and the input bit. Additionally, match outputs from each cell in the data word must be combined to yield a complete data word match signal. The additional circuitry increases the physical size and manufacturing cost of the CAM chip. The extra circuitry also increases power dissipation since every comparison circuit is active on every clock cycle. Consequently, CAM is used only in specialized applications where searching speed cannot be accomplished using a less costly method. One successful early implementation was a General Purpose Associative Processor IC and System. In the early 2000s several semiconductor companies including Cypress, IDT, Netlogic, Sibercore, and MOSAID introduced CAM products targeting networking applications. These products were labelled Network Search Engines (NSE), Network Search Accelerators (NSA), and Knowledge-based Processors (KBP) but were essentially CAM with specialized interfaces and features optimized for networking. Currently Broadcom offers several families of KBPs.

Alternative implementations To achieve a different balance between speed, memory size and cost, some implementations emulate the function of CAM by using standard tree search or hashing designs in hardware, using hardware tricks like replication or pipelining to speed up effective performance. These designs are often used in routers. The Luleå algorithm is an efficient implementation for longest prefix match searches as required in internet routing tables.

Ternary CAMs

Binary CAM is the simplest type of CAM and uses data search words consisting entirely of 1s and 0s. Ternary CAM (TCAM) allows a third matching state of X or don't care for one or more bits in the stored word, thus adding flexibility to the search. For example, a stored word of 10XX0 in a ternary CAM will match any of the four search words 10000, 10010, 10100, or 10110. The added search flexibility comes at an additional cost over binary CAM as the internal memory cell must now encode three possible states instead of the two for the binary CAM. This additional state is typically implemented by adding a mask bit (care or don't care bit) to every memory cell. In 2013, IBM fabricated a nonvolatile TCAM using 2-transistor/2-resistive-storage (2T-2R) cells. A design of TCAM using hybrid Ferroelectric FeFET was recently published by a group of International scientists.

… excerpt ends here. Continue reading the full article.

Illustrations

Content-addressable memory: Comparison of conventional RAM and content-addressable memory (CAM), illustrating parallel associative search over stored keys.
Comparison of conventional RAM and content-addressable memory (CAM), illustrating parallel associative search over stored keys.
Content-addressable memory: CMOS binary CAM Cell consisting of a 6T SRAM cell plus 4 comparison transistors. When the data on the search lines (SL) differs from the data stored in the cell through the bit lines (BL), the match line (ML) will be pulled low to indicate a mismatch. If none of the cells on a match line indicate a mismatched bit, the match line will remain high at the precharge level to indicate a word match. Both search lines can be held at logic 0 as a don't-care search condition. Search lines and bit lines can be merged into a single pair of data lines.
CMOS binary CAM Cell consisting of a 6T SRAM cell plus 4 comparison transistors. When the data on the search lines (SL) differs from the data stored in the cell through the bit lines (BL), the match line (ML) will be pulled low to indicate a mismatch. If none of the cells on a match line indicate a mismatched bit, the match line will remain high at the precharge level to indicate a word match. Both search lines can be held at logic 0 as a don't-care search condition. Search lines and bit lines can be merged into a single pair of data lines.
Content-addressable memory: CMOS Ternary CAM cell consisting of two 6T SRAM cells plus 4 comparison transistors. Normally, opposite logic levels, either 0 and 1, or 1 and 0, will be stored in the two cells. For a don't-care condition, 0 will be stored in both cells so that the match line ML will not be pulled low for any combination of search line (SL) data.
CMOS Ternary CAM cell consisting of two 6T SRAM cells plus 4 comparison transistors. Normally, opposite logic levels, either 0 and 1, or 1 and 0, will be stored in the two cells. For a don't-care condition, 0 will be stored in both cells so that the match line ML will not be pulled low for any combination of search line (SL) data.

Worked examples

Example 1 — a first encounter with Content-addressable memory

Start with the simplest possible case. Write down what Content-addressable memory claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Content-addressable memory before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Content-addressable memory ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Content-addressable memory

In research
Content-addressable memory appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Content-addressable memory in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Content-addressable memory is common in secondary-school and first-year university syllabi. It links to neighbouring topics Associative arrays, Computer memory, Computer networking, so understanding it makes those chapters shorter.
In everyday life
Look for Content-addressable memory outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Content-addressable memory” →

How to study Content-addressable memory in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Content-addressable memory means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Content-addressable memory out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Content-addressable memory in simple terms?

Content-addressable memory (CAM) is a special type of computer memory used in certain very-high-speed searching applications. It is also known as associative memory or associative storage and compares input search data against a table of stored data, and returns the address of matching data.

Why does Content-addressable memory matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Content-addressable memory?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Content-addressable memory.

Tags

  • Associative arrays
  • Computer memory
  • Computer networking

Keep exploring