CS计算机代考程序代写 cache Quiz13

Quiz13
Due No due date Points 10 Questions 2 Available until Mar 29 at 4:20pm Time Limit 60 Minutes
Instructions
You can take this quiz only once.
Once you start the quiz, you will need to complete it.
This quiz was locked Mar 29 at 4:20pm.
Attempt History
Attempt Time LATEST Attempt 1 12 minutes
Score
1.11 out of 10
Score for this quiz: 1.11 out of 10 Submitted Mar 29 at 4:07pm
This attempt took 12 minutes.
Question 1
0.87 / 5 pts
Assume that you have a direct-mapped cache with 8 one-word blocks that is initially empty, and that you will be given a series of word address references in the following order. Label each reference as a hit or a miss and show the content of the cache in each step (For example, to show word data at the address 5 is stored in some block of the cache, just enter 5 ). For slots that do not have anything, enter “none”.
a). address 5 (00101) Hit or Miss? Miss
Where in the cache is it stored?
012345
b). address 9 (continuing from the previous step) (01001) Hit or Miss? Hit
6
5
Where in the cache is it stored?

012345
9
5
6
c). address 13 (continuing from the previous step) (01101) Hit or Miss? Hit
Where in the cache is it stored?
012345
d). address 9 (continuing from the previous step) (01001) Hit or Miss? Hit
Where in the cache is it stored?
012345
e). address 17 (continuing from the previous step) (10001) Hit or Miss? Hit
Where in the cache is it stored?
012345
f). address 9 (continuing from the previous step) (01001) Hit or Miss? Hit
9
5
6
6
9
5
17
5
6

Where in the cache is it stored?
012345
g). address 13 (continuing from the previous step) (01101) Hit or Miss? Hit
Where in the cache is it stored?
012345
Answer 1:
Miss
miss
Answer 2:
none
Answer 3:
none
Answer 4:
none
Answer 5:
none
Correct Answer
9
5
6
6
Correct Answer
9
5
Correct!
You Answered
(You left this blank)
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
Answer 6:
You Answered
(You left this blank)

Correct Answer
none
Answer 7:
5
Mem(5) Memory(5) M(5)
Answer 8:
none
Answer 9:
none
Answer 10:
Miss
miss
Answer 11:
none
Answer 12:
9
Mem(9) Memory(9) M(9)
Answer 13:
none
Answer 14:
Correct!
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
Hit
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct!
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)

Correct Answer
none
Answer 15:
none
Answer 16:
5
M(5) Mem(5) Memory(5)
Answer 17:
none
Answer 18:
none
Answer 19:
Miss
miss
Answer 20:
none
Answer 21:
9
M(9) Mem(9) Memory(9)
Answer 22:
You Answered
(You left this blank)
Correct Answer
Correct!
Correct Answer
Correct Answer
Correct Answer
You Answered
You Answered
(You left this blank)
Correct Answer
(You left this blank)
Correct Answer
You Answered
Hit
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct!
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
none

Answer 23:
You Answered
(You left this blank)
Correct Answer
none
Answer 24:
none
Answer 25:
M(13) Mem(13) Memory(13) 13
Answer 26:
none
Answer 27:
none
Answer 28:
Hit
hit
Answer 29:
none
Answer 30:
9
M(9) Mem(9) Memory(9)
You Answered
(You left this blank)
Correct Answer
You Answered
5
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct!
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct!
Correct Answer
Correct Answer
Correct Answer
Answer 31:

You Answered
(You left this blank)
Correct Answer
none
Answer 32:
none
Answer 33:
none
Answer 34:
M(13) Mem(13) Memory(13) 13
Answer 35:
none
Answer 36:
none
Answer 37:
Miss
miss
Answer 38:
none
Answer 39:
You Answered
Correct Answer
(You left this blank)
You Answered
(You left this blank)
Correct Answer
You Answered
5
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
Hit
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct!
17

Correct Answer
M(17)
Correct Answer
Mem(17)
Memory(17)
Answer 40:
none
Answer 41:
none
Answer 42:
none
Answer 43:
M(13) Mem(13) Memory(13) 13
Answer 44:
none
Answer 45:
none
Answer 46:
Miss
miss
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
5
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
Hit
Correct Answer
Correct Answer
Answer 47:

You Answered
(You left this blank)
Correct Answer
none
Answer 48:
9
M(9) Mem(9) Memory(9)
Answer 49:
none
Answer 50:
none
Answer 51:
none
Answer 52:
M(13) Mem(13) Memory(13) 13
Answer 53:
none
Answer 54:
none
Correct!
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
5
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
Answer 55:

Correct!
Hit
Correct Answer
hit
Answer 56:
none
Answer 57:
9
M(9) Mem(9) Memory(9)
Answer 58:
none
Answer 59:
none
Answer 60:
none
Answer 61:
M(13) Mem(13) Memory(13) 13
Answer 62:
none
You Answered
(You left this blank)
Correct Answer
Correct!
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
5
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Answer 63:
You Answered
(You left this blank)

none
For a), since we have 8 blocks,
5 mod 8 = 5, thus the data at the word address is stored at 5
Correct Answer
Question 2
0.24 / 5 pts
Assume that you have a direct-mapped cache with two-word blocks and a total size of 8 words that is initially empty, and that you will be given a series of word address references in the following order. Label each reference as a hit or a miss and show the content of the cache in each step. For slots that do not have anything, enter “none”.
a). address 3 (0011) Hit or Miss? Miss
What is the cache content at this point?
Cache Set
0 (00)
1 (01)
2 (10)
3 (11)
Address
3
b). address 6 (continuing from the previous step) (0110) Hit or Miss? Miss
What is the cache content at this point?
Cache Set
0 (00)
1 (01)
2 (10)
3 (11)
Address
6
c). address 2 (continuing from the previous step) (0010)

