Assignment 5, due Feb 20
the homework for 22C:122/55:132, Spring 2004
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 on Fridays at the start of class, and unless there is what insurance companies call "an act of God", the only exceptions to this rule will be by advance arrangement.
Consider the Ultimate RISC, with a the 8-function ALU documented in the notes, for example; direct addressing on this machine is the only obvious addressing mode, but languages like C demand far more; show how each of the following can be done in this horrible little instruction set:
a) Given the variable p, holding a pointer, you must be able to load or store the value of *p, the variable pointed to by that pointer.
b) Given that the variable a holds the address of word zero of an array of integers, and the variable i holds an one-word item, compute the address of the array element a[i].
c) Given that the variable s holds the address of a structure in memory, and that the constant f is the displacement of a field from the start of that structure, compute the address of the field s->f (which, in C, can also be written as (*s).f).
a) Looking at the program-style description of the fetch-execute cycle, evaluate two alternatives: First, the 6-bit instruction is forbidden to cross word boundaries, and second, we allow the 2 3-bit syllables of the 6-bit instruction to span word boundaries. Which alternative would you prefer to implement? Justify your answer.
b) Give the program-level description for your preferred solution.
c) Give the register-transfer component level design for your preferred solution.
d) Give the control unit microcode for your preferred solution, with sufficient documentation that it can be understood in terms of parts b and c.