In the following the disclosure is explained in further detail with the use of preferred embodiments, which shall not limit the scope of the invention.
The following is a detailed description of embodiments of the disclosure depicted in the accompanying drawings. The embodiments are in such detail as to clearly communicate the disclosure. However, the amount of detail offered is not intended to limit the anticipated variations of embodiments; on the contrary, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the present disclosure as defined by the appended claims.
While specific embodiments will be described below with reference to particular configurations of hardware and/or software, those of skill in the art will realize that embodiments of the present disclosure may advantageously be implemented with other equivalent hardware and/or software systems. Aspects of the disclosure described herein may be stored or distributed on computer-readable media, including magnetic and optically readable and removable computer disks, as well as distributed electronically over the Internet or over other networks, including wireless networks. Data structures and transmission of data (including wireless transmission) particular to aspects of the disclosure are also encompassed within the scope of the disclosure.
In the following description methods and apparatuses to determine a median M from an unsorted set of m values is disclosed. The method and apparatus can create groups from the set of values where one group has a single value or a “distinguished value” and the other groups have multiple values. In one embodiment the “other groups” have three values. For example, in an embodiment that processes seven values, three groups or sub-sets can be made, a subset with the distinguished value and two other groups or subsets with three values each. To process a set with eleven values a distinguished value can be one subset and there can be three subset each having three values (i.e. multi-value subsets).
After the data set is divided into subsets, the multiple value subsets can be sent to sorter modules that sort the subsets into a highest value of the subset and lowest value of the subset. These sorted values can be received by a series of three (3) median modules. The 3-median modules can be arranged in stages or arranged sequentially such that a set of seven values can be process by three 3 median modules in a sequential configuration. Each 3-median module can receive three values and can identify a sub-median of these three input values. In accordance with some embodiments, 3/2(m−1) comparators can be utilized to find a median value of a set of m values (not including comparators utilized in the sorting process, if any).
A traditional sorting system will utilize many more comparators than required by some of the embodiments disclosed herein. For example, many traditional systems utilize m(m−1)/2 comparators, where some embodiments disclosed herein utilize considerably fewer comparators in total (sorting included) which, reduces the number of comparators needed by one fifth for m=5 or by one third for m=9, compared to conventional approaches that sort the data set by comparing each value and providing a full sort of the data set prior to determining the median value.
As stated above, the system can determine the median M of a given set of m values, where the values are referred to herein as D(0) to D(m−1) and where m can be an odd number. For example, for a set having seven values (m=7) the disclosed methods and apparatuses can determine the median M for the set of values D(0) to D(6) and if the set of values D(0) to D(6) are (3,5,7,2,9,4,1) the middle value or median M would be 4.
The arrangements and teachings herein are described with reference to processing a set having seven values and five values. However, the size of the set should not be interpreted as a limiting factor as sets of any size could be processed utilizing the teachings herein. Alternately stated, arrangements are not limited to a certain number (m) of input values D(0) to D(m−1).
The sorters 111 and 112 can sort the values they receive from a largest to smallest or from smallest to largest. In some embodiments, sorters 111 and 112 can sort the values in the set from lowest towards the top of the page (i.e. D′(0) and D(4) to the highest towards the bottom of the page (i.e. D′(2) and D′(6)). Therefore, the sorter 111 can receive D(0), D(1), and D(2) and can deliver D′(0), D′(1), and D′(2) where the values at the output of the sorter have the order D′(0)≦D′(1)≦D′(2). Sorter 111 can receive D(4), D(5), and D(6) and can deliver D′(4), D′(5), and D′(6) where the ordering can be D′(4)≦D′(5)≦D′(6). The highest value from sorter 111 (i.e. of D′(0)-D′(2)) can be sent to median module 101 and the lowest value from sorter 112 (i.e. of D′(4)-D′(6)) can be passed to median module 101.
The direction of sorting as described herein should not be understood as a limiting factor as sorting in different directions would not part from the scope of this disclosure. Each median module 101, 102 and 103 can each receive three values on their inputs and can deliver a median for the three input values. With the sorting “direction” described above, median module 101 can receive; D′(2) which can be the highest value of D′(0) to D′(2), D(3) which can be the subset with a single value or the distinguished value, and D′(4) which can be the lowest value of the subset D′(4) to D′(6).
Accepting these inputs, median module 101 can produce or determine value 11 which can be the median of D′(2), D′(3), and D′(4). D′(2), D′(3), and D′(4) can be also be considered as a subset of values. The value 11 can be called a “sub-median” because it is the median of three input values from three different subsets. Median module 102 can receive D′(1) which can be the second highest value of D′(0) to D′(2) assuming the direction of sorting as described above, the sub-median 11, D′(5) which can be the second highest value of D′(4) to D′(6) assuming the direction of sorting as described above, and the median module 102 can deliver a sub-median 12.
Median module 103 can receive; D′(0), which can be the lowest value from the set D′(0), D′(1), and D′(2) (assuming the direction of sorting as described above), a sub-median value 12, and D′(6) which can be the highest value of the set D′(4), D′(5) and D′(6) assuming the direction of sorting as described above. From these inputs median module can determine the median M 109 from the set of values (D(0)-D(6) provided at the input to the system. The disclosed system can be scalable and it can be appreciated that, to determine the median M of seven input values (m=7), a system having only two sorters each sorting three input values and three 3-median modules can be provide such a median function.
The median module 100 disclosed can include three comparators 131, 132 and 133 which can compare the three input values D″(0), D″(1), and D″(2) 121. Comparator 131 can produce a logic 1, if D″(0)<D″(1) or can produce a logic 0 if D″(0) is greater than or equal to D″(1). Comparator 132 can produce a logical 1, if D″(0)<D″(2) and else comparator 132 can produce a logical 0. The comparator 133 can deliver 1, if D″(1)<D″(2) else it can produce a logical 0. The results of the comparators 131, 132, and 133 can be are utilized to switch multiplexers 151 and 152 via exclusive OR (XOR) gates 141 and 142. When configured in a system, the median module 100 can deliver a sub-median 129 of the given input values 121.
It can be appreciated that a median module can be fast because it incorporates relatively little combinatorial logic, multiplexers, and comparators. It can be appreciated that the circuit configuration of
The arranged values D′(0), D(1) and D′(3), D′(4) can be passed to median modules 107 and 108 where the median module 107 receives D′(1), D′(2), and D′(3) and median module 108 receives D′(0), the sub-median value 18 computed by the median module 107, and D′(4). The median M for the set of values D(0)-D(4) can then be determined by median module 108. In the embodiments shown in
As described above, in some embodiments the sorting direction (top to bottom) of both the first and the second sorter can be the same. However, other embodiments such as the one illustrated for processing a set of five values can have a different way of sorting the two subsets of the set.
Referring to
It can be appreciated that the embodiments described with reference to
The parallel ALUs 200 can provide their results to buffers 210. Each ALU(k) can send results of a current operation to a corresponding buffer (k). Each of the z parallel ALUs 200 can receive an operand 201 herein denoted as OP_IN(k), whereas k denotes the number of the ALU. Moreover, each ALU(k) can receive any value 203 stored in the buffers 210 which can be the results of previous operations executed in the ALUs 200. In addition, each ALU(k) can receive an “immediate value” IMM_IN 205 which can be provided as part of a very long instruction (VLIW).
In some embodiments, the immediate value IMM_IN 205 can be the same for all ALUs 200 in a certain clock cycle. Hence, each ALU(k) of the ALUs 200 can receive a set of values and each ALU(k) can determine a median value from the set of values. Depending on the instruction word or VLIW provided to the processor (ALU(k)) the set of input values for the median calculation in each or any ALU(k) can be chosen from the multitude of values provided to ALU(k). Such a configuration is often utilized for processing streaming digital video data.
The buffers can allow the system to operate at much higher clock speed because propagation times can be controlled. The propagation time from register 172 to the output (through module 103), propagation time through the module 102, and propagation time from the inputs through the modules 111, 112, and 101 can be controlled. Thus in one full cycle the values can be sorted and a median can be computed by module 101. In a next cycle other values can be are sorted and a median can be computed by module 101. In a next cycle, additional values can be sorted and a median can be computed by module 101, and a median can be computed by module 102, while in parallel a median is calculated by module 103.
The buffers 171 and 172 can break the flow of determining a median value into a series of sub-paths. Clocking of the buffers 171 and 172 allows each sub-path to be operated concurrently or in a parallel configuration where new data sets can be input to the system every clock cycle, and thus a median can be determined every clock cycle. As the sub-paths are shorter than the total path from the input to the output the system can be clocked at a speed that is sufficient to support the slowest sub-path. Additional buffers could be added to increase operating speed at the cost of additional overhead required by such buffers.
As illustrated by block 807 values can be selected to determine a sub-median: a highest value from the first subset, the distinguished value, and a lowest value from the second subset. The selected values can be removed from the groups and/or from the input values.
As illustrated by block 809 the sub-median of the three selected values can be determined using a comparison operation. As illustrated by decision block 811 it can be determined if still input values are available and the first group and/or the second group is not empty. In case input values are still available and/or the first and/or the second group are not empty, for a next iteration the sub-media determined by block 809 can be utilized as the distinguished value. The loop then can continue with execution of block 807. When no additional values are available and/or the first and/or the second group are empty, the median can be utilized as illustrated by block 813.
Each process disclosed herein can be implemented with a software program. The software programs described herein may be operated on any type of computer, such as personal computer, server, etc. Any programs may be contained on a variety of signal-bearing media. Illustrative signal-bearing media include, but are not limited to: (i) information permanently stored on non-writable storage media (e.g., read-only memory devices within a computer such as CD-ROM disks readable by a CD-ROM drive); (ii) alterable information stored on writable storage media (e.g., floppy disks within a diskette drive or hard-disk drive); and (iii) information conveyed to a computer by a communications medium, such as through a computer or telephone network, including wireless communications. The latter embodiment specifically includes information downloaded from the Internet, intranet or other networks. Such signal-bearing media, when carrying computer-readable instructions that direct the functions of the present disclosure, represent embodiments of the present disclosure.
The disclosed embodiments can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements. In one embodiment, the arrangements can be implemented in software, which includes but is not limited to firmware, resident software, microcode, etc. Furthermore, the disclosure can take the form of a computer program product accessible from a computer-usable or computer-readable medium providing program code for use by or in connection with a computer or any instruction execution system. For the purposes of this description, a computer-usable or computer readable medium can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
The control module can retrieve instructions from an electronic storage medium. The medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Current examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-R/W) and DVD. A data processing system suitable for storing and/or executing program code can include at least one processor, logic, or a state machine coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution.
Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers. Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.
It will be apparent to those skilled in the art having the benefit of this disclosure that the present disclosure contemplates methods, systems, and media that can automatically tune a transmission line. It is understood that the form of the arrangements shown and described in the detailed description and the drawings are to be taken merely as examples. It is intended that the following claims be interpreted broadly to embrace all the variations of the example embodiments disclosed.
The disclosed invention is related to the subject matter of provisional United States Patent Application entitled Method And Apparatus To Find The median of a Set of unsorted Values filed Jul. 11, 2006 Application No. 60,806,953. Applicant hereby claims the benefit of such filing under 35 U.S.C. Sec. 119(e) of the provisional application. The contents of the provisional application are hereby incorporated by reference in their entirety.
Number | Date | Country | |
---|---|---|---|
60806953 | Jul 2006 | US |