Methods and apparatus are disclosed for using a programmable lookup word
generator to produce a lookup word for use by a content-addressable
memory. The programmable lookup word generator includes a profile memory
which contains instructions on how to build a particular lookup word. The
programmable lookup word generator receives a set of information and
possibly other operands typically including a profile selection. Based on
the profile selection, a set of instructions is retrieved from the
profile memory. Control logic uses this set of instructions to build the
lookup word by extracting portions of the received information and other
operands and ordering these extracted portions possibly with additional
information to build the lookup word. The lookup word is then used by a
CAM, typically to classify the received set of information and other
operands. In one context, the CAM produces a packet classification
indication in a communication or computer system.