A method and apparatus for using a binary CAM array to implement Classless Interdomain
Routing (CIDR) address processing. A binary CAM array is segmented into a plurality
of array groups, each of which includes a number of rows of binary CAM cells and
an associated group global mask. Each array group may be assigned to a particular
prefix length by storing a prefix mask pattern corresponding to the prefix length
in the array group's associated group global mask. CIDR address entries are then
stored in array groups assigned to corresponding CIDR prefixes so that an array
group assigned to a particular prefix stores only CIDR addresses having that prefix.