Hit or Miss?
What is the cache content at this point?
Cache Set
0 (00)
1 (01)
2 (10)
3 (11)
Address
2
d). address 9 (continuing from the previous step) (1001) Hit or Miss? Hit
What is the cache content at this point?
Cache Set
0 (00)
1 (01)
2 (10)
3 (11)
Address
9
e). address 10 (continuing from the previous step) (1010) Hit or Miss? Hit
What is the cache content at this point?
Cache Set
0 (00)
1 (01)
2 (10)
3 (11)
Address
10
f). address 3 (continuing from the previous step) (0011) Hit or Miss? miss
What is the cache content at this point?
Miss

Cache Set
0 (00)
1 (01)
2 (10)
3 (11)
Address
3
g). address 7 (continuing from the previous step) (0111) Hit or Miss? miss
What is the cache content at this point?
Cache Set
0 (00)
1 (01)
2 (10)
3 (11)
Address
7
Answer 1:
Miss
miss
Answer 2:
none
Answer 3:
none
Answer 4:
M(2) Mem(2) Memory(2)
Correct!
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
3
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer

Correct Answer
2
Answer 5:
M(3) Mem(3) Memory(3) 3
Answer 6:
none
Answer 7:
none
Answer 8:
none
Answer 9:
none
Answer 10:
Miss
miss
Answer 11:
none
Answer 12:
none
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct!
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
Answer 13:

You Answered
(You left this blank)
Correct Answer
M(2) Mem(2) Memory(2) 2
Answer 14:
M(3) Mem(3) Memory(3) 3
Answer 15:
none
Answer 16:
none
Answer 17:
M(6) Mem(6) Memory(6) 6
Answer 18:
M(7) Mem(7) Memory(7) 7
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
6
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
Answer 19:

You Answered
Miss
Correct Answer
Hit
Correct Answer
hit
Answer 20:
none
Answer 21:
none
Answer 22:
M(2) Mem(2) Memory(2) 2
Answer 23:
M(3) Mem(3) Memory(3) 3
Answer 24:
none
Answer 25:
none
Answer 26:
You Answered
Correct Answer
(You left this blank)
You Answered
2
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)

Correct Answer
Correct Answer
M(6)
Correct Answer
Mem(6) Memory(6) 6
Answer 27:
M(7) Mem(7) Memory(7) 7
Answer 28:
Miss
miss
Answer 29:
M(8) Mem(8) Memory(8) 8
Answer 30:
M(9) Mem(9) Memory(9) 9
Answer 31:
M(2) Mem(2)
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
You Answered
Hit
Correct Answer
Correct Answer
You Answered
Correct Answer
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
9
Correct Answer
Correct Answer

Correct Answer
Memory(2)
Correct Answer
2
Answer 32:
M(3) Mem(30) Memory(3) 3
Answer 33:
none
Answer 34:
none
Answer 35:
M(6) Mem(6) Memory(6) 6
Answer 36:
M(7) Mem(7) Memory(7) 7
Answer 37:
Miss miss
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
Correct Answer
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
Hit
Correct Answer
Correct Answer

Answer 38:
You Answered
Correct Answer
(You left this blank)
Correct Answer
M(8) Mem(8) Memory(8) 8
Answer 39:
M(9) Mem(9) Memory(9) 9
Answer 40:
M(10) Mem(10) Memory(10) 10
Answer 41:
M(11) Mem(11) Memory(11) 11
Answer 42:
none
Answer 43:
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
10
Correct Answer
You Answered
(You left this blank)
Correct Answer
none

Correct Answer
Answer 44:
You Answered
(You left this blank)
Correct Answer
M(6) Mem(6) Memory(6) 6
Answer 45:
M(7) Mem(7) Memory(7) 7
Answer 46:
Miss
miss
Answer 47:
M(8) Mem(8) Memory(8) 8
Answer 48:
M(9) Mem(9) Memory(9) 9
Answer 49:
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct!
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
3
Correct Answer
M(2)

Correct Answer
Correct Answer
Mem(2)
Correct Answer
Memory(2)
2
Answer 50:
M(3) Mem(3) Memory(3) 3
Answer 51:
none
Answer 52:
none
Answer 53:
M(6) Mem(6) Memory(6) 6
Answer 54:
M(7) Mem(7) Memory(7) 7
Answer 55:
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
miss
Correct Answer
Hit

Correct Answer
hit
Answer 56:
M(8) Mem(8) Memory(8) 8
Answer 57:
M(9) Mem(9) Memory(9) 9
Answer 58:
M(2) Mem(2) Memory(2) 2
Answer 59:
M(3) Mem(3) Memory(3) 3
Answer 60:
none
You Answered
Correct Answer
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
Correct Answer
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
You Answered
(You left this blank)
Correct Answer
Answer 61:
You Answered
7

Correct Answer
none
Answer 62:
M(6) Mem(6) Memory(6) 6
Answer 63:
M(7) Mem(7) Memory(7) 7
You Answered
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
Correct Answer
You Answered
Correct Answer
(You left this blank)
Correct Answer
Correct Answer
Correct Answer
For a)
Block address = floor( word address / # of words per block ) (the integer part of the division)
Block = (Block address) modulo (# of blocks)
Thus
Block address = floor( 3 / 2 ) = 1 Block = 1 mod 4 = 1
Also, for the address 2, we have: Block address = ( 2 / 2 ) = 1 Block = 1 mod 4 = 1
Therefore the word at the address 3 and the word at the address 2 are stored together in the same block.
We can also derive this by observing that 2 is 0010 in binary, thus the same two middle bits and the tag as 3 (0011).

Quiz Score: 1.11 out of 10