Quiz 1

advertisement
Quiz 1
CPE 484/584 -- Fall 2004
Chapters 1 – 3.8
Name: ___________________________
Student Number: ______________________
1) Fill in the blank. (1 point each)
A) The _assembler____translates a symbolic version of an instruction into the binary version.
B) The _operating system___ is a program that manages the resources of a computer for the benefit
of the programs that execute on the machine.
C) The __compiler_______ translates from a high-level language into assembly language.
D) The interface between the lowest-level software and the hardware is called the __ISA (Instruction set
architecture)_.
E) The instruction format used by the MIPS assembly slt instruction is called _R-format__.
2) A program executes in 10 seconds on machine 1 and in 5 seconds on machine 2. Which machine is
faster and by how much? (5 points)
a) Machine 1 is 2 times faster than machine 2
b) Machine 2 is 2 times faster than machine 1
c) Machine 2 is .5 times faster than machine 1
d) Not enough information to determine
answer:
B
3) Consider a program that contains 3 different classes of instructions. Class A instructions have a CPI of
3, class B instructions have a CPI of 1, and class C instructions have a CPI of 2. One compiler creates a
code sequence for this program containing 5 billion instructions of class A, 2 billion instructions of class B,
and 3 billion instructions of class C. Assuming the clock rate of the target machine is 600 MHz, what is the
CPU execution time for this program? What is the MIPS rating for this machine using this program? (5
points)
a) CPU exe time = 38.33 seconds, MIPS rating = 260.89
b) CPU exe time = 38.33 seconds, MIPS rating = 26.09
c) CPU exe time = 3.83 seconds, MIPS rating = 260.89
d) Not enough information to determine
answer:
A
4) Assume the execution time of some benchmark is 10 seconds. In order to improve this performance,
new floating-point hardware is incorporated that will execute floating-point instructions 5 times faster. If
the benchmark spends 50% of its time executing floating-point instructions, what will be the execution time
of the application using the new hardware? (5 points)
a) execution time = 2 seconds
b) execution time = 6 seconds
c) execution time = 5 seconds
d) Not enough information to determine
answer:
B
5) Machine A has a MIPS rating of 200 for a program that executes in 10 seconds. Assuming that the
same program executes on machine B in 20 seconds, what is the MIPS rating for machine B? (5 points)
a) MIPS rating = 100
b) MIPS rating = 150
c) MIPS rating = 50
d) Not enough information to determine
answer:
D
6) List the addressing mode used in each of the following MIPS assembly language instructions. (1 point
each)
a)
add
$s0, $s1, $s2
register addressing
b)
bne
$s0, $zero, label
PC-relative addressing
c)
lw
$s0, 4($sp)
base or displacement addressing
d)
j
label
pseudo-direct addressing
e)
slti
$s0, $s1, 4
immediate addressing
Download