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
Expert Solution & Answer
Chapter 3.6, Problem 3.19PP
a.
Explanation of Solution
Miss penalty:
- The term “p” denotes misprediction probability.
- The “TOK” denotes time for execution of code without misprediction.
- The misprediction penalty is denoted by “TMP”.
- The average time to execute code as a function of “p” is shown below:
Tavg(p) = TOK + pTMP
- The equation for miss penalty is shown below:
TMP = 2(Tran - TOK)
- The “Tran” denotes average time for random pattern...
b.
Explanation of Solution
Miss penalty:
- The term “p” denotes misprediction probability.
- The “TOK” denotes time for execution of code without misprediction.
- The misprediction penalty is denoted by “TMP”.
- The average time to execute code as a function of “p” is shown below:
Tavg(p) = TOK + pTMP
- The equation for miss penalty is shown below:
TMP = 2(Tran - TOK)
- The “Tran” denotes average time for random pattern...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
(a) A ssume that five generation unıts with third order cost
function (F, (P) = A; P+ B;P+C; P; + D;) are in the circuit.
Write a computer program using any arbitrary programming
language (MATLAB, C++, C#, Python,.) to calculate economic
load dispatch (ELD) using first order gradient method.
Note that all parameters and variables should be defined
inside the
program
(at tirst limes) such that units' charactenistics
and demand can be changed easily. Neglect grid losses.
O using lambda - iteration method.
Chapter 3: Practice Problems
VIII. You are given the following C code to compute integer absolute value:
int abs(int x)
{
}
return x > (sizeof(int)*8-1);
int comp = x mask;
return comp;
}
A. What bit pattern does mask have, as a function of x?
B. What numerical value does mask have, as a function of x?
C. For what values of x do functions abs and opt abs return identical
results?
D. For the cases where they produce different results, how are the two
results related?
E. Show that with the addition of just one single arithmetic operation
(any C operation is allowed) that you can fix opt abs. Show your
modifications on the original code. (You can just provide the line that
you will add).
F. Are there any values of x such that abs returns a value that is not
greater than 0? Which value(s)?
(ii)
(a)
What is the smallest d > 0 for which there might be
a length 8 perfect d-error correcting code over F7?
Chapter 3 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 3.4 - Prob. 3.1PPCh. 3.4 - Prob. 3.2PPCh. 3.4 - Prob. 3.3PPCh. 3.4 - Prob. 3.4PPCh. 3.4 - Prob. 3.5PPCh. 3.5 - Prob. 3.6PPCh. 3.5 - Prob. 3.7PPCh. 3.5 - Prob. 3.8PPCh. 3.5 - Prob. 3.9PPCh. 3.5 - Prob. 3.10PP
Ch. 3.5 - Prob. 3.11PPCh. 3.5 - Prob. 3.12PPCh. 3.6 - Prob. 3.13PPCh. 3.6 - Prob. 3.14PPCh. 3.6 - Prob. 3.15PPCh. 3.6 - Prob. 3.16PPCh. 3.6 - Practice Problem 3.17 (solution page 331) An...Ch. 3.6 - Practice Problem 3.18 (solution page 332) Starting...Ch. 3.6 - Prob. 3.19PPCh. 3.6 - Prob. 3.20PPCh. 3.6 - Prob. 3.21PPCh. 3.6 - Prob. 3.22PPCh. 3.6 - Prob. 3.23PPCh. 3.6 - Practice Problem 3.24 (solution page 335) For C...Ch. 3.6 - Prob. 3.25PPCh. 3.6 - Prob. 3.26PPCh. 3.6 - Practice Problem 3.27 (solution page 336) Write...Ch. 3.6 - Prob. 3.28PPCh. 3.6 - Prob. 3.29PPCh. 3.6 - Practice Problem 3.30 (solution page 338) In the C...Ch. 3.6 - Prob. 3.31PPCh. 3.7 - Prob. 3.32PPCh. 3.7 - Prob. 3.33PPCh. 3.7 - Prob. 3.34PPCh. 3.7 - Prob. 3.35PPCh. 3.8 - Prob. 3.36PPCh. 3.8 - Prob. 3.37PPCh. 3.8 - Prob. 3.38PPCh. 3.8 - Prob. 3.39PPCh. 3.8 - Prob. 3.40PPCh. 3.9 - Prob. 3.41PPCh. 3.9 - Prob. 3.42PPCh. 3.9 - Practice Problem 3.43 (solution page 344) Suppose...Ch. 3.9 - Prob. 3.44PPCh. 3.9 - Prob. 3.45PPCh. 3.10 - Prob. 3.46PPCh. 3.10 - Prob. 3.47PPCh. 3.10 - Prob. 3.48PPCh. 3.10 - Prob. 3.49PPCh. 3.11 - Practice Problem 3.50 (solution page 347) For the...Ch. 3.11 - Prob. 3.51PPCh. 3.11 - Prob. 3.52PPCh. 3.11 - Practice Problem 3.52 (solution page 348) For the...Ch. 3.11 - Practice Problem 3.54 (solution page 349) Function...Ch. 3.11 - Prob. 3.55PPCh. 3.11 - Prob. 3.56PPCh. 3.11 - Practice Problem 3.57 (solution page 350) Function...Ch. 3 - For a function with prototype long decoda2(long x,...Ch. 3 - The following code computes the 128-bit product of...Ch. 3 - Prob. 3.60HWCh. 3 - In Section 3.6.6, we examined the following code...Ch. 3 - The code that follows shows an example of...Ch. 3 - This problem will give you a chance to reverb...Ch. 3 - Consider the following source code, where R, S,...Ch. 3 - The following code transposes the elements of an M...Ch. 3 - Prob. 3.66HWCh. 3 - For this exercise, we will examine the code...Ch. 3 - Prob. 3.68HWCh. 3 - Prob. 3.69HWCh. 3 - Consider the following union declaration: This...Ch. 3 - Prob. 3.71HWCh. 3 - Prob. 3.72HWCh. 3 - Prob. 3.73HWCh. 3 - Prob. 3.74HWCh. 3 - Prob. 3.75HW
Knowledge Booster
Similar questions
- 4.25. Use the equations in the book or the computer program of this chapter. Find the radiation efficiency of resonant linear electric dipoles of length (a) I = 1./50 (b) I=1/4 (c)l=1/2 (d)1 =1 Assume that each dipole is made out of copper [o = 5.7 x 107 S/m], has a radius of 10-42, and is operating at f = 10 MHz. Use the computer program Dipole of this chapter to find the radiation resistances.arrow_forward(c) A third expression is due to Wallis (1656): ㅠ 2 2 4 4 6 6 ² = ( ² × ²3 ) × ( ² × ¦ ) × ( ÷ × ;) 2 1 3 5 5 7 X... X 2i 2i X 2i 1 2i + 1 :) X... Write a function pi_wallis (n) which takes an integer n as input and returns an approximation of by evaluating the Wallis formlua with n brackets in the formula. (For example, pi_wallis (3) should return 2.9257142857....)arrow_forwardProblem 19. Double numerical integration is the application twice of a numerical integration method for single integration, once for the y direc- tion and another for the x direction. Any numerical integration method for single integration can be applied to double integration. Write a C++ program that applies Simpson's 1/3 rule to find the double integral 1-CC %3D3 ry%3+exp(x/5) I sin(x +y)dy) dr. %3D Jy=In(x)arrow_forward
- (a) Assume that five generation units with third order cost function (F, (R) = A; P+ B;P+C; P; + D;) are in the circuit. Write a computer program using any abitrary programming longuage (MATLAB, C++, C#, Python,.) to calculate economic load dipatch (ELD) using first order gradient method. Note that all parameters and variables should be defined inside the program (at tirst lines) such that units' characteristics and demand can be changed easily. Neglect grid losses. jusing dynamic programming (DP) methed.arrow_forwardI am trying to plot the Euler parameters constraint equation vs revolutions and plot nutation, precession, and spin angles vs time. I am unable to run this code with the [q1; 0; 0; q4;0;1;0] initial conditions. I cannot run the code with initial condition [q1; 0; 0; q4;0;1;0] or [q1; 0; 0; q4;0;-1;0]. But it works fine for any higher whole number such as [q1; 0; 0; q4;0;2;0]. Why is that? How can I fix this? clc;clear all; q1 = sin((6/2)*pi/180);q4 = cos((6/2)*pi/180);t = 0:0.01:(2*pi*4);options=odeset('RelTol',1e-12,'AbsTol',1e-12);[t,y] = ode45(@euler_eqns, t, [q1; 0; 0; q4;0;1;0], options);q = y(:,1:4)w = y(:,5:7) K = q(:,1).^2 + q(:,2).^2 + q(:,3).^2 + q(:,4).^2;K0 = 1;c = K - K0;v = t / (2*pi); plot(v,c);xlabel('revs ');ylabel('K-K0'); nutation = acos(1 - 2*q(:,1).^2 - 2*q(:,3).^2);precession = asin((2*(q(:,1).*q(:,2) - q(:,3).*q(:,4)))./(sin(nutation)));spin = asin((2*(q(:,1).*q(:,2) + q(:,3).*q(:,4)))./(sin(nutation))); psi = rad2deg(precession);theta = rad2deg(nutation);phi…arrow_forward1. (Shortest Path) Please find the shortest path between the blue triangle and red tri- angle as Figure 1. Please explain your approach and develop the computationally efficient algorithm to get the results. Can you obtain (or estimate) the time com- plexity and memory complexity of your algorithm? 麗arrow_forward
- PRACTICE PROBLEM #1 a) Write pseudo code algorithm for a SIGN(X) function. b) Write Using the SIGN(X) function above, write the pseudo code algorithm that chooses the nearest distance solution from a set of possible solutions for either (prismatic or revolute joints). Assume the joint has a limit dЄ[0,40mm], OE[-4ñ/3, 4ñ/3].arrow_forward7) A bob attached to a cord is moved to the right where its vertical position is 1.05 cm above the equilibrium position and is then given an initial speed of 0.6 m/s. What are the values of the maximum speed and maximum height reached by the bob? (Take g = (a) hmax (b) hmax (c) hmax (d) hmax 9.8 m/s*) 1.87 cm; vmax = 3.44 m/s = 2.89 cm; v. = 0.75 m/s 1.87 cm; vmax = 0.75 m/s = 2.89 cm; v = 3.44 m/sarrow_forwardPROBLEM 21 - 0517: Write a subroutine which computes the roots of the quadratic equation a,x2 + a,x + a, = 0 according to the quadratic formula: X12 = (-az/2a,) + V[(a,/2a,)2 – (a,/a,)) (= [{a, + v(a?, - 4a,a,)} / 2a,]) (START SUBROUTINE QUAD COMPUTE, DISCRIMINANT (DISC) DISCarrow_forwardPractice Problems (5) 1) Write a program to make a table of the physical properties for water in the range of temperatures from 273 to 323 K. The Density : The conductivity: K= 0.34 + 9.278 * 10* T The Specific heat: Cp= 0.015539 (T – 308.2)² + 4180.9 p= 1200.92 – 1.0056 T + 0.001084 Tarrow_forward(c). Two Computer Science students, Priscilla and Julius, are discussing how to compare two algorithms for solving a given problem. Priscilla suggests that they should use the execution times of the algorithms as criterion; but Julius insists that they should use the number of statements the algorithms execute as criterion. Discuss the reasons why both criteria they are considering are not good for comparing algorithms; and recommend an ideal solution/criterion that Priscilla and Julius should rather use for comparing algorithms.arrow_forwardPROBLEM 24 - 0578: (a) Water flows into a tank at a constant rate Q. Q is determined by the position of a valve connected to the inflow pipe. Write a FORTRAN program to simulate this system, using Euler's method, from time t = 0 to t = tf if V(0) = Vo and the capacity of the tank is C units of volume. Compare the Euler approximations with the exact values. (b) A hole is made in the bottom of the tank allowing water to flow out at a constant rate, Q1. Modify the program of part (a) to simulate this system. YALVE a YALVE WATER WATER yu WATER LEVEL TANK WATER LEVEL TANKarrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_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