You should be able to do most of the questions in Chapter 2. Once you have understood the basic concepts most of the questions are just common sense.
What does the following program do?
Assume that the register
$s0 contains the address
sw $zero , 4($s0)
exit: jr $31
Question 2 Write a subroutine which takes two parameters in
$a0 which contains the base address of an
integer array and
which contains the length of that array. The subroutine should return
a count of the number of elements which are equal to zero in register
$v0. For example given the array:
the subroutine should return
3. You must restore any non-temporary registers used in the subroutine using the stack.
Describe, with examples, the difference between the following instructions:
Question 1 Why is it not necessary to have a special subtraction circuit inside a processor?
Question 2 First draw a digram representing the gates needed to implement the following boolean expression:
.represents the logical operation and and
+represents the logical operation or. Next draw the truth table. Assuming each logic gate takes 4ns to compute its output when the input signals change compute how long the whole circuit will take to compute the the output from the input. (Hint longest path.)
Floating point: Briefly explain the principles of representing floating point numbers, you don't need to worry about biased exponents.
Floating point division: Describe a simple algorithm for the floating point division of two numbers which assumes that you all ways have enough bits in each field to represent the answer, i.e. you don't have to worry about normalising any of the fields. You should be able to work this out from first principles.
Floating point, problems: What sort of problems should a programmer be aware of when using floating point numbers.
Suppose you where implementing a very simple processor for control applications which didn't use floating points numbers and only had to do simple arithmetic (no multiplication or division) would a single cycle implementation be inappropriate?
Why are single-cycle implementations not used for modern general purpose processors?
What is data forwarding and how does it help to avoid pipeline stalls? Give some examples where it is useful.
Rearrange the following code to avoid pipeline stalls. You can assume that the processor has a forwarding mechanism:
One commonly used programming optimisation is to claim larger blocks of memory ahead of time instead of claiming lots of small blocks of memory at different times when needed. Why does this optimisation sometimes give you gains on processors and architectures with caches and virtual memeory?Justin Pearson