Assignment 10, due Nov 7
Part of
the homework for 22C:60, Fall 2008
|
Remember to write your name on what you turn in! Homework must be turned in on paper and in class!
a) Enumerate the files you would plan on writing for an assembly language implementation the class rational and the subclasses listed above. Do not enumerate machine-generated files such as object files. Only list the files you would write directly. With each file, very briefly describe its contents. (0.4 points)
b) Assume we are using a tag-descriptor implementation of polymorphism. Which of the above files would contain the declaration of the structure of the class descriptor used for operating on objects of type rational. (0.3 points)
c) As in part b, assume we are using a tag-descriptor implementation of polymorphism. Which of the above files would contain the actual SMAL code to create a each of the class descriptors? (0.3 points)
With this format, we have no hidden bits. The mantissa runs from 0.99999 on the positive side to -1.00000 on the negative side It would be sensible to normalize the fraction so that the absolute value of the mantissa is greater than or equal to 0.5. In this format, give the representation for each of the following decimal values: (0.2 points each)
a) 1.0
b) -10.0
c) 100.0
d) 0.1
e) 0.01