# US 9,355,066 B1 · Accelerated calculation of array statistics

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 9,355,066 B1
- Document ID: US9355066B1
- Status: Granted
- Kind: B1
- Application number: 14/064,953
- Filed: 2013-10-28
- Granted: 2016-05-31
- Earliest claimed: 2012-12-17
- Assignees: Marvell International Ltd.
- Applicants: Marvell International Ltd.
- Inventors: Gevorg Torjyan; Sohail Syed; Hillel Gazit
- Web page: https://patentgrep.com/patent/US9355066B1

## CPC

- G06F 17/18: for evaluating statistical data {, e.g. average values, frequency distributions, probability functions, regression analysis (forecasting specially adapted for a specific administrative, business or logistic context G06Q10/04)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present disclosure describes systems and techniques relating to calculation of array statistics. According to an aspect of the described systems and techniques, a device includes: a memory configured to store a data array and a counter array, wherein the data array includes multiple values, and each of the multiple values is encoded in a respective row of the data array, and wherein the counter array includes multiple counters, respective columns of the counter array correspond to respective ones of the counters, and rows of the counter array correspond with bit significance positions spanning the multiple counters; and processor electronics configured to add up a number bits found in respective columns of the data array using respective ones of the multiple counters.

## Claims

### Claim 1

A device comprising:
a memory configured to store a data array and a counter array, wherein the data array comprises multiple values, and each of the multiple values is encoded in a respective row of the data array; and
processor electronics configured to add up a number bits found in respective columns of the data array by treating respective columns of the counter array as respective ones of multiple counters with rows of the counter array corresponding to bit significance positions spanning the multiple counters; and
wherein the processor electronics operate using n bit wide words, and the processor electronics are configured to (i) retrieve data from the data array in the n bit wide words, (ii) AND the retrieved n bit wide words with an n bit wide portion of the multiple counters to generate an n bit wide carry array, (iii) XOR the retrieved n bit wide words with the n bit wide portion of the multiple counters, and while the n bit wide carry array remains non-zero, (iv) AND the n bit wide carry array with a next n bit wide portion of the multiple counters to update the n bit wide carry array, and XOR the n bit wide carry array with the next n bit wide portion of the multiple counters.

### Claim 2 (depends on 1)

The device of claim 1, wherein n is sixty four.

### Claim 3 (depends on 1)

The device of claim 1, wherein the memory comprises a Random Access Memory (RAM).

### Claim 4

A method comprising:
obtaining rows of a bit array;
counting column bits of the rows in parallel to obtain counter outputs, wherein the counting comprises
ANDing a zeros position of a counter array with a next row of the rows of the bit array to obtain a carry result, wherein the zeros position, the next row and the carry result are each stored in a machine word size of a hardware processor performing the method, and data in the zeros position machine word represents a least significant bit for each of the counters in the counter array,
XORing the zeros position with the next row to update the zeros position of the counter array, and
while the carry result remains greater than zero, propagating the carry result into higher significant bit positions of the counters in the counter array using further ANDing and XORing, wherein each of the higher significant bit positions of the counters in the counter array is stored in the machine word size of the hardware processor performing the method; and
providing the counter outputs, wherein respective counter outputs represent a number of bits set in respective columns of the bit array.

### Claim 5 (depends on 4)

The method of claim 4, wherein the hardware processor is a central processing unit, and the machine word size is sixty four bits wide.

### Claim 6 (depends on 4)

The method of claim 4, wherein the obtaining comprises retrieving rows of the bit array from a Random Access Memory (RANI) device.

### Claim 7

A non-transitory computer-readable medium encoding a program operable to cause a device to perform a method comprising:
obtaining rows of a bit array;
counting column bits of the rows in parallel to obtain counter outputs, wherein the counting comprises
ANDing a zeros position of a counter array with a next row of the rows of the bit array to obtain a carry result, wherein the zeros position, the next row and the carry result are each stored in a machine word size of a hardware processor performing the method, and data in the zeros position machine word represents a least significant bit for each of the counters in the counter array,
XORing the zeros position with the next row to update the zeros position of the counter array, and
while the carry result remains greater than zero, propagating the carry result into higher significant bit positions of the counters in the counter array using further ANDing and XORing, wherein each of the higher significant bit positions of the counters in the counter array is stored in the machine word size of the hardware processor performing the method; and
providing the counter outputs, wherein respective counter outputs represent a number of bits set in respective columns of the bit array.

### Claim 8 (depends on 7)

The non-transitory computer-readable medium of claim 7, wherein the hardware processor is a central processing unit, and the machine word size is sixty four bits wide.

### Claim 9 (depends on 7)

The non-transitory computer-readable medium of claim 7, wherein the obtaining comprises retrieving rows of the bit array from a Random Access Memory (RAM) device.

### Claim 10

An apparatus comprising:
a memory device to hold a data array;
a central processing unit (CPU) having a word size; and
software-based ripple counter means for calculating array statistics by causing
the CPU to (i) XOR data array inputs, which are each in the word size of the CPU, to find counter values in an array of counters stored vertically with respect to the word size of the CPU in relation to the memory device, and (ii) ripple any carries from the found counter values through the array of counters from a least significant bit to a most significant bit.

### Claim 11 (depends on 10)

The apparatus of claim 10, wherein the CPU and the memory device are both included in one integrated circuit device.

### Claim 12 (depends on 10)

The apparatus of claim 10, wherein the memory device comprises a Random Access Memory (RAM) device.
