Array address calculation 2018

A matrix A[m][m] is stored in the memory with each element requiring 4 bytes of storage. If the base address at A [1][1] is 1500 and address of A [4][5] is 1608, determine the order of matrix when it is stored in Column Major Wise.

Column Major Wise: P[i][j] = BA + W [ (j – lc )* rows + (i – lr]
Putting the values: 1608 = 1500 + 4[ (4*m + 3)]
1608 = 1500 + 16m + 12
16m = 1608-1512
m = 6

This entry was posted in address. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *