20 pts What is the address of element 19 25 of a150 by 200 a
(20 pts) What is the address of element (19, 25) of a150 by 200 array of words whose base address is 0x1004 52C4D? (Show your work)
If it is a column major array?
Solution
Assumption : Size of Word is 2 Bytes
Element (19, 25) of a150 by 200 array of words
Row = 19, Column = 25, Number of Rows = 200
Formula for calculating address of element under Column Major Array is
OFFSET = (Column x NUMROW) + row
OFFSET = (25 x 200) + 19 = 5000 + 19 = 5019 => 0x139B
Address of element (19, 25) = (First Address + OFFSET) x Size of Word
Address of element (19,25) = (0x1004 52C4D + 0x139B) x 2 = 0x2008A8090
