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
Question
Chapter 6.5, Problem 6.19PP
A.
Program Plan Intro
Given Information:
The definition for the code is mentioned below:
//Traverse through the grid
for (i =0; i < 16; i++)
{
for (j = 0; j < 16; j++)
{
//add values of x into grid
total_x += grid[j][i].x;
//add values of y into grid
total_y += grid[j][i].y;
}
}
B.
Program Plan Intro
Given Information:
The definition for the code is mentioned below:
//Traverse through the grid
for (i =0; i < 16; i++)
{
for (j = 0; j < 16; j++)
{
//add values of x into grid
total_x += grid[j][i].x;
//add values of y into grid
total_y += grid[j][i].y;
}
}
C.
Explanation of Solution
Miss rate:
- The cache can only hold half of the elements in the array, so that means that a read to grid[8][0] will evict the block that was loaded when we read grid[0][0]. Since this block also contained grid[0][1], the first read of grid[0][1] will be a miss.
- Hence, each iteration will have one hit and one miss.
- This means one will have 256 hits and 256 misses...
D.
Explanation of Solution
New Miss Rate:
If the cache were twice as big the n it could hold the entire grid array and the only misses would be the initial cold miss...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
(c) The following Sigma 16 program has been loaded into memory at address 0000:
load R3,y[RO]
load R4,x[RO]
lea R5, 2[RO]
sub R1,R4,R3
mul R2,R1,R5
store R2,w[RO]
trap RO,RO,RO
x data 10
y data 12
w data 0
Show the content of the memory writing hexadecimal representation and using a
table with 3 columns: the memory address, the contents of that memory address,
and an explanation of what "the content (of that memory address) means". As a
reference, here are the opcodes for RRR instructions: add 0, sub 1, mul 2, trap c.
And here the opcodes for RX instructions: lea 0, load 1, store 2.
[7]
6
(d) Given memory holes (i.e., unused memory blocks) of 100K, 500K, 200K, 300K and
600K (in address order) as shown below, how would each of the first-fit, next-fit, best-
fit algorithms allocate memory requests of 120K, 320K, 280K, 90K and 210K (in this
order). The shaded areas are used/allocated regions that are not available.
100k 500k
200k
300k
600k
Figure 2: Current status of main memory
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
Similar questions
- subject : computer architectures and organization (computer science)arrow_forwardComputer science Computer organization subjectarrow_forward10:22 Q4: [Principal Component Analysis] a. Write the pseudo-code of the Principal Component Analysis algorithm b. A study revels that the average temperature and energy demanded are correlated in nature. The study help to forecast the energy demand as a function of the average temperature. The average temperature let x °F and the day's energy demand denoted as 'y' (MWH) were recorded. Compute the principal component of the given data using PCA Algorithm as a function of Covariance matrix, Eigen values and eigenvectors of the covariance matrix, and Feature vectors Q6: [Aprori Algorithm] a. b. Observation No Average Temperature (X) Energy Demand (Y) 1 69 146 2 of 4 Q5: [Search Algorithm] a. Write the pseudo-code of the following search algorithm i. Uniform cost search II. Iterative Deepening Search b. Discuss the working principle, strength, and limitation of the following search algorithm i. Uniform cost search ii. Iterative Deepening Search C. Consider the following initial state of…arrow_forward
- (d) You are working on a redesign of a simple 16-bit computer which supports at most 64 kilobytes of memory. Currently, memory is word-addressed and all memory accesses load or store a 16-bit value. For example, LDA Ox6502 loads a 16-bit value from address Ox6502 into register A. The change is to support additionally 8-bit accesses, thanks to an expanded machine language (already designed by a colleague) which now supports instructions such as: ; load 16 bits from addr 6502 into A ; load 8 bits from addr 6502 into A LDAW Ox6502 LDAB Ox6502 Outline, at a high level, how you would bring about this change in the CPU design, and mentioning any difficulties you expect to encounter.arrow_forward(Part C) Design 32KW, fully associative cache that has 4 32-bit words per block. Assume a 32. bit address. Calculate the following: (a) How many bits are used for the byte offset? (b) How many bits are used for the block offset? (c) How many bits are used for the index field? (d) How many bits are used for the tag? (e) What is the physical size of each set (show as bits/row * # of rows, x * 2V)?arrow_forward(e) Instruction(s) to copy contents at one memory location to another: C[g] =A[i+j-3). Assume i, j,g values are in registers x5, x6, x7. Assume base address in memory of Array data structures 'A, B' (or address in memory of 'A[O]' and 'B[O]') are stored in Registers x28, 29• In RISCV, only load and store instructions access memory locations • These instructions must follow a 'format' to access memory • Assume a 32 bit machine in all problems unless asked to assume otherwisearrow_forward
- Q4) Are these instruction true or false ?why?(choose five only) 1) LDI R13, 0x20 2) Harvard architecture consist of separate memories. 3) MOV Cs, AX 4) MOV AL, [BX] 5) To configure port B as output LDI R16, OXFF OUT DDRC, R16 6) To read the content of port C LDI R20, Ox00 OUT DDRC, R 20 م.م هاجر فيصل جبار مدرس المادة التوقيع :arrow_forwardProblem 1.10: Simplify F(A, B,C, D) = ACD+ A'B + D'arrow_forwarda) A block-set associative cache memory consists of 128 blocks divided into four block sets. The main memory consists of 32,768 blocks and each block contains 512 eight-bit words (1) How many bits are required for addressing the main memory? (ii) How many bits are needed to represent the TAG SET and WORD fields? b) Write a program to code the equation X=(A+B)L| ((C+D) using one-address instructions. Please solve only the b partarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- 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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education