Question

In: Computer Science

Draw the cache tables and the state of all bits within them. Suppose you have a...

Draw the cache tables and the state of all bits within them.

Suppose you have a 16 byte cache with 2 byte long cachelines that is 2-way set associative and write-back. Further assume that prior to processing any read/write requests the state of memory is M[a] = a, or another words, the byte at address 0 is 0, address 1 is 1, address 2 is 2, and so on. Assume an *8 bit* long address. Along with depicting the cache tables, please answer the following questions:

How many bits are devoted to the line size?

How many bits are devoted to the index?

How many bits are devoted to the tag?

Here is the sequnce of read/write requests:

    Read 0x01
    Read 0x02
    Read 0x03
    Write 0x05, Value=100
    Write 0x06, Value=101
    Write 0x07, Value=102
    Write 0x06, Value=103
    Read 0x03
    Read 0x07
    Read 0x01
    Read 0x02
    Read 0x03

How many accesses hit in the cache?

How many accesses missed?

How many times did the cache write values back to main memory?

Solutions

Expert Solution

GIVEN THAT

from the given data

cache size =16 bytes

cache line =2 bytes

we know that

total cache blacks=

=8 blacks

the cache given is 2 way set associative

hence

total no .of sets=

=4 sets

the total no.of bits required to address cache black

16*8

=

=7 bits

the total no.of bits required for line size

line size

2 bytes=16 bytes

=

=4 bytes (for line size)

Tag set index cache black

here

total number of sets=4

2 bits required for indexing

how

address size of given cache black=7 bits

i.e= (size)

tag+index+cache black=7 bits

tag+2+4=7

tag=1 bit

Tag

1 bit

Set index

2 bit

cache black

4 bits

from the given data eachb cache line helds 2 bytes

Total cache byte is 16 bytes by the following cache can be depicted

   byte 1

byte 3

byte 5

byte 7

   byte 9

   byte 11

   byte 13

byte 15

Input:

1. read 0*01

2. read 0*02

3 read 0*03

4 write 0*05 ,value=100

5 write 0*06, value=101

6 write 0*07 , value=102

7 write 0*06 , value=103

8 read 0*03

9 read 0*07

10 read 0*01

11 read 0*02

12 read 0*03,

we need an update to main memory can be done at the end

important points to remember:

In case of miss cache , if needs as entire from main memory

Example

if it wants to read 0*00

when in case of miss

if reads 0*00 and 0*2 enitre black

There are total in struction-12

Instruction no miss/hit

1 miss

2 miss

3 hit

4 miss and upload in cache

5 miss and updates in cache

6 hit and updates in cache

7 hit and updates in cache[updates at the end it is write black]

8 hit

9 hit

10 hit

11 hit

12 hit

total no.of bits=8

total no.of misses=4

no,of updates=3


Related Solutions

Draw the decision tables for all the problems below For the decision tables above, reduce the...
Draw the decision tables for all the problems below For the decision tables above, reduce the tables if possible. Problems A month is to be represented as an integer. A valid month is in the range of 1..12. An integer < 1 is invalid, or an integer > 12 is invalid. Consider how this can be simplified or reduced. An employee is either hourly or salaried. An hourly employee is paid by calculating an hourly wage and an hourly employee...
Suppose you have Avogadro's number of mini marshmallows and use them to cover the state of...
Suppose you have Avogadro's number of mini marshmallows and use them to cover the state of Michigan which has a land area of 5.680 × 104 mi2. Each mini marshmallow has a diameter of 0.635 cm and a height of 2.54 cm. Assuming the marshmallows are packed together so there is no space between them, to what height above the surface, in kilometers, will the mini marshmallows extend?
Suppose you have Avogadro\'s number of mini marshmallows and use them to cover the state of...
Suppose you have Avogadro\'s number of mini marshmallows and use them to cover the state of Oregon which has a land area of 9.600 × 104 mi2. Each mini marshmallow has a diameter of 0.635 cm and a height of 2.54 cm. Assuming the marshmallows are packed together so there is no space between them, to what height above the surface, in kilometers, will the mini marshmallows extend?
Suppose that you have a program that can read through all posts within a given time...
Suppose that you have a program that can read through all posts within a given time period (e.g. the last 7 days) on a social network web site (e.g., Facebook), and generate a list of pairs (ui, pi) representing texts in all posts found, where i=1, 2, ..., and ui and pi represent the author username and the text content of the i-th post found, respectively. Describe an algorithm that outputs the list of usernames in the decreasing order of...
Imagine that you have a conducting sphere. Draw a picture that shows the charge distribution within...
Imagine that you have a conducting sphere. Draw a picture that shows the charge distribution within the shell and briefly describe a reason or reasons for the electric field inside of the shell is zero using Gauss law. Please explain thoroughly and write neatly!
Suppose we have a direct-mapped cache that can hold a total of 1024 blocks with 4...
Suppose we have a direct-mapped cache that can hold a total of 1024 blocks with 4 words per block. Compute the block index, block offset, and the tag for the following addresses: (a) 0x11001001 (b) 0x00010014 (c) 0x01000004 (d) 0x01001018 (e) 0x7bdcca10
suppose that 25% of all licensed drivers in a particular state do not have insurance. let...
suppose that 25% of all licensed drivers in a particular state do not have insurance. let x be the number of uninsured drivers in a random sample of size 40. what is the probability that between 7 and 14 (both inclusive) of the selected drivers are uninsured?
Write the definition of Endocytosis( include all three of them) and the definition of pinocytosis. Draw...
Write the definition of Endocytosis( include all three of them) and the definition of pinocytosis. Draw the diagrammatic representation of endocytosis and pinocytosis.
Suppose the economy is in a long-run equilibrium. a. Draw a diagram to illustrate the state...
Suppose the economy is in a long-run equilibrium. a. Draw a diagram to illustrate the state of the economy. Be sure to show aggregate demand, short run aggregate supply, and long-run aggregate supply. b. Now suppose that a stock market crash causes aggregate demand to fall. Use your diagram to show what happens to output and the price level in the short run. What happens to the unemployment rate? c. Use the sticky-wage theory of aggregate supply to explain what...
For complete credit show all of your calculations, list your assumptions and formulas, draw relevant tables...
For complete credit show all of your calculations, list your assumptions and formulas, draw relevant tables and plots all on handwritten pages in your notebook. If there are repetitious calculations you only need to show an illustrative calculation. price lotsize 490000 2503 512000 2483 345000 2500 508670 2900 550000 2513 300000 2513 995000 4950 920000 3135 470000 2375 450000 2375 5.Calculate the weighted average of price and lotsize. Why are these the same or different from the median and arithmetic...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT