Motorola SC140 user manual Split Summation Exercise, y = ∑ x 2, Good To Know

Models: SC140

1 40
Download 40 pages 24.33 Kb
Page 16
Image 16
5 Split Summation Exercise

Compiler Support on StarCore

12.Type next to step through the code.

13.Look at the register contents in the session window and write the values in the Simulator Columns boxes above for both sections.

Congratulations, you have completed Exercise 4.

.

Good To Know

Unaligned data accesses lead to erroneous results.You must consider these issues when developing assembly code.

5 Split Summation Exercise

The split summation exercise shows how to modify C code using the split summation technique to get better parallelization. The split summation technique helps to maximize the multiple-ALU loading by performing arithmetic operations in parallel while requiring little algorithmic or code modifications. To illustrate this technique, the example performs the the optimization of the energy of a signal calculation already considered in Exercise 2. The power calculation is represented in Equation 2:

N – 1

 

y = x2(i) ,

(2)

where x(i) is the signal input sample at iteration i, y is the power of the signal, and N is the signal length. As Exercise 2 shows, computing the signal energy directly from Equation 2 results in the use of only one ALU out of the four with one multiply-accumulate operation performed at each iteration. However, the split summation technique can load all four ALUs. Equation 2 is expanded as follows:

N – 1

 

y = x( i)x(i) + x(i + 1)x(i + 1) + x( i + 2)x(i + 2) + x(i + 3)x(i + 3)

(3)

i = 0, 4, 8, …

 

Equation 3 explicitly highlights the four multiply-accumulate operations that can be performed in parallel. Figure 9 highlights where each parallel execution is represented by Group 0, Group 1, and so on. It also shows that the sample number, i, from one group to the other is incremented by four.

y =

x(i) * x(i) + x(i+1) * x(i+1) + x(i+2) * x(i+2) + x(i+3) * x(i+3)

Group 0 (First cycle)

+

x(i+4) * x(i+4) + x(i+5) * x(i+5) + x(i+6) * x(i+6) + x(i+7) * x(i+7)

Group 1 (Second cycle)

+ ...

Figure 9. Signal Power Calculation Using the Split Summation Technique

16

Introduction to the SC140 Tools

Page 16
Image 16
Motorola SC140 user manual Split Summation Exercise, y = ∑ x 2, Good To Know