A priority encoder (PE) for a CAM, comprising a plurality of PE blocks,
each receiving a plurality of match results corresponding to data entries
in a corresponding data array block and, for determining an address of a
highest priority data entry based on a physical location in the data
array block during a CAM search-and-compare operation a register for
storing a user defined priority value assigned to each PE block and means
for evaluating priority values and the address determined by the
plurality of PE blocks to select a PE block having the highest priority
data entry.