Part I Consider a computer that you have used or now use. (You may make an assum
ID: 671919 • Letter: P
Question
Part I
Consider a computer that you have used or now use. (You may make an assumption on word size if needed.)
How large is the memory of the computer?
How long is a word in the computer above?
How many bits are required to address the bytes in that memory?
How many data lines are required to read data from the computer memory?
Part II
Does your computer have cache?
If so how big is it?
How does your cache size compare with the size of main memory?
Do you know what kind of cache it is?
How did you find out about your computer's cache?
Make an assumption that your cache is either:
Fully associative
Direct mapped
Two-way set-associative
Four-way set-associative
Using the relationships in Part I above, determine:
the size of the Tag and Word for Associative cache;
OR
the size of the Tag, Line, and Word for Direct-Mapped Cache ;
Or
the size of Tag, Set, and Word for K-Way Set-Associative Cache.
You may make any assumptions necessary including the number of Words in each block (recommend 2 or 4 or 8)
Explanation / Answer
PART 1)
c)
2^8 = 256
2^10 = 1024 = 1 KB
2^20 = 1 MB
2^30 = 1 GB
2^32 = 4,294,967,296 = 4 GB
Since 4 GB = 2^32, you'll need 32 bits to address that 4 GB of memory.
d)
The most memory you can address with 32 bits is 4 GB.
Data line
2. When referring to a cable or wire, a data line, is a cable that is used to transmit data communications between two different points. For example, a telephone wire is considered a data line.
You have 8 bits for every location, therefore your memory needs a data bus with 8 lines. Every time you read a location the 8 bits that are stored at that location are loaded (by the memory chip) on the 4-line data bus.
Part II
A CPU cache is a cache used by the central processing unit (CPU) of a computer to reduce the average time to access data from the main memory. The cache is a smaller, faster memory which stores copies of the data from frequently used main memory locations.
Cache memory levels
Cache memory is fast and expensive. Traditionally, it is categorized as "levels" that describe its closeness and accessibility to the microprocessor:
How-to Check Cache Size?
This can be done with a simple Windows command line tool WMIC. To check, type the code in cmd as show in the box below. All the values returned will be KB.
L2 CACHESIZE 256KB
L3 CACHESIZE 3072KB
My memory system that uses a 32-bit address to address at the byte level, plus a cache that uses a 64-byte line size.
a. Assume a direct mapped cache with a tag field in the address of 20 bits. Show the address format and determine the following parameters: number of lines in cache, size of tag.
b. Assume an associative cache. Show the address format and determine the following parameters:number of lines in cache, size of tag.
c. Assume a four-way set-associative cache with a tag field in the address of 9 bits. Show the address format and determine the following parameters: number of lines in cache, size of tag.
Answer:
direct mapped cache
a. Address format: Tag = 20 bits; Line = 6 bits; Word = 6 bits.
Number of lines in cache 2r = 26 = 64; size of tag = 20 bits.
associative cache
b. Address format: Tag = 26 bits; Word = 6 bits.
Number of lines in cache = undetermined; size of tag = 26 bits.
four-way set-associative cache
c. Address format: Tag = 9 bits; Set = 17 bits; Word = 6 bits.
Number of lines in set = k = 4; Number of sets in cache = 2d = 217; Number of lines in cache = k × 2d =219; Size of tag = 9 bits.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.