Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 6, Problem 6.27HW
A)
Program Plan Intro
Given Information:
A 2-way associative cache is given.
For line-0:
SetIndex | Tag | Valid | Byte0 | Byte1 | Byte2 | Byte3 |
0 | 09 | 1 | 86 | 30 | 3F | 10 |
1 | 45 | 1 | 60 | 4F | E0 | 23 |
2 | EB | 0 | - | - | - | - |
3 | 06 | 0 | - | - | - | - |
4 | C7 | 1 | 06 | 78 | 07 | C5 |
5 | 71 | 1 | 0B | DE | 18 | 4B |
6 | 91 | 1 | A0 | B7 | 26 | 2D |
7 | 46 | 0 | - | - | - | - |
For line-1:
SetIndex | Tag | Valid | Byte0 | Byte1 | Byte2 | Byte3 |
0 | 00 | 0 | - | - | - | - |
1 | 38 | 1 | 00 | BC | 0B | 37 |
2 | 0B | 0 | - | - | - | - |
3 | 32 | 1 | 12 | 08 | 7B | AD |
4 | 05 | 1 | 40 | 67 | C2 | 3B |
5 | 6E | 0 | - | - | - | - |
6 | F0 | 0 | - | - | - | - |
7 | DE | 1 | 12 | C0 | 88 | 37 |
B)
Program Plan Intro
Given Information:
A 2-way associative cache is given.
For line-0:
SetIndex | Tag | Valid | Byte0 | Byte1 | Byte2 | Byte3 |
0 | 09 | 1 | 86 | 30 | 3F | 10 |
1 | 45 | 1 | 60 | 4F | E0 | 23 |
2 | EB | 0 | - | - | - | - |
3 | 06 | 0 | - | - | - | - |
4 | C7 | 1 | 06 | 78 | 07 | C5 |
5 | 71 | 1 | 0B | DE | 18 | 4B |
6 | 91 | 1 | A0 | B7 | 26 | 2D |
7 | 46 | 0 | - | - | - | - |
For line-1:
SetIndex | Tag | Valid | Byte0 | Byte1 | Byte2 | Byte3 |
0 | 00 | 0 | - | - | - | - |
1 | 38 | 1 | 00 | BC | 0B | 37 |
2 | 0B | 0 | - | - | - | - |
3 | 32 | 1 | 12 | 08 | 7B | AD |
4 | 05 | 1 | 40 | 67 | C2 | 3B |
5 | 6E | 0 | - | - | - | - |
6 | F0 | 0 | - | - | - | - |
7 | DE | 1 | 12 | C0 | 88 | 37 |
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
3. The table below represents five lines from a cache that uses fully associative mapping with a block size of 8. Identify the address of the shaded data, 0xE6, first in binary and then in hexadecimal. The tag numbers and word id bits are in binary, but the content of the cache (the data) is in hexadecimal.
Word id bits
Tag 000 001 010 011 100 101 110 111
------------------------------------------
1011010 10 65 BA 0F C4 19 6E C3
1100101 21 76 CB 80 D5 2A 7F B5
0011011 32 87 DC 91 E6 3B F0 A6
1100000 43 98 ED A2 F7 4C E1 97
1111100 54 9A FE B3 08 5D D2 88
Please do in correct way!
For a direct-mapped cache design with 64-bit addresses, the following bits of the address are used to access the cache:
Tag
Index
Offset
63-13
12-4
3-0
a. What is the cache block size (in bytes)?b. What is the cache size (in bytes)?c. What is the total number of bits (including valid bit, tag bits and data array bits) to implement this cache?d. For the same block and cache sizes, you want to implement a 4-way set-associative cache, what is the number of index bit and the number of tag bits?
Chapter 6 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 6.1 - Prob. 6.1PPCh. 6.1 - Prob. 6.2PPCh. 6.1 - Prob. 6.3PPCh. 6.1 - Prob. 6.4PPCh. 6.1 - Prob. 6.5PPCh. 6.1 - Prob. 6.6PPCh. 6.2 - Prob. 6.7PPCh. 6.2 - Prob. 6.8PPCh. 6.4 - Prob. 6.9PPCh. 6.4 - Prob. 6.10PP
Ch. 6.4 - Prob. 6.11PPCh. 6.4 - Prob. 6.12PPCh. 6.4 - Prob. 6.13PPCh. 6.4 - Prob. 6.14PPCh. 6.4 - Prob. 6.15PPCh. 6.4 - Prob. 6.16PPCh. 6.5 - Prob. 6.17PPCh. 6.5 - Prob. 6.18PPCh. 6.5 - Prob. 6.19PPCh. 6.5 - Prob. 6.20PPCh. 6.6 - Prob. 6.21PPCh. 6 - Prob. 6.22HWCh. 6 - Prob. 6.23HWCh. 6 - Suppose that a 2 MB file consisting of 512-byte...Ch. 6 - The following table gives the parameters for a...Ch. 6 - The following table gives the parameters for a...Ch. 6 - Prob. 6.27HWCh. 6 - This problem concerns the cache in Practice...Ch. 6 - Suppose we have a system with the following...Ch. 6 - Suppose we have a system with following...Ch. 6 - Suppose that a program using the cache in Problem...Ch. 6 - Repeat Problem 6.31 for memory address0x16E8 A....Ch. 6 - Prob. 6.33HWCh. 6 - Prob. 6.34HWCh. 6 - Prob. 6.35HWCh. 6 - Prob. 6.36HWCh. 6 - Prob. 6.37HWCh. 6 - Prob. 6.38HWCh. 6 - Prob. 6.39HWCh. 6 - Given the assumptions in Problem 6.38, determine...Ch. 6 - You are writing a new 3D game that you hope will...Ch. 6 - Prob. 6.42HWCh. 6 - Prob. 6.43HWCh. 6 - Prob. 6.45HWCh. 6 - Prob. 6.46HW
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- A 2-way set associative cache consists of four sets. Main memory contains 2K blocks of eight words each. Show the main memory address format that allows us to map addresses from main memory to cache. Be sure to include the fields as well as their sizes. Compute the hit ratio for a program that loops 6 times from locations 8 to 51 in main memory. You may leave the hit ratio in terms of a fraction. Please show details how you obtain the result.arrow_forwardProblem 0. The following table gives some of the parameters for a number of different hardware caches. Fill in the table with the values of the missing parameters. Recall that m is the number of physical address bits, C is the cache size in bytes, B is the block size in bytes, E is the associativity, i.e., lines per set, S is the number of sets, t is the number of tag bits, s is the number of set index bits, and b is the number of block offset bits. Cache m 48 32030 (b) 48 32 24 24 C B E 16384 32 16 32768 64 65536 128 512 32 1024 8 8 4 14 1 4 S b S tarrow_forwardQ2: a cache memory consists of 512 blocks, and if the last word in the block is 1111111. I the last Tag is 1111. Then the total number of words in main memory is Tags, and The main memory consists of blocks. The total number of bits in address fields i . where number of bits for tag field is .... and the remaining number of bits for word field i ..arrow_forward
- A cache is set up with a block size of 32 words. There are 64 blocks in cache and set up to be 4-way set associative. You have byte address 0x8923. Show the word address, block address, tag, and index Show each access being filled in with a note of hit or miss. You are given word address and the access are: 0xff, 0x08, 0x22, 0x00, 0x39, 0xF3, 0x07, 0xc0.arrow_forwardCO. A certain processor uses a fully associative cache of size 16 kB. The cache block size is 16 bytes. Assume that the main memory is byte addressable and uses a 32-bit address. How many bits are required for the Tag and the Index ticlds respectively in the addresses generated by the processor?arrow_forwardP2arrow_forward
- A 2-way set-associative cache consists of four sets. Main memory contains 2K blocks of 8 bytes each and byte addressing is used.Q.) Compute the hit ratio for a program that loops three times from addresses 0x8 to 0x33 in main memory. You may leave the hit ratio in terms of a fraction.arrow_forward5.barrow_forwardDoarrow_forward
- 27. Why are the tag bits of a memory address important in a cache memory system? A. The more tag bits there are, the higher the hit ratio. B. The more tag bits there are, the lower the hit ratio. C. The tag bits tell which block of main memory is occupying a cache line. D. The tag bits are needed to tell whether a cache line has been modified or not. E. The tag bits determine which level of cache is closest to the CPU.arrow_forward1)Encode the binary data 1010101010 into an even parity Hamming code. 2)A direct mapped cache consists of 256 slots. Main memory contains 64K blocks of 16 words each. Access time of the cache is 15 ns, and that for the main memory is 120 ns. Assume that main memory is accessed in parallel with cache look up. Initially, the cache is empty. (a) Give the format of the memory address. (b) Compute the effective access time, if suppose the hit ratio for read is 90%.arrow_forwardA computer is using a fully associative cache and has 216 bytes of main memory (byte addressable) and a cache of 64 blocks, where each block contains 32 bytes. a. How many blocks of main memory are there? b. What will be the sizes of the tag, index, and byte offset fields? c. To which cache set will the memory address 0xF8C9(hexadecimal) map?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning