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)
- 2. Jane, Jill, and Jenny have formed a band consisting of 3 instruments. (a) If each of them can play all 3 instruments, how many different arrangements are possible? (b) What if Jane can play all 3 instruments, but Jill and Jenny can each play only piano and drums?arrow_forward4. A person has 9 friends, of whom 5 will be invited to a party. (a) How many choices are there if 2 of the friends are feuding and will not attend together? (b) How many choices if 2 of the friends will only attend together?arrow_forward5. There are 3 people in a room, and we are curious whether two of them have their birthday in the same month. We record the triplet that describes the month of birthday for each person. E.g., (Oct, Jan, Jul) is one possible triplet/outcome. (Since each month applies to a specific person, (Oct, Jan, Jul) is not the same as (Jan, Jul, Oct), so order is important.) (a) How many possible outcomes are there? (b) In how many of these outcomes do all three people have their birthday in different months? (c) In how many of these outcomes do at least two people have their birthday in the same month?arrow_forward
- 1. We have 8 blocks, of which 4 are green, 2 are red, 1 is white, and 1 is black. If we put the blocks in a line, how many arrangements are possible?arrow_forward3. (a) In how many ways can 3 cats and 3 dogs sit in a row? (b) In how many ways can 3 cats and 3 dogs sit in a row if the cats and the dogs are each to sit together? (c) In how many ways if only the cats must sit together? (d) In how many ways if no two animals of the same type are allowed to sit together?arrow_forwardthe gate level and the transistor level for a certain circuit are given below. Select from the given options for each space the variable name such that the transistor level design matches the gate level design. $1 => S2= M- W $3= |S4 = $5= J -R S1. S2- R S5 S3 S4arrow_forward
- Given that W, L. and tox are scaled with a scaling factor J, Vth and Vad are scaled with a scaling factor P Taking these scaling factors into consideration what is the scaling factor for metric X that equals loN C where loN is the on current of the transistor and C is the gate capacitance of the transistor. O p²/j2 O 1/P O J/P O 1/J2 O P/J2 O 1/(JP) O 1/p2 O P/J O 1/J2 O None of the other optionsarrow_forwardpython Tasks 7 • Task 1: Add a new class 'Moon` that inherits from `CelestialBody' and has an additional attribute `parent_planet. Write a method to display the moon's details along with its parent planet. • Task 2: Modify the 'Galaxy' class to calculate the total mass of all celestial bodies it contains. Implement a method `total_mass() for this purpose. • Task 3: Create a class 'BlackHole` that inherits from `Celestial Body` and adds properties like event_horizon_radius' and 'spins. Implement a method to display black hole details. • Task 4: Develop a simulation where a user can create multiple galaxies and display their celestial bodies in a hierarchical format using inheritance. 10/06/1446arrow_forwardPlease solve q2arrow_forward
- self.sAge = age super().__init_("Rahul", age) # inheriting the properties of def displayInfo(self): print(self.sName, self.sAge) obj = Student("Mayank", 23) obj.display() obj.displayInfo() parent class we created the object 'obj' of the child class. When we called the constructor of the child class 'Student', it initialized the data members to the values passed during the object creation. Then using the super() function, we invoked the constructor of the parent class. Asst.L. Manar Hamza Bashaa 2024-2arrow_forwardObject-oriented programming tion defines a new type of that class. Lec 7: Static Members Object-Oriented Programming Assignment: Create a class named StudentRecords and add a static variable named records, which is a list shared among all objects of the class. Then add a method named add_record that takes a student's name as input and appends it to the shared records list.arrow_forwardpython Tasks 6 • Task 1: Develop a Student Profile class with private attributes for `name` and __ grades` (a list of grades), and methods to add a grade and calculate the average. • Task 2: Create a `Playlist class that stores song titles in a private list, with methods to add a song, remove a song, and display the current playlist. • Task 3: Implement a `Temperature Sensor class with a private `_temperature attribute, and methods to set and get the temperature in both Celsius and Fahrenheit. • Task 4: Build a Library Book class with private attributes for the title and availability status; include methods to check out, return, and display the book's availability ⚫Task 5(homework): Create a 'Counter` class with a private _ count attribute, and include get_count()` and `set_count(value)` methods to access and modify it. Ensure set_count only accepts non-negative integers, and add increment()', decrement(), and reset()` methods for control.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY