Not applicable.
Not applicable.
Not applicable.
Not applicable.
1. Technical Field
The present invention relates generally to electrical computers for arithmetic processing and calculating, and more particularly to such where a convolution integral is evaluated in a digital fashion.
2. Background Art
Many existing and emerging systems can be analyzed using modern digital processors that are suitably programmed based upon mathematics that describe the underlying systems. For example, such analysis today is increasingly useful for analyzing linear time-invariant systems, such as electrical circuits, optical devices, mechanical mechanisms, and many other systems.
In mathematics and in many fields that use it extensively, such as most branches of the sciences and engineering today, the term “transform” is used to refer to a class of equation analysis techniques. The concept of the transform traces back to the functional analysis branch of mathematics, which primarily deals with the study of spaces of functions where a particular function has as its argument another function. Transforms thus can be used with an individual equation or with entire sets of equations, wherein the process of transformation is a one-to-one mapping of the original equation or equations represented in one domain into another equation or equations represented in a separate domain.
The motivation for performing transformation is often straightforward. There are many equations that are difficult to solve in their original representations, yet which may be more easily solvable in one or more other representations. Thus, a transform may be performed, a solution found, and then an inverse transform performed to map the solution back into the original domain. The general form of an integral transform is defined as:
Where K(α,t) is often referred to as the “integral kernel” of the transform.
The Laplace transform is a subset of the class of transforms defined by equation (1) and it is often particularly useful. Given a simple mathematical or functional description of an input to or an output from a system, the Laplace transform can provide an alternative functional description that may simplify analyzing the behavior of the system. The general form of the Laplace transform is defined as:
where the limits of integration and the integral kernel are redefined from equation (1) as a=0, b is replaced by ∞, and K(α,t)=e−st. The use of a Laplace transform on ƒ(t) is only possible when s is sufficiently large and certain conditions are met, but these conditions are usually flexible enough to allow ƒ(t) to take on the functional form of nearly any useful function that is found in practice.
It is a common occurrence that a certain function, say, F(s) is not the transform of a single known function but can be represented as the product of two functions that are each the result of the transform of a known function ƒ(t) or g(t), respectively. That is,
F(s)={circumflex over (f)}(s)ĝ(s), (3)
where g(t) must satisfy the same conditions as ƒ(t). From this link between F(s), ƒ(t), and g(t) the following relationship holds:
which is often referred to as the “convolution theorem.”
It can be observed that the convolution theorem results in a transformation of an integral of just one variable. Therefore the techniques for numerical approximation of an integral of just one variable can be applied.
The following equality holds between the integral representation and the Riemann sum representation:
where each ct−k and ck are chosen arbitrarily in the kth subinterval. In practice the right hand side of the equality in equation (5) is approximated by utilizing a very small Δτ and realizing that there exists an error term of some order dependent on the numerical technique chosen and the value of Δτ. Thus:
where m is the order of accuracy that can be represented by the resultant sum (and also the number of digits of precision that can be expected) and O is big-O notation in the traditional mathematics context.
As implied in passing above, there are existing and potential uses in important applications for transforms that can benefit from the use of convolution. For instance, one such application is the use of convolution in conjunction with digital filtering that is performed in digital signal processing (DSP).
Any filtering that can be expressed as a mathematical function can be achieved through the use of a digital filter, and this is one of the very foundations of modern DSP practice. For example, digital filtering on data values sampled from a signal permits removing unwanted parts of the signal or extracting the useful parts of the signal. The finite impulse response (FIR) and the infinite impulse response (IIR) are the two main types of digital filters used in DSP applications today, with the more common being the FIR filter.
The FIR filter is usually considered advantageous to use because it does not require internal feedback, which can, for example, cause an IIR filter to respond indefinitely to an impulse. The word “finite” in its name also implies another advantage of the FIR filter. The impulse from such a filter ultimately settles to zero, and errors in the iterative summing calculations used do not propagate. That is, the error term stays constant throughout the entire calculation process. This is a distinct advantage over an IIR filter, for example, where error can potentially grow for each additional iterative output sum.
Unfortunately, for many applications a major limitation of a digital filter is that its speed is restricted by the speed of the processor or processors used for numerical calculations. If high filtering speeds are required, for instance, this can make the hardware needed to implement a digital filter expensive or simply unattainable. For virtually all applications, and holding true generally for most electronics-based systems, the higher the speed being employed the harder it also becomes to deal with coincidental effects, such as suppressing electromagnetic noise and dissipating heat.
It therefore follows that improving the systems which we use for performing numerical convolution calculations will allow us to perform current and emerging signal processing related tasks at higher speeds, more economically, and with reduced detrimental effects in the underlying and peripheral systems.
Accordingly, it is an object of the present invention to provide systems for convolution calculation with multiple computer processors.
Briefly, one preferred embodiment of the present invention is a system for calculating a convolution of a data function with a filter function. An array of processors is provided that includes first and last processors and that each include a logic to multiply a coefficient value that is based on a derivation of the filter function and a data value that is representative of the data function to produce a current intermediate value. In the processors other than the first one, a logic is provided to receive a prior intermediate value that is representative of a previously performed calculation in another of the processors and to add that prior intermediate value to the current intermediate value. In the processors other than the last one, a logic is provided to send the data value and the current intermediate value to another processor. A logic is further provided to hold a prior intermediate value, if any, from the last processor as a prior partial value and to add this prior partial value to the current intermediate value from the last processor to produce a result value. The array of processors thus receives a series of the data values and produces a series of the result values that collectively are representative of the convolution of the data function with the filter function.
Briefly, another preferred embodiment of the present invention is a process for calculating a result value in a convolution of a data function with a filter function. A sequence of coefficient values are obtained that are based on a derivation of the filter function. For a data value that is representative of the data function, the coefficient values are then used in a pipeline of computerized processors including a first and last processors to multiply one of the coefficient values and the data value to produce current intermediate values. Other than in the first processor, a prior intermediate value that is representative of a previously performed calculation in another of the processors is added to the current intermediate value. Other than in the last processor, the data value and current intermediate value are sent to a subsequent processor. A prior partial value, if any, is added to the current intermediate value from the last processor to produce a result value, wherein this prior partial value is a previous intermediate value from the last processor. And the result value is output to a digital signal processor employing the process.
Briefly, another preferred embodiment of the present invention is a process for calculating a convolution of a data function with a filter function. A sequence of coefficient values are obtained that are based on a derivation of the filter function and a sequence of data values are obtained that are representative of the data function. For each such data value, with respect to each such coefficient value, in a pipeline of computerized processors including a first and last processors, the coefficient value and the data value are multiplied to produce a current intermediate value. Other than in the first processor, a prior intermediate value that is representative of a previously performed calculation in another of the processors is then added to the current intermediate value. Other than in the last processor, the data value and the current intermediate value are sent to a subsequent processor. A prior partial value, if any, is added to the current intermediate value from the last processor to produce a result value, wherein the prior partial value is a previous intermediate value from the last processor. These result values Are accumulated as the convolution, and the convolution is output to a digital signal processor employing the process.
Briefly, another preferred embodiment of the present invention is an improved system for calculating a convolution of the type in which at least one processor multiplies a coefficient value that is representative of a filter function with a data value that is representative of a data function. The improvement comprises the coefficient value being based on a derivation of the filter function.
And briefly, another preferred embodiment of the present invention is an improved process for calculating a convolution in a computerized processor of the type in which coefficient values are representative of a filter function, data values are representative of a data function, and there is multiplying of the coefficient values with the data values to produce result values that are collectively representative of the convolution. The improvement comprises employing coefficient values that are based on a derivation of the filter function.
These and other objects and advantages of the present invention will become clear to those skilled in the art in view of the description of the best presently known mode of carrying out the invention and the industrial applicability of the preferred embodiment as described herein and as illustrated in the figures of the drawings.
The purposes and advantages of the present invention will be apparent from the following detailed description in conjunction with the appended figures of drawings in which:
a-c are partial views of
a-f are block diagrams schematically depicting convolution calculation stages in an array of processors, such as that of
a-f are block diagrams schematically depicting convolution calculation stages based on a new algorithm, again presented in an array of processors such as that of
a-c are graphs depicting convolution performed using both of the approaches presented in
c shows a single trace representing the results of the approaches discussed.
a-b are a listing of code suitable for use in a derivation filter, wherein
In the various figures of the drawings, like references are used to denote like or similar elements or steps.
A preferred embodiment of the present invention is a system for convolution calculation performed with multiple computer processors. As illustrated in the various drawings herein, and particularly in the view of
Briefly, the invention is an improved convolution system 10 for numerically approximating the solution to a convolution of a data function with a filtering function. Performing convolution calculations using numerical techniques inherently tends to involve large numbers of multiplication and addition operations. The present invention permits substantially reducing the overall time needed to perform such calculations in two particular manners. First, the invention permits completing large portions of the necessary calculations in parallel, rather than serially. Second, the invention permits employing a new class of algorithms which uses filter values and data values that can be expressed with fewer data bits, and thus which can be performed faster in view of the inherent limitations in processors.
Starting at the input device 16 and ending at the output device 22,
The inventor's presently preferred hardware platform for the convolution system 10, is to have the array 12 of processors 14 in a single semiconductor die 26, such as the SEAforth-24A or the SEAforth-40A devices, by IntellaSys Corporation of Cupertino, Calif. The SEAforth-24A is used herein in most examples (and the processors 14 in these examples can properly be termed “cores” or “nodes”). To further facilitate this discussion, the members of the collective set of processors 14 are individually referenced as processors 14a-x, as shown, and each has busses 28 that permit intercommunication with other processors 14 that are present.
Although each processor 14 shown in
The nodes in the SEAforth-24A device handle communications and processing in particularly elegant and efficient manners, both asynchronously, making this device highly suitable for use with embodiments of the inventive convolution system 10. It should be kept in mind, however, that using this particular device, or even hardware that approaches its capabilities is not a requirement. Also, one may need to guard against misconceptions about how data is actually communicated between the processors 14 in the array 12. For example, either “push” or “pull” metaphors can be employed when thinking about inter-device communications, but one should remain mindful that communications is actually a cooperative act between devices.
a-c are partial views of
Each processor 14 in
Proceeding now with
Both communications and processing in the SEAforth-24A device are asynchronous so, once the processor 14a makes data available to processor 14b, the processing of the task at hand can, conceptually, “flow” through the rest of the array 12.
b shows how data can be extracted from the array 12. The processor 14x here is dedicated to receiving data from processor 14w and providing it to the output device 22. As such, processor 14x receives and stores data words from processor 14w, and then uses its result element 66 to provide data words to the output device 22, again all subject only to limitations by the capacity of its RAM 34 and whether it has been suitably programmed.
c shows how the contents of the signal data elements 60 and the calculated elements 64 generally flow between the processors 14b-w, and also how the sum can be stored in each processor 14 as an accumulation and then passed all at once in the course of a convolution calculation. As described in detail presently, each of the processors 14b-w here can be performing an operation contributing to the overall calculation. In the case of processor 14b, this operation uses a new input data value (in its signal data element 60) and a pre-stored convolution coefficient value (in its integral kernel filter element 62). In this particular example processor 14b does not need a calculated element 64, since there is nothing “partial” yet from an earlier calculation stage. For program simplicity, however, processor 14b can have a calculated element 64 loaded with zero. Also, for applications where multiple convolution coefficients per node are processed (discussed presently), processor 14b may then have and use a calculated element 64.
Continuing, in the cases of processor 14c-w, each performs an operation contributing to the overall convolution calculation by using a pre-stored convolution coefficient value, an input data value which has come from its respective preceding processor 14 along the flow path 24, and an intermediate value which is also from the preceding processor 14. The convolution coefficient value is held in a respective integral kernel filter element 62, the input data value is held temporarily in a respective signal data element 60, and the intermediate value is held temporarily in a respective calculated element 64.
In combination,
Similar operations can then occur along the flow path 24 in the processors 14b-w. Although the nodes in the SEAforth-24A device operate asynchronously, the operations in the processors 14b-w here can all conceptually be viewed as taking place in parallel. Accordingly, essentially contemporaneously with what has just been described for processor 14b, similar operations can be taking place in processors 14i and 14j, for example, only these will be using respective convolution coefficient values, processing intermediate data values, and using their ports 52 along the flow path 24. Also essentially contemporaneously, processor 14w will make available at its port 52c an output data value for processor 14x to handle as described above. Again it should be noted, however, that the RAM, ROM, registers, and ports can all be used in programmatically in the SEAforth-24A device and this preceding example is merely one of many ways the processors 14 can be programmed to achieve the same results.
a-f are block diagrams schematically depicting convolution calculation stages in an array 12 of processors 14 such as that of
Since the SEAforth-24A device features RAM, ROM, registers, and ports which all can be used in programmatically performed calculations, and since the inventive convolution system 10 can be used with other devices having lesser, greater, or yet other capabilities and structures, the data storage elements in
a shows a stage at which formal calculation is ready to commence. Convolution coefficient values (c0 . . . cn; n+1 values total, wherein n=21 in the SEAforth-24A device in
b shows a next stage at which a first data sample value (d0) has been received into d-bin 74(0). Calculation proceeds as shown, essentially contemporaneously and in parallel throughout the length of the pipeline, with a first result value (r0) being stored in r-bin 76(0).
c shows a next stage at which the prior data sample value (d0) has been moved to d-bin 74(1) and a second data sample value (d1) has been received into d-bin 74(0). Calculation again proceeds as shown, essentially contemporaneously and in parallel throughout the length of the pipeline, with a second result value (r1) now being stored in r-bin 76(1).
Between
d shows a stage at which the last data sample value (dn) has been received into d-bin 74(0). Again calculation proceeds as shown, with a result value (re) now being stored in the r-bin 76(n).
e shows a next stage. Having now partially processed all of the n+1 data sample values (d0 . . . dn), the last data sample value (dn) has been moved into d-bin 74(1) and a zero value is put into d-bin 74(0). Calculation proceeds and a result value (rn+1) is stored in r-bin 76(n+1).
Between
f shows a stage at which the last data sample value (dn) is finally finishing being processed. After calculation here, an (n+n−1)th result value is stored in r-bin 76(2n−1) and processing is complete. The r-bins 76(0 . . . 2n−1) now hold the full result of the convolution calculation performed here based on the n+1 data sample values (d0 . . . dn) and the n+1 convolution coefficient values (c0 . . . cn).
a-f are block diagrams schematically depicting convolution calculation stages based on a new algorithm, again presented in an array 12 of processors 14 such as that of
a shows a stage at which formal calculation is ready to commence. The derivation convolution coefficient values (c′0 . . . c′m) have been loaded into bins (c′-bins 82 collectively and c′-bins 82(0 . . . m) specifically), zeros have been loaded into other bins (d-bins 84 collectively and d-bins 84(0 . . . m) specifically), and a single p-bin 86 and a set of result bins (r-bins 88 collectively and r-bins 88(0 . . . 2m−1) specifically) have contents which are initially unimportant. Somewhat similar to the preceding example, indexing begins at zero and “c′” stands for derivation of a “coefficient,” “d” again stands for “data,” “a” is again an accumulated intermediate value, “p” stands for or “part” (as in “part” contributing to the result), and “r” stands for “result.”
b shows a next stage at which a first data sample value (d0) has been received into d-bin 84(0). Calculation proceeds as shown, essentially contemporaneously and in parallel throughout the length of the pipeline, with a first part value (p0) being provided to the p-bin 86. However, unlike the variation using the conventional convolution algorithm shown in
c shows a next stage at which the prior data sample value (d0) has been moved to d-bin 84(1) and a second data sample value (d1) has been received into d-bin 84(0). Calculation again proceeds as shown, essentially contemporaneously and in parallel throughout the length of the pipeline, with a second part value (p1) now being provided to the p-bin 86. The previous part value (p0) is added to the present portion value (p1), and this is then stored as a second result value (r1) in r-bin 88(1).
Between
d shows a stage at which the last data sample value (dm) has been received into d-bin 84(0). Yet again, calculation proceeds as shown, with an mth result value (rm) now being stored in r-bin 88(m).
e shows a next stage. Having now partially processed all of the m+1 data sample values (d0 . . . dm), the last data sample value (dm) has been moved to d-bin 84(1) and a zero value is put into d-bin 84(0). Calculation proceeds and a result value (rm+1) is stored in r-bin 88(m+1).
Between
f shows a stage at which the last data sample value (dm) is finally finishing being processed. After calculation here an (m+m−1)th result value (r2m−1) is stored in r-bin 88(2m−1) and processing is complete. The r-bins 88(0 . . . 2m−1) now hold the full result of the convolution calculation performed here based on the m+1 data sample values (d0 . . . dm) and the m+1 derivation convolution coefficient values (c′0 . . . c′m).
Summarizing, from the above it should now be clear that the inventive convolution system 10 permits completing substantial portions of the necessary calculations in parallel, rather than serially. For instance, in the simplified examples just described, 22 of the processors 14 are performing calculations in parallel. Note, all 24 of the processors 14 in a SEAforth-24A device could have also been employed, but this would not be as fast because processor 14a and processor 14x would then have to do double-duty to cover both calculation and I/O.
As noted at the beginning of this section, the inventive convolution system 10 also permits employing a new class of algorithms, and aspects of this are now discussed.
a shows a first trace 92 representing the use of conventional convolution coefficients and a second trace 92′ representing the use of derivation convolution coefficients, that is, ones usable by the new class of algorithms and which may be used in the present invention.
The trace 92′ is represented by u′(t). The trace 94 is represented by the equation:
And the trace 94′ is represented by v′(t). Here t is defined on the interval from −1 to 1 with step size 0.01, i ranges from 1 to q by step size of 1, and q is the number of data points (2000 in this example) that pass through the filter function. Collectively,
Yet other approaches are possible using the new class of algorithms. For example, with reference again to
Some important considerations when using derivation, in any of the approaches, follow from the effort required to obtain a function derivation. In convolution calculations the number of data sample values used will usually exceed the number of coefficient values being used. Accordingly, it follows that less effort will typically be needed to obtain a derivation of the filter function than will be needed to obtain a derivation of the data function. Of course, particular situations may exist where little or no extra effort is needed to obtain the derivation of a data function, but this will likely be rare. Furthermore, since the filter coefficient values will frequently be the same when performing multiple convolution calculations on what will typically be different data sample values, the effort put into obtaining the filter coefficient values is a reusable or “amortized” effort. In deed, in many applications this effort will be expended in design and the filter values can be entered as program constants (e.g., even stored in the ROM 32 of a device like the SEAforth-24A).
Continuing again with
For instance, the convolution filter values in trace 92 might have to be expressed using 18-bit values, whereas the values used for the inventive approach in trace 92′ might be expressed using 9-bit or even fewer-bit values. Similarly, one can consider that the data sample values used in trace 94 might have to be expressed using 18-bit values, whereas the values used for the inventive approach in trace 94′ might be expressed using 9-bit or even fewer-bit values. It has been the present inventor's observation that using all 9-bit values can provide roughly a four fold (4×) speed increase in the inventive convolution system 10.
Digital processors are inherently limited with respect to the sizes of the values that they can directly perform operations on. For example, the 4004 processor introduced by Intel Corporation in 1971 handled 4-bit values and the processors in most current-generation personal computers directly handle 32- or 64-bit values. Also, multiplication of large values is generally one of the slowest operations available in most processors today. It has been the present inventor's observation that multiplication operations can account for 60-90% of the execution time of a convolution algorithm.
The SEAforth-24A device is no exception to these general principles of digital processors. It employs the Forth language and relies on numeric values being represented with 18 bits for unsigned values (or 17 bits for signed values), or as being represented with 9 bits for unsigned values (or 8 bits for signed values). If a value requires 10 bits, for example, it effectively therefore must be treated the same as if it requires 18 bits. With reference briefly back to
The equivalent here to multiplying two 18-bit values in the Forth language in a processor 14 requires the following sequence of thirty six operational codes (where “.” Represents the nop or no-operation instruction and “+*” represents the plus-star or bit-wise multiply instruction):
.+*.+*.+*.+*.+*.++*.+*.+*.+*.+*.+*.+*.+*.+*.+*+*.+* (9)
In contrast, the equivalent here to multiplying one 18-bit value and one 9-bit value in the Forth language in a processor 14 requires the following sequence of eighteen operational codes:
.+*.+*.+.+*.+*.+*.+*.+*.+* (10)
And the equivalent here to multiplying two 9-bit values in the Forth language in a processor 14 requires the following sequence of nine operational codes:
+*+*+*+*+*+*+*+*+* (11)
Clearly, from the standpoint of computational burden and achievable speed, calculating equation (9) is the least preferred task and calculating equation (11) is the most preferred task. These can be spoken of as running at 1×, 2×, and 4× speeds, respectively.
A more rigorous “proof” for the conceptual basis of the above is now presented. The new class of algorithms employable by inventive convolution system 10 uses a derivative representation instead of the direct representation of the integral kernel (see e.g., equation (1) and the Background Art section, generally). The following is essentially a restatement of equation (5):
where f(t−τ) represents the integral kernel. However, suppose instead that the integral kernel is represented by f′(t−τ). This results in the following:
Now assuming that the integral kernel is a particular low pass filter or can be represented by a low pass filter, then the following approximation is reasonable:
f′(ct−k)=f(ct−k)−f(ct−k−Δtk), (14)
and it follows that:
At this point it is easy to see that the first sum to the right of the equals sign in equation (14) is simply r(t). What is not so obvious is that the second term to the right of the equals sign is simply just the previous convolution value from just one time step Δτ ago, and that this can be represented in the following way:
Hence the following relationship holds between convolution utilizing direct integral kernel relationship and convolution utilizing derivative of direct integral kernel relationship:
r′(t)=r(t)−r(t−Δτ)→r(t)=r′(t)+r(t−Δτ). (17)
An important observation here is to realize that convolution utilizing the direct representation is exactly the same as the addition of the convolution utilizing the derivation of the kernel and the previously calculated convolution. This is the same as saying the new sum equals the old sum plus whatever has just been calculated.
Applying this in the context of the new class of algorithms that are usable in the inventive convolution system 10, the direct filter coefficient values (c0 . . . cn) can be used to compute the derivation coefficient values (c′0 . . . c′n+1) in the following way: c′0=c0−0; c′1=c1−c0; c′2=c2−c1; . . . ; c′n=cn−cn−1; and c′n+1=0−cn. However, if the value of c0 is non-zero, then we simply have c′0=c0−0=c0. Similarly, if c0 is zero, then we simply have c′0=0−0=0 and there is no reason to even associate a derivation filter value with the value zero, because it will not contribute towards the accumulated intermediate value (a0). This reasoning can be extended to any direct filter value or to any derivation of a direct filter value that is zero, because it is not necessary to associate a filter coefficient value with a particular node if it will not contribute to the accumulated intermediate value calculated at that node. Nonetheless, other than for the first node, the partial sum at each node still must be accounted for.
Turning now to why the index n was used in
Note also, the discussion herein was simplified by using equal numbers of convolution coefficient values and sample data values. If one had 22 sample data values to process when using the direct-based algorithm they would need 23 sample data values to process when using the derivation-based algorithm. Of course, 22 actual data values could be used and “padded” with 23 value of zero. More typically, however, this will be a non-issue because a large quantity, potentially approaching an infinite quantity, of sample data values will be used in most real-world applications.
In summary, a benefit of utilizing a derivation representation instead of direct representation is that the values required to represent the amplitude of a derivation are often much smaller in magnitude than the values used to represent the amplitude of a direct filter. What transpires in terms of the SEAforth-24A device, again using it as an example, is that instead of needing a full 18-bit data word to represent an amplitude value it will often be the case that a 9-bit data word is sufficient. There are two requirements that allow 9-bit representation to be considered sufficient. The first is that the coefficient values be represented in 9 bits unsigned (or 8 bits signed). The second condition is that the difference between successive direct filter coefficient values is represented by 9 bits unsigned (or 8 bits signed). In the case of a typical low pass filter, such as that used in the example presented in
An item 702 is a compiler instruction equating “IO” with the IOCS-register 50. This will specify where data is both read from and written to. Note, the IOCS-register 50 in the SEAforth 24A device can concurrently specify reading from and writing to different ports 52. To avoid confusion, those familiar with less sophisticated devices should keep this in mind when reading the following.
An item 704 is a compiler instruction equating “H” with a coefficient value. Here “123” is simply a value being used for the sake of example. This will be what is in the c-bin 72 for this processor 14.
An item 706 is a comment in the Forth language.
An item 708 is a location label in the Forth language.
An item 710 is a sequence of Forth instructions that initializes the processor 14 for the convolution calculation to follow. Specifically, IO is loaded into the top of the data stack; then popped from there into the B-register 46 so that it points to the IOCS-register 50; then H is loaded into the top of the data stack; and a nop pads the 18-bit instruction word used here to contain this instruction sequence.
An item 712 specifies the beginning of a loop within which three cases are dealt with by conditional compilation. This programs the processor 14 depending upon whether is to be the first (processor 14b), a middle (any of processors 14c-v), or the last (processor 14w) in the pipeline. See also,
An item 714 here specifies the start of compilation of instructions for the most typical case, the one where the subject processor 14 is one of processors 14c-v.
[N.b., the right-side comments on the instruction words in
An item 716 is another sequence of Forth instructions. Specifically, a data sample value (s) is read from where the B-register 46 points to and is pushed onto the data stack (h—s h); then an accumulation value (a) is also read and pushed onto the data stack (s h—a s h); then the top element on the data stack is popped and pushed onto the top of the return stack (D: a s h—s h R:—a); then the top element on the data stack is replicated and pushed onto the data stack (D: s h—s s h R: a—a).
An item 718 follows, where the top element on the data stack is popped and pushed onto the top of the return stack (D: s s h—s h R: a—s a); then a large multiply (“MULT,” a definition provided in the BIOS of the SEAforth 24A device) is performed. The top two elements of the data stack are used here as a multiplier and a multiplicand, and the top element is replaced with the result (a′) while the multiplicand is left as is as the second element in the data stack (D: s h—a′h R: s a—s a).
An item 720 follows, where the top element on the return stack is popped off and pushed onto the data stack (D: a′ h—s a′ h R: s a—a); the top element of the data stack is popped off and written to where the B-register 46 points to (D: s a′ h—a′ h R: a—a); the top element of the return stack is popped off and pushed onto the data stack (D: a′ h—a a′ h R: a—); and a nop pads the 18-bit instruction word used.
An item 722 follows, where the top two elements of the data stack are added together, the top is replaced with the new accumulated sum (a″) and the second is replaced with the next lower element (D: a a′ h—a″ h R:—).
An item 724 follows, ending the conditional compilation of the code for the case here where the subject processor 14 is one of processors 14c-v.
Understanding the other two conditional compilation options shown in
Finally, an item 726 is an instruction sequence that is compiled for all of processors 14b-w, where the top element of the data stack is popped off and written to where the B-register 46 points (D: a″ h—h R:—); and the loop then returns to item 712.
a-b are a code listing of an exemplary derivation filter 800, wherein
As can be seen in
An item 804 is a sequence of Forth instructions that initializes a portion value (p) in the return stack to zero. Specifically, here, a literal is placed on the data stack (D: h—p h R:—); then pushed from there onto the top of the return stack (D: p h—h R:—p); and two nops are used to fill out the instruction word. [Note, this particular approach was chosen to facilitate conceptual comparison with the direct filter 700, and skilled programming artisans will readily appreciate that there are more efficient and elegant ways to handle this.]
An item 806 then handles the additional addition employing the current portion value (p). The current portion value (p) is popped of the return stack and pushed onto the data stack (D: a″ h—p a″ h R: p—); a first nop buys time before the next instruction; the top two elements of the data stack are added together, wherein the top is replaced with the sum which is both the next portion value (p′) as well as the accumulated sum (a″), and the second is replaced with the next lower element (D: p a″ h—p′ h R:—); and a second nop pads the 18-bit instruction word.
An item 808 then retains the accumulated sum (a″) in the return stack as a next portion value (p′). The accumulated sum (a″) is replicated (D: a″ h—p′ a″ h R:—); the next portion value (p′) is popped off of the data stack and pushed onto the return stack (D: a″ h—a″ h R:—p′); and two nops pad out the 18-bit instruction word.
Turning now to
An item 810 is a comment in the Forth language and an item 812 is a location label in the Forth language. This code could be conditionally compiled, by adding appropriate complier directives to the code in
An item 814 is a sequence of Forth instructions that, first, fetches the value of 10 into the B-register 46 and, second, fetches the value $3F (a port address) into the A-register 44.
An item 816 is another sequence of Forth instructions. Specifically, one that zeros the data stack. The top element on the data stack is replicated and pushed onto the data stack, and then this is done again (it is irrelevant what that top element is). Then the two topmost elements are popped off of the data stack, XOR'ed, and the result (zero) pushed back onto the data stack.
An item 818 specifies the beginning of a loop.
An item 820 is another sequence of Forth instructions. Specifically, a value is read from where the B-register 46 points to and is pushed onto the data stack; then the top two elements on the data stack are added and replace the top element (and the second element is replaced with the next lower element); then the top element on the data stack is replicated and pushed onto the data stack; and then the top element is popped off of the data stack and written to where the A-register 44 points. The net result of this is that the sum is output while a copy is also kept (accumulated) for the next execution of the loop.
And an item 822 is were the loop then returns to item 818.
As can be seen, the derivation-based algorithm used by the present inventive convolution system 10 requires very little additional code.
While various embodiments have been described above, it should be understood that they have been presented by way of example only, and that the breadth and scope of the invention should not be limited by any of the above described exemplary embodiments, but should instead be defined only in accordance with the following claims and their equivalents.
Number | Date | Country | |
---|---|---|---|
60910626 | Apr 2007 | US |