A b) COMP is a two dimensional annay with 10 nows and
5 columns. Each elements of the annay is stoned
in a memory location. If COMP [1] [2] begin at Addness
400. find the location COMP [4] [5] the annangement:
6 Column
major .
a) Row major
Answers
Answered by
2
Answer:
Address of [I, J]th element in row-major = B + W[C(I – Lr) + (J – Lc)]
Column-major Implementation
In this method, the first column elements are placed first, then the second column elements and so on.
The formula to calculate the address of [I, J]th block is:
Address of [I, J]th element in column-major = B + W[R(J – Lc) + (I – Lr)]
Note that:
B is the base address (address of the first block in the array).
W is the width in bytes (size in bytes for each block in the array).
Lr is the index of the first row.
Lc is the index of the first column.
R is the total number of rows.
C is the total number of columns.
OPTION [ A ] IS THE ANSWER
Similar questions
Science,
2 months ago
English,
2 months ago
Math,
4 months ago
English,
11 months ago
India Languages,
11 months ago