Patent attributes
Method and apparatus are configured to assign a code of less than N number of bits in length to a pattern of bits of a first polarity value distributed within a block of N binary bits. The method basically comprises (1) determining a number of bits of the first value in the block of N binary bits; (2) selecting a base value based on the determined number of bits of the first value; (3) determining a displacement value representative of a particular distribution of the determined number of bits of the first value in the block of N binary bits; and (4) adding the base value and the displacement value to obtain a sum and using the sum to form an assigned code. The base value is preferably selected by evaluating an Expression Io=NC1+NC2+NC3 . . . +NCK−1, wherein K is the determined number of bits of the first value in the block of N binary bits. Determining the displacement value preferably comprises (if bit N is a binary first value bit), recursively determining the displacement value I(N,K) as N−1CK+I(N−1,K−1), where I(N−1,K−1) is the encoding of the pattern of K−1 number of remaining first value bits in N−1 bits. On the other hand, if bit N is not a first value bit, determining the displacement value preferably comprises recursively determining the displacement value I(N,K) as I(N−1,K) where K is the encoding of the pattern of K number of first value bits in the remaining N−1 number of bits.