Consider a memory is consists of 1024 frames (0 to 1023), each frame c...
Since the first element A [0] [0] is at frame 1 and byte 0
Before reaching A[60] [100] the array element A[60][99] element has been stored
So total 60 complete row already been stored containing 60 ´ 512 + 100 = 30820 elements
Number of blocks required is 30820/64 = 481.5625.c
So we required total 481 complete block so address will go on 482nd block.
View all questions of this test
Consider a memory is consists of 1024 frames (0 to 1023), each frame c...
The given problem involves determining the memory address of a specific element in a 2-dimensional array stored in memory. We are given that the memory consists of 1024 frames, each containing 64 bytes. Let's break down the solution step by step:
1. Frame Calculation:
- Each frame contains 64 bytes, and we have a total of 1024 frames. Therefore, the total memory size is 1024 * 64 = 65536 bytes.
2. Array Size Calculation:
- The array A has dimensions of 512x512.
- Each element in the array is of size 1 byte.
- Therefore, the total size of the array is 512 * 512 * 1 = 262144 bytes.
3. Frame Number Calculation for A[60][100]:
- To calculate the frame number, we need to find the offset of the desired element within the array.
- The offset can be calculated by multiplying the row index by the number of columns and adding the column index. In this case, it would be: (60 * 512) + 100 = 30720 + 100 = 30820.
- Since each frame contains 64 bytes, we can divide the offset by 64 to find the frame number: 30820 / 64 = 481.5625.
- Since the frame number is a whole number, we can round it up to the nearest integer to get the frame number: 482.
4. Memory Address Calculation:
- The memory address of the desired element can be calculated by multiplying the frame number by the size of each frame (64 bytes) and adding the byte offset within the frame.
- The byte offset within the frame can be calculated by taking the remainder of the offset divided by the size of each frame: 30820 % 64 = 20.
- Therefore, the memory address of A[60][100] would be: (482 * 64) + 20 = 30848.
Therefore, the correct answer is option 'C', which states that the address of A[60][100] is in the 482nd frame.