Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C program Make sure it runs please and well documented You already have got some idea about Memory Hierarchy. In the memory hierarchy if the
C program Make sure it runs please and well documented
You already have got some idea about Memory Hierarchy. In the memory hierarchy if the processoricpu needs some data, it searches the data in the following way: Cache->Memory->Disk In this assignment you have to implement some kind of demo memory hierarchy using c code Assume that you have cache, memory and disk of size 4 blocks, 16 blocks and 256 blocks respectively. Each block of the cache, memory and disk contains 4 bytes of data (which is equivalent of the size of one integer). So, whenever processor requests for some data, the transfer is made in blocks To incorporate the scenario into your demo memory hierarchy code, you can define your cache, memory and disk in terms of array. Say for example: Int cachel4] Int memory[16]: Int disk[2561 Initially only the disk would have some value. The value of each array would be: disk: Value 01 2 3 4 5 6 7 8 9 1011 12255 memory Index 0 1 2 3 4 5 6 7 8 910 11 12 13 14 15 Value cache Index
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started