Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider a machine with a byte addressable ma... Start Learning for Free
Consider a machine with a byte addressable main memory of bytes. Assume that a direct mapped data cache consistingof 32 lines of 64 bytes each is used in the system. A 50 x 50 two-dimensional array of bytes is stored in the main memorystarting from memory location 1100H. Assume that the data cache is initially empty. The complete array is accessed twice.Assume that the contents of the data cache do not change in between the two accesses.Which of the following lines of the data cache will be replaced by new blocks in accessing the array for the second time?
  • a)
    line 4 to line 11
  • b)
    line 4 to line 12
  • c)
    line 0 to line 7
  • d)
    line 0 to line 8
Correct answer is option 'A'. Can you explain this answer?
Verified Answer
Consider a machine with a byte addressable main memory of bytes. Assum...
Cache Organization:
Staring Address=1100H = 163+162+0+0 =4352B is the starting address.
We need to find Starting block = 4352B/64B = 68th block in main memory from where array start storing elements.
50*50B =array size = 50*50B/64B =39.0625 blocks needed =approx = 40 blocks
68,69,70....107 block we need = 40 blocks starting block is 68 mod 32 = 4th cache block and after that in sequence they will be accessed.
as shown in below table line no 4 to 11 has been replaced by array in second time





 
This question is part of UPSC exam. View all Computer Science Engineering (CSE) courses
Most Upvoted Answer
Consider a machine with a byte addressable main memory of bytes. Assum...
Byte Addressable Main Memory and Direct Mapped Data Cache

• The byte addressable main memory has a capacity of bytes.

• The direct mapped data cache consists of 32 lines of 64 bytes each.

• A 50 x 50 two-dimensional array of bytes is stored in the main memory starting from memory location 1100H.

• The data cache is initially empty.

• The complete array is accessed twice.

• The contents of the data cache do not change in between the two accesses.

Determination of the Replaced Lines in Data Cache

• To determine the lines of the data cache that will be replaced by new blocks in accessing the array for the second time, we need to calculate the line numbers that correspond to the memory locations of the array.

• The array occupies a total of 50 x 50 = 2500 bytes in the main memory, starting from memory location 1100H.

• The memory locations of the array range from 1100H to 1373H.

• To find the line number of a memory location in the data cache, we use the formula:

line number = (memory location mod cache size) / block size

• Here, cache size = 32 lines x 64 bytes/line = 2048 bytes

• Block size = 1 byte (since the array consists of bytes)

• Using the above formula, we can calculate the line numbers for the memory locations of the array.

• For example, the line number for memory location 1100H is (1100 mod 2048)/1 = 108.

• Similarly, we can calculate the line numbers for all the memory locations of the array.

• Since the array is accessed twice and the contents of the data cache do not change in between the two accesses, the same lines of the data cache will be used for both accesses.

• Therefore, the lines of the data cache that will be replaced by new blocks in accessing the array for the second time are the lines that correspond to the memory locations of the array and are not already present in the data cache.

