Method and apparatus for quantifying the number of identical consecutive digits within a string
AssigneeApple Computer, Inc.
InventorWilliam C. Athas
Life of this patent
Estimating the term…
Abstract
One embodiment of the present invention provides a system for quantifying a number of identical consecutive digits starting from a fixed position within a string of n digits. The system operates by converting the string of n digits into a thermometer code, wherein the thermometer code uses m bits to represent a string of m identical consecutive digits within the string of n digits. Next, the system converts the thermometer code into a one-hot code in which only one bit has a logical one value. Finally, the system converts the one-hot code into a logarithmic code representing the number of identical consecutive digits.
Claims21
A method for quantifying a number of identical consecutive digits starting from a fixed position within a string of n digits, comprising:
- converting the string of n digits into a thermometer code, wherein the thermometer code uses m bits to represent a string of m identical consecutive digits within the string of n digits;
- wherein converting the string of digits into the thermometer code involves passing the string of digits through ┌logmn┐ layers of m-input AND gates, wherein for the case where m=2 a first layer of AND gates produces thermometer codes for sub-strings of length two, and wherein each consecutive layer produces thermometer codes for sub-strings of length k+1 to 2k by ANDing together thermometer codes for sub-strings of length 1 to k from preceding layers;
- converting the thermometer code into a one-hot code in which only one bit has a logical one value;
- and
- converting the one-hot code into a logarithmic code representing the number of identical consecutive digits.
An apparatus that quantifies a number of identical consecutive digits starting from a fixed position within a string of n digits, comprising:
- a thermometer code circuit that converts the string of n digits into a thermometer code, wherein the thermometer code uses m bits to represent a string of m identical consecutive digits within the string of n digits;
- wherein the thermometer code circuit includes ┌logmn┐ layers of m-input AND gates, wherein for the case where m=2•a first layer of AND gates produces thermometer codes for sub-strings of length two, and wherein each consecutive layer produces thermometer codes for sub-strings of length k+1 to 2k by ANDing together thermometer codes for sub-strings of length 1 to k from preceding layers;
- a one-hot code circuit that converts the thermometer code into a one-hot code in which only one bit has a logical one value;
- and
- a logarithmic code circuit that converts the one-hot code into a logarithmic code representing the number of identical consecutive digits.
A computer system including a circuit that quantifies a number of identical consecutive digits, comprising:
- a processor;
- a memory;
- a quantifying circuit that quantifies the number of identical consecutive digits starting from a fixed position within a string of n digits, wherein the quantifying circuit includes;
- a thermometer code circuit that converts the string of n digits into a thermometer code, wherein the thermometer code uses m bits to represent a string of m identical consecutive digits within the string of n digits,
- wherein the thermometer code circuit includes ┌logmn┐ layers of m-input AND gates, wherein for the case when m=2, a first layer of AND gates produces thermometer codes for sub-strings of length two, and wherein each consecutive layer produces thermometer codes for sub-strings of length k+1 to 2k by ANDing together thermometer codes for sub-strings of length 1 to k from preceding layers,
- a one-hot code circuit that converts the thermometer code into a one-hot code in which only one bit has a logical one value;
- and
- a logarithmic code circuit that converts the one-hot code into a logarithmic code representing the number of identical consecutive digits.
Dependencies are inferred from the claim text.