Concept explainers
A.
Virtual address:
Virtual page number (VPN) and virtual page offset (VPO) are the two components of virtual address. Virtual address is “14 bits” format.
A.
Explanation of Solution
Given data:
Virtual address = 0x027C
The given virtual address is in hexadecimal format; convert it into binary format. Convert each Hexadecimal digit to a 4 bit binary equivalent:
0 | 2 | 7 | C |
0000 | 0010 | 0111 | 1100 |
The above binary values are filled in the virtual address 14 bits format as follows,
Virtual address format:
13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 |
B.
The page size (P) is 64bytes; using the page size finds the number of bits in VPN.
The formula for page size as follows:
Substitute “P = 64” in the above formula
Therefore, the “p” value represents virtual page offset (VPO) and physical page offset (PPO).
Number of bits in VPN is calculated as follows:
n = 14
p = 6
The VPN has additional two more components. They are TLB tag (TLBT) and TLB index (TLBI). The TLB is “4 ways” associative with “16” entries totally. Using the TLB find the value of TLBI and TLBT.
The formula for TLB as follows:
Substitute “T = 4” in the above formula
Therefore, the “t” value represents TLBI.
TLBI and TLBT are calculated as follows:
The “t” value represents TLBI. Therefore, the value of TLBI is “2”.
TLBI = 2
VPN = 8
Therefore, the value of TLBT is “6”.
B.
Explanation of Solution
Virtual address format:
13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 |
The higher-order “8 bits” of the virtual address represents “VPN” and the lower-order “6 bits” of the virtual address represents “VPO”. The higher-order “6 bits” of the VPN represents “TLBT” and the lower-order “2 bits” of the VPN represents “TLBI”
Value of VPN:
13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 |
0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |
VPN = 0000 1001 = 0x9
Value of TLB index:
7 | 6 |
0 | 1 |
TLB index = 01 = 0x1
Value of TLB tag:
13 | 12 | 11 | 10 | 9 | 8 |
0 | 0 | 0 | 0 | 1 | 0 |
TLB tag = 00 0010 = 0x2
TLB hit: No
There is a no valid match in the virtual address.
Page fault: No
There is a valid PTE and returns the cached PPN from the page table (PTE).
Value of PPN:
The cached PPN from the page table is “0x17”.
Value of VPO:
5 | 4 | 3 | 2 | 1 | 0 |
1 | 1 | 1 | 1 | 0 | 0 |
VPO = 11 1100 = 3C
Completed Table:
Parameter | Value |
VPN | 0x9 |
TLB index | 0x1 |
TLB tag | 0x2 |
TLB hit? (Y/N) | N |
Page fault? (Y/N) | N |
PPN | 0x17 |
C.
Physical address:
Physical page number (PPN) and physical page offset (PPO) are the two components of physical address. Physical address is “12 bits” format. The physical page offset (PPO) is identical to the virtual page offset (VPO).
C.
Explanation of Solution
Physical address format:
To form the physical address, concatenate the physical page number (PPN) from the PTE with virtual page offset (VPO) from the virtual address, which forms “0x05FC”.
Physical address = 0x05FC
The physical address is in hexadecimal format; convert it into binary format. Convert each Hexadecimal digit to a 4 bit binary equivalent:
0 | 5 | F | C |
0000 | 1011 | 1111 | 1100 |
The above binary values are filled in the physical address 12 bits format as follows,
11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 |
D.
The physical address has additional three more components. They are Byte offset within cache block (CO), Cache index (CI) and Cache tag (CT).
D.
Explanation of Solution
Physical address format:
11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 |
The lower-order “2 bits” of the physical address represents “CO”, the next “4 bits” represents “CI” and the remaining “6 bits” represents “CT”.
Value of Byte offset (CO):
1 | 0 |
0 | 0 |
CO = 11 = 0x0
Value of Cache index (CI):
5 | 4 | 3 | 2 |
1 | 1 | 1 | 1 |
CI = 1111 = 0xF
Value of Cache tag (CT):
11 | 10 | 9 | 8 | 7 | 6 |
0 | 1 | 0 | 1 | 1 | 1 |
CT = 01 0111 = 0x17
Cache hit: No
The cache index is not matches the cache tag.
Value of Cache byte:
The cached byte is not returned because the cache index is not matches the cache tag.
Completed Table:
Parameter | Value |
Byte offset | 0x0 |
Cache index | 0xF |
Cache tag | 0x17 |
Cache hit? (Y/N) | N |
Cache byte returned | --- |
Want to see more full solutions like this?
Chapter 9 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
- The following table gives the parameters for a number of differentcaches. For each cache, fill in the missing fields in the table. Recallthat m is the number of physical address bits, C is the cache size(number of data bytes), B is the block size in bytes, E is theassociativity, S is the number of cache 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.arrow_forwardThe following table gives the parameters for a number of differentcaches. Your task is to fill in the missing fields in the table. Recall that m is the number of physical address bits, C is the cache size (number of data bytes), B is the block size in bytes, E is the associativity, S is the number of cache 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.arrow_forwardFor a direct-mapped cache design with a 32-bit address, the following bits of the address are used to access the cache.Tag Index Offset31–10 9–5 4–01. What is the cache block size (in words)?2. How many entries does the cache have?3. What is the ratio between total bits required for such a cache implementation over the data storage bits?Starting from power on, the following byte-addressed cache references are recorded. Address 0 4 16 132 232 160 1024 30 140 3100 180 2180 How many blocks are replaced? What is the hit ratio? List the fi nal state of the cache, with each valid entry represented as a record of <index, tag, data>arrow_forward
- .2: Below is a list of 32-bit memory address references, given as word addresses. 3, 180, 43, 2, 191, 88, 253 For each of these references, identify the binary address, the tag, and the index given a direct- mapped cache with 16 one-word blocks. Also list if each reference is a hit or a miss, assuming the cache is initially empty. For each of these references, identify the binary address, the tag, and the index given a direct-mapped cache with 2-word blocks and a total size of 8 blocks. Also list if each reference is a hit or a miss, assuming the cache is initially empty. For each of these references, identify the binary address, the tag, and the index given a direct-mapped cache with 4-word blocks and a total size of 8 blocks. Also list if each reference is a hit or a miss, assuming the cache is initially empty.arrow_forwardA computer of 32 bits has a cache memory of 64 KB with a cache line size of 64 bytes. The cache access time is 20 ns, and the miss penalty is 120 ns. The cache is 2-way associative. a) What is the number of cache lines? b) What is the number of cache sets? c) What is the number of lines per set? d) Draw a scheme of this cache. e) Calculate the time to read a word in case of miss.arrow_forward3. The series of memory address references given as word addresses are 122, 126, 126, 126, 116, 300, 116, and 118. Assume a direct-mapped cache with eight one-word blocks that is initially empty. Label each reference in the list as a hit or miss and show the contents of the cache with figure after each reference.arrow_forward
- ALSO: What is the hit ratio for the memory accesses (Round to the nearest percent.)arrow_forwardSuppose a computer using fully associative cache has 224 words of main memory and a cache of 512 blocks, where each cache block contains 16 words. How many blocks of main memory are there? What is the format of a memory address as seen by the cache, i.e., what are the sizes of the tag and offset fields? To which cache block will the memory reference 17042416 map?arrow_forwardSuppose a byte-addressable computer using set-associative cache has 216 bytes of main memory and a cache of 32 blocks, and each cache block contains 8 bytes.Q.) If this cache is 2-way set associative, what is the format of a memory address as seen by the cache; that is, what are the sizes of the tag, set, and offset fields?arrow_forward
- Cache Mapping Technique 1. Suppose a computer usingdirect-mapped cache has 2 bytes of byte=addressable main memory and a cache of32 blocks, where each cache block contains 16 bytes.a) How many blocksof main memory are there?b) What is theformat of a memory address as seen by the cache; that is, what are the sizes ofthe tag, block, and offset fields?c) To which cacheblock will the memory address 0x0DB63 map?2. Suppose a computer using fullyassociative cache has 2 bytes of byte-addressable main memory and a cache of128 blocks, where each cache block contains 64 bytes.a) How many blocksof main memory are there?b) What is theformat of a memory address as seen by the cache; that is, what are the sizes ofthe tag and offset fields?c) To which cacheblock will the memory address 0x01D872 map?3. A 2-way set-associative cacheconsists of four sets. Main memory contains 2K blocks of 8 bytes each and byte addressingis used.a) Show the mainmemory address format that allows us to map addresses from…arrow_forwardDoarrow_forwardFor a direct-mapped cache design with a 32-bit address, the following bitsof the address are used to access the cache. Use the table below. a. What is the cache block size (in words)?b. How many entries does the cache have?c. What is the ration between total bits required for such a cache implementation overthe data storage bit?arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education