Professional Documents
Culture Documents
Coal Assignment 1
Coal Assignment 1
Coal Assignment 1
Abstract
[Draw your reader in with an engaging abstract. It is typically a short summary of the
document. When you’re ready to add your content, just click here and start typing.]
Solution:
Two-way=k-way
size of set=k = 2
k=2
no of sets=v=2^9
v=2^d
=2^d
2^9=2^d
Comparing powers;
d=9
2^s=2^3 *2^10
2^s=2^13
comparing powers
S=13
Address length=s+w=13+8
Address length=31
Number of Addressable units=2^s+w
=2^13+8
=2^21
=2097152
Tag size=(s-d) bits
=13-9
Tag size=4
Question: 02
An eight-way set-associative cache has lines of 32 bytes and a total size of 16 MB. The 64-GB
main memory is byte addressable. Show the format of main memory addresses.
Solution:
eight-way=k-way
size of set=k = 8
k=8
v =no of sets)
m=kv
v=m/k
v=2^19/8
v=2^19/2^3
v=2^16
v=2^d
2^16=2^d
comparing powers
d=16
Question 3.
Given the following specifications for a cache memory: four-way set associative; line size of two
16-bit words; able to accommodate a total of 4K words from main memory of 256 G. Show the
format of main memory addresses.
Solution:
Four-way=k-way
size of set=k = 4
K=4
=2^12
Main memory size = 2^s+w=256 GB
=(256 * 2^30 )
=2^9*2^30
=2^39
S+w=39
w=1
S=39-w
S=39-1
S=38
v= no of sets
m=kv
v=m/k
v=2^11/4=2^11/2^2
V=2^9
v=2^d
2^9=2^d
comparing powers
D=9
Address length=37
Question 4:
Consider a directly mapped cache of 2000 lines that maps a main memory of 1024 G words
grouped into blocks of 32 words.
a. What is the number of maximum directly addressable memory units?
b. Show the format of the main memory address.
Address length = (s + w) bits
Number of addressable units = 2s+w words or bytes
Block size = line size = 2w words or bytes
Number of blocks in main memory = 2s+ w/2w = 2s
Number of lines in cache = m = 2r
Size of tag = (s – r) bits
Solution:
Size of cache =m=2000lines ~2^11
m=2^11
m=2^11
Size of 1 block=2^w=32
2^w=2^5
comparing powers
W=5
= (1024* 2^30)
=2^10*2^30=2^40
s + w =40
w=5
s=40-w
s=40-5
S=35
Number of blocks=64
Tag=s-r= 35-11
= 24
Tag=2
format of the main memory address;
m=24
comparing powers
S=37
Tag =s-r
=37-24
=13 bits
Question 6:
Consider a Fully Associative mapped cache of 10 M lines that maps a Main Memory of 512 G
blocks of 32 words each. Find the total addressable units in the main memory as well as the total
no of blocks in the cache. and the format of the main memory address showing the size of the
tag.
Solution:
Size of cache =m=10M lines
m= 10*2^20
m=10*2^20
m=10*2^20
size of 1 block=2^w
=32 words
comparing powers
2^w=2^5
comparing powers;
W=5
Tag=