24 February, 1994
The entire exam is to be turned in at 2:55PM. Work the closed book section first and turn it in before you consult your books and notes to work on the open book section.
Write a program to evaluate the C statement
C = X+Y*(Z+C) ; E = Z + C ;
in the machine language of a generic accumulator type computer with one address instructions.
Why does the evaluation of the following C statement
X = A[I]
involve an multiplication by four when implemented in most machine languages?
Which of the following two loops is likely to be faster when both are executed in a pipelined computer architecture
for (i=0; i<10000; ++i) for (i=0; i<10000; ++i) s = s + A[i] ; A[i] = s + A[i] ;
Explain your reasoning!
Translate the following expression into RPN:
(B + C * A) + X + Y * Z