Assignment 7, due Oct 15
Part of
the homework for 22C:60, Fall 2010
|
Always write your name legibly as it appears on your University ID and on the class list!
SUBTITLE "REVERSE - reverse the order of bytes in a word" ; when called, it reverses the byte order of the word ; activation record structure ;RETAD = 0 REVERSE: ; expects R3 = pointer to a word in RAM ; conforms to the usual Hawk caling sequence ; when called, reverses the byte order of the word JUMPS R1
If REVERSE is called to operate on a word containing 0123456716, the word will be changed to hold 6745230116; that is, the order of the bytes in the word will be reversed.
The problem: Flesh out the subroutine so it works as specified. It's all a matter of extracting and stuffing the bytes. (1 point)
a) Give the truth table for this alternative way to compute the V condition code. (0.5 point)
b) Draw a schematic diagram for hardware to compute this function, using only and, or and not gates. (0.5 point)
An alternative approach to making an ALU do logic operations is to add extra inputs to the adder. Each of these extra inputs goes to one or more of the and gates in the and array of the adder. If all these extra inputs are one, the and array is fully enabled and the adder just adds. Setting each of these extra inputs to zero disables some subset of the and gates in the and array, forcing the adder to do some logic function.
a) Which gates in the and array of the adder should you disable to make the adder perform an exclusive-or operation? Hint: add becomes exclusive-or if you make it ignore the carry in line. (0.3 point)
b) Which gates in the and array of the adder should you disable to make the adder perform just an or operation? (0.3 point)
c) Draw the gate-level schematic view of an addre augmented with the auxiliary inputs supporting your answers to parts a and b. (0.4 point)