Patent ID: 7555594

Claim:
A method of operation within a packet processing device, the method comprising: receiving first and second k-bit values that bound a range of values; and encoding the range bounded by the first and second k-bit values into an encoded value having not more than 2 k −1 bits, wherein encoding the range bounded by the first and second k-bit values into an encoded value comprises: (i) assigning a first number of bits in a first logic state to be left-justified bits of the encoded value, the first number of bits corresponding to the lower of the first and second k-bit values; (ii) assigning a second number of bits in the first logic state to be right-justified bits of the encoded value the second number of bits being 2 k −1 less the higher the first and second k-bit values; and (iii) assigning a third number of bits in a masked state to be contents of the encoded value between the left-justified and right-justified bits of the encoded value, the third number of bits being the difference between the first and second k-bit values, plus one.