Prashnikaप्रश्निका
Code
About
‹ Back to the paper

Question 2(ii)

2 marks

Computer ScienceISC 2023 Specimen Computer Science Paper 1NumericalArrays, Strings

Answer the following.

A matrix N[11][8] is stored in the memory with each element requiring 2 bytes of storage. If the…

A matrix N[11][8] is stored in the memory with each element requiring 2 bytes of storage. If the base address at N[2][3] is 2140, find the address of N[7][5] when the matrix is stored in Row Major Wise.
Open in the 2D array visualiser

Answer

Answer

Row Major formula relative to a known base address: $Address(N[i][j]) = Base(N[2][3]) + W \times [(i-2)\times C + (j-3)]$, where $C$ = number of columns = 8, $W$ = 2 bytes For $N[7][5]$: $= 2140 + 2 \times [(7-2)\times 8 + (5-3)]$ $= 2140 + 2 \times [40+2]$ $= 2140 + 84$

Final answer: 2224 bytes (address)