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
Textbook Question
Chapter 9, Problem 9.15HW
Determine the block sizes and header values that would result from the following sequence of malloc requests. Assumptions: (1) The allocator maintains double-word alignment and uses an implicit free list with the block format from Figure 9.35. (2) Block sizes are rounded up to the nearest multiple of 8 bytes.
Request | Block size (decimal bytes) | Block header (hex) |
malloc(3) | ______ | ______ |
malloc(11) | ______ | ______ |
malloc(20) | ______ | ______ |
malloc(21) | ______ | ______ |
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
SAME PARAMETERS: In the RENTALS table shown in fig
2, 40 customers have created 50 rental contracts over
time. A RENTALS record is 122 bytes and the block size for
your OS is set to 1024 bytes with each block having a 1
byte pointer to the next written block as well as a 1 byte
pointer to the next physically consecutive block.
N
(1, 1)
StartDate
Term
NoOfDays
ested
ite)
var(Requested
EndDate)
DReturnDate
IfDailyTerm
NoOWeeks
NEW
RESERVATION
RENTALS
rweeklyTerm
(1, 1)
WReturnDate
(1, 1)
AmountDue
Contractt
VID
CID
ActualReturn
RID
Date
ВOOKED
FOR
Assuming spanned organization, how many blocks do you
estimate the RENTALS file is using at its current size?
400
O 50
O 7
You are required to develop a data structure which keeps the record of the courses an ABCuniversity offers. A student shall only be enrolled in a course if its prerequisite is cleared.All the courses will have an address to its prerequisite course being offered and shall be calledits neighboring nodes. Course details should include course name and credit hours.A. Implement an insert function in a relevant data structure which store course details.Note: When a new course is inserted it must verify its previous course is a prerequisite ofthe inserted course.B. Implement a function which take user details and allocate him/her in Data structurecourse after verifying prerequisite courses.C. Implement a function in which we can check credit hours of any course.
Memory Allocation (20 minutes)
Assume you have a buddy allocator that initially has a single 512 byte free block. You cannot allocate more memory.
The first allocation is for 200 bytes. Describe how the allocation occurs with the buddy algorithm. State what's in the free list after the allocation.
How many bytes are lost to internal fragmentation after this first allocation?
Next, we deallocate the 200 byte allocation. Describe what happens. State what the free list looks like now.
Now, we get 4 different 100 byte allocations. You don't have to describe the process. However, state the free list at the end of all 4 allocations.
How many bytes are lost due to internal fragmentation after the 4 allocations?
Describe an approach you could take to fit another 100 byte allocation within your original 512 bytes. You can assume you can use your approach to allocate all 5 100 byte allocations
from scratch.
Chapter 9 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 9.2 - Prob. 9.1PPCh. 9.3 - Prob. 9.2PPCh. 9.6 - Prob. 9.3PPCh. 9.6 - Prob. 9.4PPCh. 9.8 - Practice Problem 9.5 (solution page 882) Write a C...Ch. 9.9 - Prob. 9.6PPCh. 9.9 - Prob. 9.7PPCh. 9.9 - Prob. 9.8PPCh. 9.9 - Prob. 9.9PPCh. 9.9 - Prob. 9.10PP
Ch. 9 - Prob. 9.11HWCh. 9 - Repeat Problem 9.11 for the following address....Ch. 9 - Repeat Problem 9.11 for the following address....Ch. 9 - Given an input file hello.txt that consists of the...Ch. 9 - Determine the block sizes and header values that...Ch. 9 - Prob. 9.16HWCh. 9 - Prob. 9.17HWCh. 9 - Prob. 9.18HWCh. 9 - Prob. 9.19HWCh. 9 - Write your own version of malloc and free, and...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Create an object of class Student. You will notice that this time you are prompted not only for a name of the i...
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Explain the difference between redundancy and diversity.
Software Engineering (10th Edition)
It is considered good programming practice to store the declaration for a class, its function definitions, and ...
Starting Out with C++: Early Objects
Bug Collector The Bug Collector Problem A bug collector collects bugs every day for five days. Write a program ...
Starting Out with Python (3rd Edition)
When two operators share an operand, the operator with the highest _____ executes first.
Starting Out With Visual Basic (7th Edition)
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
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
- How is an array stored in main memory? How is a linked list stored in main memory? What are their comparative advantages and disadvantages? Give examples of data that would be best stored as an array and as a linked list.arrow_forwardCreate an aligned malloc and free code that enables memory allocation with the requirement that the returned memory value be divisible by a particular power of two.The memory location returned by EXAMPLE align_malloc (1000, 128) is a multiple of 128 and refers to memory with a 1000-byte capacity.Memory allotted by align_malloc will be released by aligned_free().arrow_forwardQuestion No 5 1. Assume that the following variables have been defined: .data val1 dw 2000h val2 dw1000h val3 dw 0 The following statements call a procedure named Exchange, using stack parameters: push offset val1 push offset val2 call Exchange add sp,4 The Exchange procedure exchanges the values of val1 and val2, so that after the call, val1 equals 1000h and val2 equals 2000h. Here is the beginning of Exchange: Exchange proc Exchange push ebp mov ebp,esp What instructions should occur next in the Exchange procedure to complete the exchange of the values inside the two variables that were passed to this function?arrow_forward
- Local addresses The "A1" address system has coordinates that exist over the whole worksheet. If you have a block of data specified somewhere within that worksheet, it can be useful to be able to specify the addresses relative to that block. This can be done with INDEX(), which takes 3 arguments. The first argument is a rectangular range of data, for example A2:E8. The second and third arguments are numbers specifying an offset down then right from the top left of that data range. Unlike OFFSET(), the numbering starts at 1, so INDEX(A2:E8, 4, 2) refers to cell B5. Instructions Use the block of data for North East India + North Myanmar, from A11 to G19 as the reference. In cell I1, use INDEX() to get the number of Blues in Sikkim. In cell I2, get the number of White-yellows in Mizoram Hills. please show the formulas in excel thank you :) Area Locality Skipper Swallowtail White-yellow Blue Brush-footed Blues in Sikkim Indian Subcontinent Indian Subcontinent 307 94 99…arrow_forwardData Structures and Algorithm (Only using C/C++) Note: Write it using Structures Q. Write down a simple code for stroing studnet data in a link list.You must be able to search the record of a particular student and display it on demand.the following information must be stored. 1. student full id e.g sp17-bcs-0092. student name3. student current semester4. student CGPAarrow_forwardPart Two: Implementing a rainbow table You are to write a program, in C/C++, Java or Python, that should run using the following instruction: $ ./Rainbow Passwords.txt where the file Passwords.txt contains a list of possible passwords. The password file contains a password per line, as in the provided words file and consists of strings of printable characters. Any password used must be taken from this file, so the only stored hash information needs to relate to those entries in the file. The program is used to find pre-images for given hash values. Rainbow tables can be used to solve pre-image problems for hash functions. At the simplest level they can simply be a list of hash values and the corresponding pre-images, often from some dictionary. This can be expensive in terms of storage space however, and a more efficient way of identifying pre-images involves the use of the hash function and reduction functions. First step The process is as follows: 1. Read in the list of possible…arrow_forward
- Python Programming Problem: Simple Soccer Point TableThe programmer will design a simple point table lookup and update application. The table contains some basic information: team_name, match_played, win, draw, loss, point and rank. Design Solution:1. English Premier League is a prestigious soccer league. Here is the result of its one session. Man. City|38|32|2|4|98|1Liverpool|38|30|7|1|97|2Chelsea|38|21|9|8|72|3Tottenham|38|23|2|13|71|4Arsenal|38|21|7|10|70|5 2. Hypothetically, you have been assigned to design a simple lookup software for prestigious ‘English Premier League’ from a given point table. The point table contains team_name, match_played,win, draw, loss, points and rank. 3. The input file, ‘previous_result.txt’ has been provided to you above the top 5 teams in 2018-19 session. Your software needs to be able to search and update the point table based on user input. For example: The first time Chelsea played 38, the second time it changed (based on user input) to 40 and so…arrow_forward6. The figure below is a uni-directional list. Manila is the head of the list and the pointer contains addresses of data shown below. Batanes is the tail of the list and the pointer contains 0. Choose one correct way to insert Cebu placed at address 150 between Boracay and Davao. a) The pointer for Cebu to be set to 50 and that for Davao to be set to 150b) The pointer for Cebu to be set to 70 and that for Boracay to be set to 150c) The pointer for Cebu to be set to 90 and that for Davao to be set to 150d) The pointer for Cebu to be set to 150 and that for Boracay to be set to 90arrow_forward4. Write a program to implement the address book using dynamic singly linked list, the node should contain name, address and phone#: (1) Write a function create to store three people's information into the singly linked list; (2) Write a function print to print these information to the standard output; (3) Write a function search to find the telephone number of a contact input by name. CA "C:\Documents and Settings\Administrator á Lab\2\Debug\final.2.exe" ******************* Input ******************* Input name: Zhang San Input address: XUPT Input phone: 123456 Input name: Li Si Input address: XJTU Input phone: 789012 Input name: Wang Wu Input address: Clemson Input phone: 345678 ******************* andano ******************** Name: Zhang San Address: XUPT Phone: 123456 Name : Li Si Address: XJTU Phone: 789012 Name: Wang Wu Address: Clemson Phone: 345678 Please input the name to search: Li Si Contact Li Si: phone number is 789012 Press any key to continue.arrow_forward
- SAME PARAMETERS: In the RENTALS table shown in fig 2, 40 customers have created 50 rental contracts over time. A RENTALS record is 122 bytes and the block size for your OS is set to 1024 bytes with each block having a 1 byte pointer to the next written block as well as a 1 byte pointer to the next physically consecutive block. Assuming spanned organization, how many blocks do you estimate the RENTALS file is using at its current size? multiple choice a.50 b.6 c.400 d.7arrow_forwardHW/ Assume that DS=4500, SS=2000n, BX =2100n, SI=1486, DI 8500, BP=7814, and AH=25. 1-Show the PA location where AH content is stored in each of the following. A) MOV AH, [BX] +20 B) MOV AH, [SI] +10 C) MOV AH, [DI][(BX]+4 D) MOV AH, [BP] +12arrow_forward1. Given the data below, construct a Pandas program to generate and display a DataFrame with index labels df = pd.DataFrame( {'ord_no':[70001,np.nan,70002,70004,np.nan,70005,np.nan,70010,70003,70012,np.nan,70013], 'purch_amt':[150.5,270.65,65.26,110.5,948.5,2400.6,5760,1983.43,2480.4,250.45, 75.29,3045.6], 'ord_date': ['2012-10-05','2012-09-10',np.nan,'2012-08-17','2012-09-10','2012-07-27','2012-09-10','2012-10-10','2012-10-10','2012-06-27','2012-08-17','2012-04-25'], 'customer_id':[3002,3001,3001,3003,3002,3001,3001,3004,3003,3002,3001,3001], 'salesman_id':[5002,5003,5001,np.nan,5002,5001,5001,np.nan,5003,5002,5003,np.nan]}) 2. Write a Pandas program to detect missing values of a given DataFrame. Display True or False.3. Remove all the columns and rows that has missing values.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Instruction Format (With reference to address); Author: ChiragBhalodia;https://www.youtube.com/watch?v=lNdy8HREvgo;License: Standard YouTube License, CC-BY