0% found this document useful (0 votes)
5 views3 pages

Quiz 3

Uploaded by

asinghsfsu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Quiz 3

Uploaded by

asinghsfsu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1a.

1a)
given
64KB = 65,536B
Written in bytes not wordings
number of offset bits = log2(32) = 5
Number of sets = 65,536/32 = 2048
Number of set/index bits = log2(2048) = 11
Number of tag bits = 32 - 5 (offset) - 11 (sets/index) = 16
64kb/32byte = 2^16/2^5 = 2^11 blocks
tag bits = 16
1b)

0000 0000 0010 1100 0000 1100 0101 0100 - Memory Address in Binary
0000 0000 0010 1100 - Tag
0000 0101 0100 - Index
1c)
0x2c0c50, 0x2c0c54, 0x2c0c58, 0x2c0c5c
1d)
size of tag memory = no of tag bits * no of cache blocks
size of tag memory = 16 * 2K bits = 32 k bits
cache = 64kb = 512k bits
total bits = size of cache + size of tag memory = 512k + 32k = 544 k bits
Bits in Cache = (2^index bits ) * (valid bits + tag bits + block size in bits) =
211 * (1 + 16 + (32*8)) = 559,104b
2

code

a write to 0x100144a8 (timestamp 265) write miss


from address: index = 0x4b, tag = 0x10014
For cache index = 0x4b:
TAG1 = 0x10014
DIRTY1 = 1
USED1 = 265
a write to 0x900024dc (timestamp 266) write hit
from address: index = 0x4c, tag = 0x90002
For cache index = 0x4c:
DIRTY0 = 1
USED0 = 266
a read to 0x7fff24c4 (timestamp 267) read miss

from address: index = 0x4d, tag = 0x7fffc


For cache index = 0x4d:
TAG1 = 0x7fff2
DIRTY1 = 0
USED1 = 267
3 3)

Initial answer

Offset = log2(4) = 2
index = log2(N/k) = log2(16k/4) = log2(4k) = 12 bits
tag = 32 - 12 - 2 -2 = 16bits
bit memory address, in cache = (2^index bits ) * (Valid bits + Tag bits + block size in bits) =
211 * (1 + 16 + (32*8)) = 559,104b

Revised
Offset = log2(32) = 5
#number of sets = 16384 / 32 = 512
#number of index = log2 (512) = 9
# number of tag bits = 16384 - 9 - 512 - 5 = 15858

Block offset is log2(4) = 2 bits


number of sets = 16 KB / (4 * 16 bytes) = 16 K / 64 = .25 K = 256 sets
Index is log2(# set) = log2(256) = 8 bits
Tag = address - index - block - offset = 32 – 8 – 2 – 2 = 25 bits (2-bit offset)
With the endpoint answer with meaning being kibi vs kilobyte

You might also like