On the Implementation of Boolean Functions on Content-Addressable Memories
Let [q⟩ denote the integer set {0,1,…,...,q-1} and let 𝔹={0,1}. The problem of implementing functions [q⟩→𝔹 on content-addressable memories (CAMs) is considered. CAMs can be classified by the input alphabet and the state alphabet of their cells; for example, in binary CAMs, those alphabets are both 𝔹, while in a ternary CAM (TCAM), both alphabets are endowed with a "don't care" symbol. This work is motivated by recent proposals for using CAMs for fast inference on decision trees. In such learning models, the tree nodes carry out integer comparisons, such as testing equality (x=t?) or inequality (x≤ t?), where x ∈ [q⟩ is an input to the node and t ∈ [q⟩ is a node parameter. A CAM implementation of such comparisons includes mapping (i.e., encoding) t into internal states of some number n of cells and mapping x into inputs to these cells, with the goal of minimizing n. Such mappings are presented for various comparison families, as well as for the set of all functions [q⟩→𝔹, under several scenarios of input and state alphabets of the CAM cells. All those mappings are shown to be optimal in that they attain the smallest possible n for any given q.
READ FULL TEXT