Assignment 8, due Oct 19
Part of
the homework for 22C:60, Fall 2007
|
Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due at the start of class on the day indicated (usually a Friday). The only exceptions to this rule will be by advance arrangement unless there is what insurance companies call "an act of God" - something outside your control. Homework must be turned in on paper and in class! Late work may be turned in to the teaching assistant's mailbox, but see the late work policy. Never push late work under someone's door!
a) Given that R3 contains a number, write code to compute, in R4, the the largest power of two less than or equal to the value in R3. It can be done in 6 instructions, using SL and SR instructions to multiply and divide by 2. (0.5 points)
b) Examine the high-level language pseudocode in the assignment for the recurisve routine to display one gasket. What point on the gasket is the point passed to the Gasket routine to make it plot that gasket? Consider expressing your answer with a picture of a gasket with an X on the point in question, although you could also name the point verbally, as in "lower right" or "center" or "upper left". (0.5 points)