DETERMINATION OF NUMBER OF ONES IN A DATA FIELD BY ADDITION
United States Patent 3711692
An arrangement for counting the number of a given data such as ones in a data field. The system employs full adders which count the number of ones in basic three element subsets of the data field. Additional full adders total the results of the first series of full adders and also count any additional ones of the data field.
US Patent References:
MULTIPLE INPUT BINARY ADDER
Clapper - October 1970 - 3535502

OPTICAL PARALLEL ADDER
Duda et al. - September 1969 - 3466433

BINARY BATCH ADDER UTILIZING THRESHOLD COUNTERS
Weinberger - September 1971 - 3603776


Application Number:
05/124089
Publication Date:
01/16/1973
Filing Date:
03/15/1971
View Patent Images:
Assignee:
Goodyear Aerospace Corporation (Akron, OH)
Primary Class:
International Classes:
G06F7/60; G11C15/04; G11C15/00; G06F7/50
Field of Search:
235/175,92,92CP,92SA
Primary Examiner:
Botz, Eugene G.
Assistant Examiner:
Malzahn, David H.
Claims:
What is claimed is

1. The method of determining the number of occurrences of a selected value in a data field having at least fifteen elements, which comprises the steps of

2. dividing the data field into mutually exclusive, exhaustive subsets S1, S2, and S3, where S2 and S3 are of equal length and S1 includes at most one element of the data field;

3. counting the occurrences of the selected value in each of the subsets S2 and S3 ;

4. adding, by means of a full adder, the number of occurrences of the selected value in subset S1 and the least significant digit of the count of each of the subsets S2 and S3 ;

5. adding, by means of an additional full adder, the most significant digit of the output of the previous full adder and the next significant digit of the count of each of the subsets S2 and S3 ;

6. repeating step (4) until all the digits of the count of each of the subsets S2 and S3 have been exhausted, an additional full adder being employed for each addition; and

7. transmitting to an output device the least significant digit of the output of each full adder and both digits of the output of the last full adder, the least significant digit of the output of the first full adder being the least significant digit of the total count, the least significant digits of the outputs of successive full adders being the successive digits of the full count, and the most significant digit of the output of the final full adder being the most significant digit of the full count.

8. The method according to claim 1 wherein the count of each multiple element subset of the data field is determined by the steps of:

9. Apparatus for counting the number of occurrences of a predetermined value in a data field of at least fifteen elements, comprising:

10. Apparatus according to claim 3 wherein the first and second counting means each comprise a plurality of full adders.

11. Apparatus according to claim 4 wherein the full adders comprising each counting means are arranged in a plurality of series, the full adders of the first series counting the occurrences in two to three element subsets of the portion, the full adders of successive series combining the totals of the previous series of full adders.

Description:
It is the primary object of the present invention to provide means for counting the number of occurrences of a given value in a data field.

It is also an object of the invention to provide means for counting the number of occurrences of a given value in a data field which provides for the fast counting of the selected value occurrences.

The above and other objects of the invention which will become apparent in the following detailed description are achieved by providing a counting arrangement in which a first series of full adders count the number of occurrences of a selected value simultaneously in three element subsets of the data field, and includes an additional series of full adders for combining the totals produced by each of the adders of the first series.

For a more complete understanding of the invention and the objects and advantages thereof reference should be had to the following detailed description and the accompanying drawings wherein there is shown a preferred embodiment of the invention.

In the drawing:

FIG. 1 is a schematic showing of the counting arrangement of the present invention for a six element field;

FIG. 2 is a schematic showing of the counting arrangement for a seven element field; and

FIG. 3 is a schematic showing of a counting arrangement for a fifteen element field.

The data fields referred to in the following description may be stored in any suitable data storage means, such as the response store of an associative memory or associative processor. Regardless of the particular storage device involved, the data is stored as individual bits in the usual digital manner each having a 0 or 1 value.

FIG. 1 shows a six element data field 10 and illustrates the basic concept of the present invention. Each of the elements b of the data field 10 may have either a 0 or 1 value. While the elements are shown grouped into two sets of three elements each, this is for illustration only and the data field 10 is not necessarily so arranged physically. In order to count the total number of bits b which are of a particular value, for example which have the value 1, there is provided an arrangement of full adders 12-18. A typical full adder would be a MC1019 integrated circuit manufactured by Motorola Semiconductor Products, Inc.. Each of the full adders 12-18 is capable of receiving three binary inputs and adding these inputs to produce the two digit binary sum thereof, with the least significant digit of the sum being produced at the output s and the more significant digit being produced at the output c. The full adder 12 receives as inputs the values of three of the bits of the data field 10 and the full adder 14 receives as inputs the values of the remaining three data bits. If the data field is expressed in a form other than a binary code, converting means may be provided between the elements of the field and the full adders. Such converting means produces a 0 output if the element is not of the selected value and a 1 output if the element is of the selected value. Thus, the full adders 12 and 14 will simultaneously produce the total count of the 1's in their respective subsets of the data field 10. A third full adder 16 receives as inputs the least significant digit outputs of the first full adders 12 and 14. The output of this full adder 16 represents the sum of the least significant digits of the outputs of the adders 12 and 14. The least significant digit of the output of the adder 16 is thus the least significant digit of the sum of the 1's in the data field 10. This digit is supplied to the output device 20. A fourth full adder 18 receives as inputs the most significant digit output of the full adder 16 and the most significant digit outputs of the full adders 12 and 14. The least significant digit of the addition performed by the full adder 18 is the second significant digit of the total count while the most significant digit of the output is the most significant digit of the full count. Thus, the output of the least significant digit of the full adder 16 and the full output of the adder 18 comprise the full count of the number of ones in the data field 10.

