quiz #2

advertisement
Quiz 1
CPE 484/584 -- Fall 2004
Chapters 1 – 3.8
Name: ___________________________
Student Number: ______________________
1) Given the following C statement, what is the corresponding correct MIPS assembly instruction(s) that
will perform the same functionality? Assume the compiler assigns the variable B to the register s0 and the
base address of array A to register s1. (5 points)
B = A[4];
a) lw
b) sw
c) lw
d) lw
$s1, 4($s0)
$s0, 16($s1)
s0, 4(s1)
$s0, 16($s1)
answer:
D
2) Given the following MIPS assembly instruction, what is the corresponding machine language
instruction in hexadecimal? (5 points)
add
$t0, $t1, $t2
a) 012A4020
b) 01095020
c) 212A4020
d) 252A5020
answer:
A
3) Given the following MIPS machine language instruction in hexadecimal, what is the corresponding
MIPS assembly language instruction? (5 points)
2A080004
a) addi
b) slti
c) slt
d) subi
$s0, $t0, 4
$s0, $t0, 4
$t0, $s0, 4
$t0, $s0, 4
answer:
B
4) Assume the execution time of some application is 12 seconds. In order to improve its performance, the
entire application is uniformly broken into pieces and executed on a multiprocessor having 4 CPUs. The
resulting execution time is 5 seconds. What is the speedup of the parallelized application? (5 points)
a) speedup = 2.4
b) speedup = 0.42
c) speedup = 3.4
d) Not enough information to determine
answer:
A
5) List the four (4) design metrics that are used in the design of the MIPS architecture. (4 points)
1) Simplicity favors regularity
2) Smaller is faster
3) Make the common case fast
4) Good designs require good compromises
6) Which of the following addressing modes is NOT used in the MIPS architecture? (6 points)
a) register addressing
b) base (displacement) addressing
c) PC-relative addressing
d) indexed addressing
e) pseudo-direct addressing
answer:
D
Download