
166 Energy-Aware Memory Management for EMSs
The following example illustrates both the storage order and the execution
order in a formal way:
Example 5.4
int A[10][20], B[10][10];
int C[10];
for(i=0;i<2;i++)
for(j=0;j<5;j++)
S1: A[i][j] = (B[i][j] + C[i]);
As explained in the previous example, the execution order of statement S1 is
as follows:
O
time
1
(i, j)=5∗ i + j
For the arrays A, B, and C, the storage address can be written as functions
of their dimensions of their respective variable domains:
O
addr
A
(a
1
,a
2
,N)=N ∗ a
1
+ a
2
N =10
O
addr
B
(b
1
,b
2
,N)=N ∗ b
1
+ b
2
N =10
O
addr
C
(c
1
,N)=c
1
N = 10 (5.1)
Example 5.5 For the above example, the execution order has been ex-
plained ...