A fast with-in range comparator is implemented in digital logic. A packet
arrives at a device for processing. Initial packet data that is available
in a first read cycle, is used to compute data that is necessary for
later cycles. The initial data and the subsequently data are then used to
test a single value against a range of values. In a method of the present
invention a range is separated into two ranges. An upper limit of the
first range is tested to determine whether the value is below the upper
limit. If this test fails, the value is tested to determine whether the
value is between the upper limit of the first range and the upper limit
of the full range. The ranges are tested by constructing a bit vector.
Data representing the capability of a communicating port, is then used to
index into the bit vector. The outcome of the index is a value that
signifies whether the port can support the packet or not.