• These lines are line 4 to line 11, which correspond to the memory locations 1140H to 11F3H.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Consider a machine with a byte addressable main memory of bytes. Assume that a direct mapped data cache consistingof 32 lines of 64 bytes each is used in the system. A 50 x 50 two-dimensional array of bytes is stored in the main memorystarting from memory location 1100H. Assume that the data cache is initially empty. The complete array is accessed twice.Assume that the contents of the data cache do not change in between the two accesses.Which of the following lines of the data cache will be replaced by new blocks in accessing the array for the second time?a)line 4 to line 11b)line 4 to line 12c)line 0 to line 7d)line 0 to line 8Correct answer is option 'A'. Can you explain this answer?
Question Description
Consider a machine with a byte addressable main memory of bytes. Assume that a direct mapped data cache consistingof 32 lines of 64 bytes each is used in the system. A 50 x 50 two-dimensional array of bytes is stored in the main memorystarting from memory location 1100H. Assume that the data cache is initially empty. The complete array is accessed twice.Assume that the contents of the data cache do not change in between the two accesses.Which of the following lines of the data cache will be replaced by new blocks in accessing the array for the second time?a)line 4 to line 11b)line 4 to line 12c)line 0 to line 7d)line 0 to line 8Correct answer is option 'A'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Consider a machine with a byte addressable main memory of bytes. Assume that a direct mapped data cache consistingof 32 lines of 64 bytes each is used in the system. A 50 x 50 two-dimensional array of bytes is stored in the main memorystarting from memory location 1100H. Assume that the data cache is initially empty. The complete array is accessed twice.Assume that the contents of the data cache do not change in between the two accesses.Which of the following lines of the data cache will be replaced by new blocks in accessing the array for the second time?a)line 4 to line 11b)line 4 to line 12c)line 0 to line 7d)line 0 to line 8Correct answer is option 'A'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider a machine with a byte addressable main memory of bytes. Assume that a direct mapped data cache consistingof 32 lines of 64 bytes each is used in the system. A 50 x 50 two-dimensional array of bytes is stored in the main memorystarting from memory location 1100H. Assume that the data cache is initially empty. The complete array is accessed twice.Assume that the contents of the data cache do not change in between the two accesses.Which of the following lines of the data cache will be replaced by new blocks in accessing the array for the second time?a)line 4 to line 11b)line 4 to line 12c)line 0 to line 7d)line 0 to line 8Correct answer is option 'A'. Can you explain this answer?.
Solutions for Consider a machine with a byte addressable main memory of bytes. Assume that a direct mapped data cache consistingof 32 lines of 64 bytes each is used in the system. A 50 x 50 two-dimensional array of bytes is stored in the main memorystarting from memory location 1100H. Assume that the data cache is initially empty. The complete array is accessed twice.Assume that the contents of the data cache do not change in between the two accesses.Which of the following lines of the data cache will be replaced by new blocks in accessing the array for the second time?a)line 4 to line 11b)line 4 to line 12c)line 0 to line 7d)line 0 to line 8Correct answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Consider a machine with a byte addressable main memory of bytes. Assume that a direct mapped data cache consistingof 32 lines of 64 bytes each is used in the system. A 50 x 50 two-dimensional array of bytes is stored in the main memorystarting from memory location 1100H. Assume that the data cache is initially empty. The complete array is accessed twice.Assume that the contents of the data cache do not change in between the two accesses.Which of the following lines of the data cache will be replaced by new blocks in accessing the array for the second time?a)line 4 to line 11b)line 4 to line 12c)line 0 to line 7d)line 0 to line 8Correct answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider a machine with a byte addressable main memory of bytes. Assume that a direct mapped data cache consistingof 32 lines of 64 bytes each is used in the system. A 50 x 50 two-dimensional array of bytes is stored in the main memorystarting from memory location 1100H. Assume that the data cache is initially empty. The complete array is accessed twice.Assume that the contents of the data cache do not change in between the two accesses.Which of the following lines of the data cache will be replaced by new blocks in accessing the array for the second time?a)line 4 to line 11b)line 4 to line 12c)line 0 to line 7d)line 0 to line 8Correct answer is option 'A'. Can you explain this answer?, a detailed solution for Consider a machine with a byte addressable main memory of bytes. Assume that a direct mapped data cache consistingof 32 lines of 64 bytes each is used in the system. A 50 x 50 two-dimensional array of bytes is stored in the main memorystarting from memory location 1100H. Assume that the data cache is initially empty. The complete array is accessed twice.Assume that the contents of the data cache do not change in between the two accesses.Which of the following lines of the data cache will be replaced by new blocks in accessing the array for the second time?a)line 4 to line 11b)line 4 to line 12c)line 0 to line 7d)line 0 to line 8Correct answer is option 'A'. Can you explain this answer? has been provided alongside types of Consider a machine with a byte addressable main memory of bytes. Assume that a direct mapped data cache consistingof 32 lines of 64 bytes each is used in the system. A 50 x 50 two-dimensional array of bytes is stored in the main memorystarting from memory location 1100H. Assume that the data cache is initially empty. The complete array is accessed twice.Assume that the contents of the data cache do not change in between the two accesses.Which of the following lines of the data cache will be replaced by new blocks in accessing the array for the second time?a)line 4 to line 11b)line 4 to line 12c)line 0 to line 7d)line 0 to line 8Correct answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider a machine with a byte addressable main memory of bytes. Assume that a direct mapped data cache consistingof 32 lines of 64 bytes each is used in the system. A 50 x 50 two-dimensional array of bytes is stored in the main memorystarting from memory location 1100H. Assume that the data cache is initially empty. The complete array is accessed twice.Assume that the contents of the data cache do not change in between the two accesses.Which of the following lines of the data cache will be replaced by new blocks in accessing the array for the second time?a)line 4 to line 11b)line 4 to line 12c)line 0 to line 7d)line 0 to line 8Correct answer is option 'A'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev