wire / wire-format / cam-memory
CAM (Content-Addressable Memory) is a special memory that searches all entries in parallel for a match. Each cell is an SRAM cell with a comparison circuit (XNOR + match line). On a search, the search key is broadcast to all rows; matching rows pull their match line low. Priority encoder selects the highest-priority match. Used in TLBs, caches (tag lookup), and network routers (forwarding tables).
aka: CAM (Content-Addressable Memory)
spec: CAM design
CAM (Content-Addressable Memory) is a special memory that searches all entries in parallel for a match. Each cell is an SRAM cell with a comparison circuit (XNOR + match line). On a search, the search key is broadcast to all rows; matching rows pull their match line low. Priority encoder selects the highest-priority match. Used in TLBs, caches (tag lookup), and network routers (forwarding tables).
| field | size | meaning |
|---|---|---|
| CAM cell | 9-10 transistors | SRAM cell (6T) + comparison circuit (2-4 transistors: XNOR + pass transistor). |
| Search key | n bits | Broadcast to all rows in parallel. |
| Match line | 1 wire per row | Precharged high; pulled low if any bit mismatches. |
| Priority encoder | n-to-log2(n) | Selects the highest-priority matching row. |
| Valid bit | 1 bit per row | Indicates if the entry is valid (not empty). |
| Mask | n bits | Ternary CAM (TCAM): each bit can be 0, 1, or don't-care (X). Used for IP routing (subnet masks). |
example:
00 00
CAM (placeholder)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/cam-memory
or /wire-format/cam-memory.json