Quiz 1
112-1 Computer Organization
Name Student ID No.
(姓名) (學號)
( A ) 1. Which of following is wrong?
(A) MIPS processor has a CISC instruction set architecture.
(B) MIPS has 32 general purpose registers inside CPU.
(C) MIPS use big-endian scheme to arrange data into memory address.
(D) MIPS processors use a fixed instruction length.
( C ) 2. Assume the data is stored starting at address 0. Which of following is true for
arranging the value 0xfedcba98 in memory of a little-endian machine?
(A) (B) (C) (D)
Addres Data Addres Data Addres Data Addres Data
3 98 s 3 89 s 3 fe s 3 ef s
2 ba 2 ab 2 dc 2 cd
1 dc 1 cd 1 ba 1 ab
0 fe 0 ef 0 98 0 89
( A ) 3. For a given function, which programming language likely takes the most lines of code?
(A) MIPS (B) C
(C) Python (D) JAVA
(Question 4~5) Consider the following performance measurements for a program: (G= giga= Billion= 109)
Measurement Computer A Computer B Computer C
Instruction count 12 billion 12 billion 10 billion
Clock rate 4 GHz 3 GHz 2.8 GHz
CPI 2 1.5 1.4
( D ) 4. Which computer has the highest MIPS rating?
(A) Computer A (B) Computer B
(C) Computer C (D) They have the same MIPS rating
( C ) 5. Which computer is faster (less CPU time)?
(A) Computer A (B) Computer B
(C) Computer C (D) They have the same CPU time
(Question 6~7) A compiler designer is trying to decide between two code sequences for a particular computer.
The hardware designers have supplied the following facts:
Class A Class B Class C Class D
CPI for each instruction class 1 2 3 2
Code sequence X 2 1 1 4
Code sequence Y 3 2 1 2
Code sequence Z 2 3 2 1
( B ) 6. Which code sequence will be faster (fewer clock cycles)?
(A) X (B) Y
(C) Z (D) They take the same number of clock cycles
( C ) 7. Which of following is correct?
(A) CPI for sequence X = 1.75 (B) CPI for sequence Y = 1.85
(C) CPI for sequence Z = 2.00 (D) None of them
Page 1
( B )
8. Which of the following is wrong?
(A) Replacing the processor in a system with a faster version will improve the response time.
(B) Adding additional processors of the same type to a system that uses multiple processors
for separate tasks will improve the response time.
(C) Replacing the processor in a system with a faster version will improve throughput.
(D) Adding additional processors of the same type to a system that uses multiple processors
for separate tasks will improve the throughput.
(Question 9~10) Consider a computer running programs with CPU times shown in the following table.
FP instr. INT instr. L/S instr. Branch instr. Total time
30 s 40 s 20 s 10 s 100 s
( D ) 9. How much do we have to improve the speed of FP instructions if we want this program
to run two times faster?
(A) Making all FP instructions run 13 times faster than before
(B) Making all FP instructions run 21 times faster than before
(C) Making all FP instructions run 33.3 times faster than before
(D) Impossible
( A ) 10. What is the overall speedup gained by making all INT instructions run four times faster than
before?
(A) 1.43 (B) 1.33
(C) 1.25 (D) 1.2
Appendix
◼ CPU (Execution) Time
= CPU Clock Cycles Clock Cycle Time
= CPU Clock Cycles / Clock Rate
= Instruction Count (IC) Cycles per Instruction (CPI) Clock Cycle Time
= Instruction Count (IC) Cycles per Instruction (CPI) / Clock Rate
◼ If different instruction classes take different numbers of cycles
n
◼ Clock Cycles = (CPI i Instruction Count i )
i =1
Clock Cycles n
Instruction Count i
◼ Weighted average CPI = = CPI i
Instruction Count i =1 Instruction Count
◼ MIPS (Millions of Instructions Per Second) ( Million, M = 106 )
Instruction count Instruction count Clock rate
MIPS = = =
Execution time 10 6
Instruction count CPI CPI 106
106
Clock rate
◼ Amdahl’s Law:
Execution time after improvement
Execution time affected by improvement
= + Execution time unaffected
Amount of improvement
Execution time before improvement
Speedup =
Execution time after improvement
Page 2