University of Nevada Las Vegas
Howard R. Hughes
College of Engineering
Department of Computer Science
My Home Page
Course Page

CSC 477/677
Test date: Wednesday, November 13, 2013, 2:30 PM.
Answer to Problem 7 on the Practice Exam. (Unless I made a mistake in these
calculations.)
The predecessors of A[3,5,6] can be listed in three blocks as follows:
A[0,3,1] ... A[5,8,5] this is a 3-D block of size 6×6×5 = 180
A[0,3,6] ... A[5,4,6] this is a 2-D block of size 6×2×1 = 12
A[0,4,6] ... A[2,4,6] this is a 1-D block of size 3×1×1 = 3
Thus, the number of predecessors is 195. Each predecessor takes 3 places,
so the offset is 195×3 = 585. Thus the base address of A[3,5,6]
is 1024+585 = 1609. The three addresses occupied by A[3,5,6] are
1609, 1610, and 1611.

Why have I told you not to memorize any formulas for these
problems?
Because there are several formulas, and you will forget them after you take
the class. But you will (hopefully) remember that the secret is to
count the predecessors.

Back to
Course Page