Patent ID: 7593976

Claim:
A method for finding a next free bit in a register having N bits and a current pointer pointing to one of the bits, the method comprising: breaking the N bits of a check vector in the register into M parts, wherein N and M are integers and 1<M<N; and selecting with a port selector an available part that has a free bit; wherein the available part is a first part, having a free bit, to the left of the part pointed to by the current pointer; and wherein the step for selecting the available part comprises: breaking the current pointer into upper bits and lower bits, wherein the current pointer has X bits, the upper bits have Y bits and a value U, and the lower bits have X-Y bits and a value L, and wherein 0≦U≦2 Y −1, and 0≦L≦2 X-Y −1, where all of X, Y, U, and L are integers; creating a check sector, wherein each bit of the check sector results from performing an AND operation to all bits of a corresponding part of the M parts; obtaining an add vector by setting its bit number U; adding the add vector to the check sector to obtain a sum; and multiplying the sum with an inverse of the check sector.