Computer Systems: A Programmer’s PerspectiveInstructor’s Solution Manual 1Randal E. BryantDavid R. O’HallaronDecember 4, 20031Copyright c 2003, R. E. Bryant, D. R. O’Hallaron. All rights reserved.2Chapter 1Solutions to Homework ProblemsThe text uses two different kinds of exercises:Practice Problems. These are problems that are incorporated directlyinto the text, with explanatorysolutions at the end of each chapter. Our intention is that students will work on these problems as theyread the book. Each one highlights some particular concept.Homew ork Problems. These are found at the end of each chapter. Theyvaryin complexityfromsimple drills to multi-week labs and are designed for instructors to give as assignments or to use asrecitation examples.This document gives the solutions to the homework problems.1.1Chapter 1: A Tour of Computer Systems1.2Chapter 2: Representing and Manipulating InformationProblem 2.40 Solution:This exercise should be a straightforward variation on the existing code.2CHAPTER 1. SOLUTIONS TO HOMEW ORK PROBLEMS1011 void show_double(double x)12 {13show_bytes((byte_pointer) &x, sizeof(double));14 }code/data/show -ans.c1 int is_little_endian(void)2 {3/* MSB = 0, LSB = 1 */4int x = 1;56/* Return MSB when big-endian, LSB when little-endian */7return (int) (* (char *) &x);8 }1.2. CHAPTER 2: REPRESENTINGAND MANIPULATINGINFORMATION3There are many solutions to this problem, but it is a little bit tricky to write one that works for any wordsize. Here is our solution:code/data/shift-ans.cThe above code peforms a right shift of a word in which all bits are set to 1. If the shift is arithmetic, theresulting word will still have all bits set to 1.Problem 2.45 Solu tion:This problem illustrates some of the chall...