FIG. 2 illustrates the arrangement of full adders employed with a data field 22 having seven elements. A first set of full adders 24 and 26 each count the values of three positions of the data field 22. An additional set of full adders 28 and 30 count, respectively, the single previously uncounted bit value of the data field 22, the least significant digits of the outputs of the counters 24 and 26, and the most significant digit of the output of the counter 28 and the most significant digits of the outputs of the counters 24 and 26. Again, the least significant digit output of the counter 28 is the least significant digit of the total count while the outputs of the full adder 30 provide the second and third significant digits of the total count. These three outputs are supplied to the output device 32 and represent the total count of the number of 1's in the data field 22.

The basic counting system described in the above paragraphs may be expanded to count the number of 1's in a field of any length. Essentially, this is accomplished by dividing the data field into subsets which may be counted by one of the counting arrangements described above and by adding the totals achieved for each subset by means of additional full adders. Thus, as is shown in FIG. 3, a fifteen element data field 48 may be divided into three subsets: S 1 which consists of a single bit of the data field 48, S 2 which consists of the next seven data bits of the field 48; and S 3 which consists of the remaining seven data bits. It should be noted that the order in which the data field 48 is divided into the subsets S 1 , S 2 and S 3 is purely arbitrary. The arrangement shown in which the first element is assigned to the subset S 1 , the next seven elements to the subset S 2 , and the remaining seven elements to subset S 3 , is chosen for convenience of illustration. However, any other arrangement may be employed so long as the subsets S 2 and S 3 are of equal length and the subset S, contains not more than one element.

The total count of 1's in the subsets S 2 and S 3 may be determined by full counters 50 and 52 which are each equivalent to the full adder arrangement of FIG. 2. The counts produced by the seven position counters 50 and 52 and the count of the least significant bit subset S 1 are added by means of additional full adders 54-58. These full adders 54-58 add, respectively, the least significant digit values, the next most significant digit values and the carry value of the previous adder, and the most significant digit values and the carry value from the previous adder. The outputs of the full adders 54-58 provide the successively higher ranked significant digits of the total count and these outputs are furnished to the output device 60. It should be noted that the maximum time required to achieve the total count of the number of 1's in the data field is equal to the delay imposed by a full adder multiplied by the total number of full adders involved in producing one digit of the output or final count. Referring again to the arrangement of FIG. 3 it will be seen that the maximum delay is five times the delay of one full adder. Since the adders 62 and 64 operate simultaneiously these two full adders impose only one time delay in the count. The adder 68, however, receives inputs both from the adder 62 and from the full adder 66. As a result, two additional delays are imposed. Likewise, the full adder 56 receives inputs both from the adder 68 and the adder 54 so that two additional time delays are again imposed. In general, if a field having n bit positions can be counted with a maximum delay of P full adders, a field having 2n + 1 bit positions can be counted with a maximum delay of P + 2 full adders. For a field having 2 m - 1 bit positions, where m is greater than or equal to 2, the maximum delay will be 2m -3 multiplied by the delay of one full adder.

The counting arrangement of the present invention is applicable to date fields of any length. The data field is first divided into three primary subsets S 1 , S 2 , and S 3 with the subsets S 2 and S 3 being of equal length and the subset S 1 containing at most a single element. The subsets S 1 , S 2 , and S 3 are mutually exclusive and exhaust the elements of the data field. If the primary subsets S 2 and S 3 each contain more than three elements, they are further divided into secondary subsets S 21 , S 22 , and S 23 , and S 31 , S 32 , and S 33 , respectively. The secondary subsets are also mutually exclusive and exhaustive of the elements of their respective primary subsets. The division of the primary subsets is accomplished in the same manner as the original division of the data field. Thus, the subsets S 22 and S 23 are of equal length and the subset S 21 is either void or contains a single element, depending on whether the primary subset S 2 contains an even or odd number of elements. Division of the multiple element subsets is continued in the same manner until a series of ultimate subsets, none of which contains more than three elements of the data field, is achieved.

A full adder is provided for each of the ultimate subsets which contains more than a single element. The full adders produce the counts of the number of 1's in the multiple element ultimate subsets. The counts of the penultimate subsets are obtained by means of additional full adders, two additional full adders being provided for each penultimate subset with one full adder combining the count of the single element subset, if present, and the least significant digit outputs of the ultimate subset adders and the second full adder combining the most significant digit of the output of the first full adder and the most significant digits of the ultimate subset full adders. By means of additional full adders arranged in the same manner, the counts of the successive subsets of the hierarchical rank of the subsets are obtained. The final series of adders combines the counts of the subsets S 1 , S 2 , and S 3 to produce the total count for the entire data field.

It will be understood that while only the best known embodiment of the invention has been described in detail, in accordance with the Patent Statutes, the invention is not so limited. Reference should therefore be had to the appended claims in determining the true scope of the invention.




<- Previous Patent (PERIPHERAL DEVICE AN...)   |   Next Patent (MODULAR BCD AND BINA...) ->