Computer Systems: A Programmer's Perspective (3rd Edition)
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
bartleby

Concept explainers

Question
Book Icon
Chapter 9, Problem 9.11HW

A.

Program Plan Intro

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.

Expert Solution
Check Mark

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:

027C
0000001001111100

The above binary values are filled in the virtual address 14 bits format as follows,

Virtual address format:

131211109876543210
00001001111100

B.

Program Plan Intro

The page size (P) is 64bytes; using the page size finds the number of bits in VPN.

The formula for page size as follows:

P=2p

Substitute “P = 64” in the above formula

64=2p26=2pp=6

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

NumberofbitsinVPN=np=146=8

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:

T=2t

Substitute “T = 4” in the above formula

T=2t4=2t22=2tt=2

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

TLBT=VPNTLBI=82=6

Therefore, the value of TLBT is “6”.

B.

Expert Solution
Check Mark

Explanation of Solution

Virtual address format:

131211109876543210
00001001111100

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:

131211109876
00001001

VPN = 0000 1001 = 0x9

Value of TLB index:

76
01

TLB index = 01 = 0x1

Value of TLB tag:

1312111098
000010

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:

543210
111100

VPO = 11 1100 = 3C

Completed Table:

ParameterValue
VPN0x9
TLB index0x1
TLB tag0x2
TLB hit? (Y/N)N
Page fault? (Y/N)N
PPN0x17

C.

Program Plan Intro

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.

Expert Solution
Check Mark

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:

05FC
0000101111111100

The above binary values are filled in the physical address 12 bits format as follows,

11109876543210
010111111100

D.

Program Plan Intro

The physical address has additional three more components. They are Byte offset within cache block (CO), Cache index (CI) and Cache tag (CT).

D.

Expert Solution
Check Mark

Explanation of Solution

Physical address format:

11109876543210
010111111100

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):

10
00

CO = 11 = 0x0

Value of Cache index (CI):

5432
1111

CI = 1111 = 0xF

Value of Cache tag (CT):

11109876
010111

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:

ParameterValue
Byte offset0x0
Cache index0xF
Cache tag0x17
Cache hit? (Y/N)N
Cache byte returned---

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
Suppose a computer using direct mapped cache has 232 byte of byte-addressable main memory, and a cache of 1024 blocks, where each cache block contains 32 bytes.   a) How many blocks of main memory are there? b) What is the format of a memory address as seen by the cache, i.e., what are the sizes of the tag, block, and offset fields? c) To which cache block will the memory address 0x000063FA map?
Here is the question: A direct-mapped cache consists of 8 blocks. A byte-addressable main memory contains 4K blocks of eight bytes each. Access time for the cache is 20 ns and the time required to fill a cache slot from main memory is 300 ns. Assume a request is always started in sequential to cache and then to main memory. If a block is missing from cache, the entire block is brought into the cache and the access is restarted. Initially, the cache is empty.   b) Compute the hit ratio for a program that loops 3 times from address 0 to 75 (base 10) in memory.  For b, another example has been provided in regards to a previous problem: A direct-mapped cache consists of eight blocks. Main memory contains 4K blocks of eight words each. Access time for the cache is 22 ns and the time required to fill a cache slot from main memory is 300ns (this time will allow us to determine the block is missing and bring it into cache). Assume a request is always started in parallel to both cache and to…
Suppose a computer using fully associative cache has 4 GB of byte-addressable main memory and a cache of 256 blocks, where each block contains 256 bytes. a) How many blocks of main memory are there? b) 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? c) To which cache block will the memory address 0X1A1B1C1D map?
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education