Question #150838
Consider a 420 x 680 matrix array SCORE. Suppose Base (SCORE) = 1001 and there
are 2 words per memory cell. Assume that the first element of the array is SCORE
[1,1]. Find the address of SCORE [100, 260] when the array is stored in
i. row major order
ii. column major order.
1
Expert's answer
2020-12-13T22:57:27-0500

As per the given question,

Matrix array= SCORE[420][680]

Base element of the array SCORE[1][1]=1001

number of memory per words = 2

Address of SCORE[100][260]

i) When array stored in row major order

address at SCORE[100][260]=1001+2(680(1001)+(2601))SCORE[100][260]=1001+2(680(100-1)+(260-1))

=1001+2(680×99+259)=1001+2(680\times 99+259)

=1001+135158=1001+135158

=136159=136159

ii) When array stored in column major order

SCORE[100][260]=1001+2[420(2601)+(1001)]SCORE[100][260]=1001+2[420(260-1)+(100-1)]

=1001+217758=1001+217758

=218759=218759


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS