Homework 3: Cache Organization and Indexing

Assigned Friday, November 13, 2014 Friday, November 20, 2014 at 5:00pm Submit a PDF file of your solutions here.

Introduction

The purpose of written homework assignments is to get you thinking about the topics being covered in lecture and in readings in the textbook which are not represented in the hands-on, programming lab assignments. These written assignments also better prepare you for course examinations. It is worth noting that the book contains many practice problems similar to the problems we ask on these written assignments! The solutions for those practice problems are located at the end of each chapter and should give you a feel for the kind of answers we expect you to turn in for these kind of assignments.

Logistics

Please write up your answers and submit them as a PDF file in the online dropbox. This simplifies our grading and ensures we read your answers clearly. If you don't know how to create a PDF, a quick internet search should help, or ask us.

We will provide solutions to all of the problems in the written homework assignments in a timely fashion after the assignment is due. This may be around 4 or 5 days after the due date, in general, because a student may use up to 3 late days on an assignment.

Notes

Make sure you are using the 3rd edition of Computer Systems: A Programmer's Perspective. If you're not using the right book, you might be doing the wrong problems!

Questions

1. Practice Problem 3.41, p. 268. How would you change the assembly code generated if we inserted another line into the C function between the first and second instructions (just before sp->p = .... ) as ` sp->s.y = 17;`?
5. Practice Problem 6.18, p. 637. Repeat for an algae struct that has 4 integer fields instead of 2. Execute the same *code* as shown (only access the original first two fields, do not access the two new fields). You can assume that the new struct looks something like: ``` struct algae_position { int x; int y; int z; int w;}```