Computer Organization: Cache Memory Addressing and Design

Verified

Added on  2023/01/19

|2
|449
|49
Homework Assignment
AI Summary
Document Page
a. Direct Mapped Cache Addres_format:
// (tag, line, word) //
Given , Number of bits in Tag field = 20 bits;
Number of bits in offset field = log264 = 6 bits
Total number of bits in address = 32
Then number of bits for lines/blocks in cache = 32 – 20 – 6 = 6 bits
TAG field Line Field Offset Field
20 bits 6 bits 6 bits
Total addressable units in bytes = 2 ^ 32 = 4GB
Number of blocks in Main Memory = 2 ^ (number of tag field bits + number of Line Fields)
= 2 ^ 26 = 64MB
Number of lines/blocks in cache = 2 ^ number of bits in Line field = 2 ^ 6 = 64 blocks
Number of bits in TAG field = 20 bits.
b. Fully Associative Cache Address_format:
// (tag, word) //
Given number of bits for offset field = log264 = 6 bits
Total number of bits in address = 32
Then number of bits for TAG field = 32 – 6 = 26 bits.
TAG Field Offset Field
26 Bits 6 Bits
Total addressable units in bytes = 2 ^ 32 = 4GB
Number of blocks in Main Memory = 2 ^ (number of tag field bits)
= 2 ^ 26 = 64MB
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Number of lines/blocks in cache = Size of Cache / Size of block.
Since Size of Cache not mentioned, this can’t be determined
Number of bits in TAG field = 26 bits
c. 4 way Set Associative Cache Address_format:
//(tag,set,word)//
Given, number of bits for TAG field = 9 bits.
Given number of bits for offset field = log264 = 6 bits
Total number of bits in address = 32
Bits for determining set in Cache = 32 – bits in tag – bits in offset = 32 – 9 – 6 = 17 bits
Then Number of sets in cache = 2 ^ number of set bits = 2 ^ 17 = 128K
TAG Field Set Field Offset Field
9 bits 17 bits 6 bits
Total addressable units in bytes = 2 ^ 32 = 4GB
Number of blocks in Main Memory = 2 ^ (number of tag field bits + set Field bits)
= 2 ^ 26 = 64MB
Total Number of lines in Cache = number of Way * Number of Sets
= 4 * 128K = 512K ( 2 ^ 19)
Number of bits in TAG field = 9 bits
chevron_up_icon
1 out of 2
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]