1. A method to store data in a content-addressable memory (CAM) with a plurality of memory sets, the method comprising: receiving a data value to be stored in the CAM, wherein the data value has two or more bits; determining an index for the data value based on a subset of bits of the data value that correspond to an index bit set, wherein determining the index includes evaluating a distribution of values at each bit position in a plurality of data values stored in the plurality of memory sets and based on the evaluation, selecting the index from the index bit set; identifying a memory set from the plurality of memory sets of the CAM based on the determined index; and storing the data value in a storage unit of the identified memory set.