Array address calculation 2011

A square matrix A[mxm] is stored in the memory with each element requiring 2 bytes of storage. If the base addressA[1][1] is 1098 and the address at A[4][5] is 1144, determine the order of the matrix A[mxm] when the matrix is stored Column Major wise
B= 1098, W =2, n=m
1144 = 1098 + 2 [m(5-1) + (4-1)]
= 1144 = 1098 + 8m +6
8m = 40
m = 5
The order of matrix is [5×5]

This entry was posted in address. Bookmark the permalink.

Leave a Reply

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