In an mxn matrix, where the row index varies from 1 to m and column index from 1 to n, aij denotes the number in the h row and the jh column. In the computer's memory, all elements are stored linearly...


In an mxn matrix, where the row index varies from 1 to<br>m and column index from 1 to n, aij denotes the number<br>in the h row and the jh column. In the computer's<br>memory, all elements are stored linearly using contiguous<br>addresses. Therefore, to store a two-dimensional matrix,<br>two-dimensional address space must be mapped to one-<br>dimensional address space. In the computer's memory,<br>matrices are stored in either row-major order or column- Column-major order<br>major order form. In row-major order, the consecutive<br>elements of a row reside next to each other. In column-<br>major order, the consecutive elements of a column reside<br>Row-major order<br>a a12 a13<br>a22 a23<br>с.<br>a1 a12 a3<br>a22<br>a23<br>[5 1]<br>4 3<br>6 8<br>l2 7]<br>81<br>next to each other. Consider the matrix A =<br>Base<br>address of the matrix is 3FA2H. Each element is stored in 2 bytes. Each memory<br>location is one byte long.<br>i. Give the addresses of 4 and 8 if the matrix is stored in row-major order.<br>ii. Give the addresses of 3 and 2 if the matrix is stored in column-major order.<br>iii. Give the element stored at the base address in both orders.<br>

Extracted text: In an mxn matrix, where the row index varies from 1 to m and column index from 1 to n, aij denotes the number in the h row and the jh column. In the computer's memory, all elements are stored linearly using contiguous addresses. Therefore, to store a two-dimensional matrix, two-dimensional address space must be mapped to one- dimensional address space. In the computer's memory, matrices are stored in either row-major order or column- Column-major order major order form. In row-major order, the consecutive elements of a row reside next to each other. In column- major order, the consecutive elements of a column reside Row-major order a a12 a13 a22 a23 с. a1 a12 a3 a22 a23 [5 1] 4 3 6 8 l2 7] 81 next to each other. Consider the matrix A = Base address of the matrix is 3FA2H. Each element is stored in 2 bytes. Each memory location is one byte long. i. Give the addresses of 4 and 8 if the matrix is stored in row-major order. ii. Give the addresses of 3 and 2 if the matrix is stored in column-major order. iii. Give the element stored at the base address in both orders.

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here