Chapter1 Introduction
Chapter1 Introduction
Jerry Sam
March 2026
1 Theory
*. Performance Formulas
• Performance
1
P erf ormance =
ExecutionT ime
Explanation:
Performance measures how fast a computer executes a program. It is
defined as the inverse of execution time. Therefore:
• Relative Performance
Explanation:
Relative performance compares two machines.
If machine X runs a program faster than machine Y :
Example:
TX = 8s, TY = 20s
1
PX 20
= = 2.5
PY 8
• CPU Time
Since
1
CycleT ime =
ClockRate
InstructionCount × CP I
CP U T ime =
ClockRate
Explanation:
CPU execution time depends on three factors:
Explanation:
Programs usually contain multiple instruction types.
2
Average CPI is the weighted average of all instruction types.
1
ClockRate =
CycleT ime
or
1
CycleT ime =
ClockRate
Multiple-Choice Questions
Question 1. If the processor clock rate increases, which of the fol-
lowing statements is correct?
a) The CPI increases
b) The CPI decreases
c) Power consumption may decrease
d) Execution time decreases if CPI remains unchanged
Answer: D
Answer: C
3
a) Maintaining a high level of abstraction
b) Reducing the level of abstraction from high-level language to low-
level language
c) Increasing abstraction for better readability
d) Unrelated to abstraction
Answer: B
a) P1 is faster
b) P2 is faster
c) Both are equal
d) Cannot be determined
Answer: B
a) 6 s
b) 7.2 s
c) 8 s
d) 9 s
Answer: B
4
a) P1
b) P2
c) Both are equal
d) Cannot be determined
Answer: B
Answer: D
Question 8. The performance of a computer system is typically measured
by:
a) Instructions executed per second
b) Program execution time
c) Average CPI
d) All of the above
Answer: B
Data for the next three questions: A program consists of four in-
struction types with the following proportions and CPI values:
• Floating Point (FP): 35%, CPI = 3
• Integer: 30%, CPI = 1
• Data transfer: 20%, CPI = 5
• Branch: 15%, CPI = 2
5
Question 10. Compute the average CPI of the program.
a) 2.65
b) 2.85
c) 2.50
d) 2.14
Answer: A
Question 11. To make the program run 1.4 times faster, by how many
times must the number of FP instructions be reduced?
a) 0.72 times
b) 0.7 times
c) 0.3 times
d) 0.9 times
Answer: A
6
a) 1.36 times
b) 1.4 times
c) 2.2 times
d) 2.0 times
Answer: A (Amdahl’s Law)
Question 15. Consider two processors:
• P1: 2 GHz, CPI = 1.4
• P2: 3 GHz, CPI = 2
Which processor executes the program faster?
a) P1
b) P2
c) Both are equal
d) Cannot be determined
Answer: A
Question 17. Which of the following factors affect the energy consump-
tion of a computer system (assuming energy consumption = power ×
execution time)?
a) Only processor architecture
b) Only cache size
c) Only clock frequency
d) Processor architecture, cache size, and clock frequency
Answer: D
Data for the next three questions: A program consists of 200 × 106
floating-point instructions, 100 × 106 integer instructions, 80 × 106 data-
transfer instructions, and 40 × 106 branch instructions. The CPI values
for these instruction types are 2, 1, 4, and 2, respectively.
7
Question 18. What is the average CPI of the above program?
a) 2.0
b) 2.14
c) 2.5
d) 3.0
Answer: B
Question 19. For the program to run 1.5 times faster, to what value
must the CPI of floating-point instructions be reduced?
a) 1.0
b) 0.5
c) 0.8
d) 0.2
Answer: B
8
b) A part of the operating system that stores program information to
be executed
c) A part of the processor that performs a task
d) A type of main memory
Answer: A
Data for the next four questions: A processor with a clock frequency
of 2.3 GHz executes program P with the following parameters:
a) 4713 ns
b) 4517 ns
c) 3069 ns
d) 3148 ns
9
Answer: A
Data for the next four questions: A processor with a clock frequency
of 2.5 GHz executes program P with the following parameters:
10
c) 6217 ns
d) 6024 ns
Answer: D
Question 31. The processor is improved so that the CPI of the Load/Store
instruction group is reduced to 3, while executing the above program at
the same clock frequency. What is the speedup of this improvement?
a) 1.46
b) 1.33
c) 1.06
d) 1.04
Answer: C
11
b) One of the main reasons for the development trend toward multicores
is the “Power Wall” problem.
c) Application software cannot be written in assembly language.
d) All of A, B, and C are correct.
Answer: B
12
d) 8.40 µsec
Answer: C
Question 38. Determine the CPI of instruction type C (by changing the
CPI of instruction type C) so that the speedup reaches 1.25:
a) ≈ 1.00
b) ≈ 1.02
c) ≈ 1.25
d) ≈ 2.36
Answer: B
Question 39. Suppose only two instruction types can be improved. De-
termine the limit of such an improvement:
a) ≈ 1.58
b) ≈ 2.03
c) ≈ 2.46
d) ≈ 2.95
Answer: D
13
c) It is impossible to translate from MIPS assembly back to a high-level
language.
d) It is impossible to translate machine code back to a high-level lan-
guage.
Answer: B
Question 41. Choose the correct statement:
a) The instruction sets on different computers from the same manufac-
turer are identical.
b) Different computers may have different instruction sets, although
they can share many similarities.
c) An instruction set is developed arbitrarily by an individual or an or-
ganization without regard to the hardware structure of the computer
architecture.
d) All of A, B, and C are correct.
Answer: B
Answer: C
Answer: B
14
The average CPI is calculated using the formula
P
(instructioncounti × CPIi )
CPI = .
totalinstructioncount
Answer: B
Question 45. The instruction set architecture of a processor consists
of three instruction types A, B, and C with CPI values 1, 2, and 3, re-
spectively. Two compilers translate the same program and generate the
following numbers of instructions:
Compiler A B C
X 300 200 200
Y 400 100 200
Which compiler is better when running the program on the same com-
puter?
a) Compiler X
b) Not enough data to determine
c) Compiler Y
d) Both compilers are the same
Answer: C
Detailed solution:
For the same processor, the better compiler is the one that produces fewer
total clock cycles.
X
T otalcycles = (instructioncount × CP I)
15
For compiler X:
For compiler Y:
Since
1200 < 1300
compiler Y requires fewer cycles, so it executes faster.
CompilerY isbetter
16
• They are often designed to be low-cost, not high-cost.
So:
4 × 106 x + 3 × 106 + 4 × 106 + 1 × 106 = 16 × 106
4 × 106 x + 8 × 106 = 16 × 106
4 × 106 x = 8 × 106
x=2
Therefore, the CPI of floating-point instructions must be improved to:
2
17
a) 12.0 msec
b) 10.0 msec
c) 6.0 msec
d) 24.0 msec
Answer: D
Detailed solution:
The original CPI of floating-point instructions is 4.
If it is reduced to 25%, then the new floating-point CPI is:
4 × 0.25 = 1
Clock frequency:
Execution time:
T otalcycles 12 × 106
T = =
Clockf requency 5 × 109
= 2.4 × 10−3 s
Convert to milliseconds:
2.4ms
Note: The marked answer in the image is D (24.0 msec), but based on
the calculation, the correct result should be:
2.4ms
Question 49. Design computer B with what clock rate, knowing that for
the same program X: computer A has a clock rate of 2 GHz and CPU
time = 5 s; computer B executes with CPU time = 6 s, but the clock
cycles of B are 1.2× the clock cycles of A.
18
a) 6 GHz
b) 2 GHz
c) 3 GHz
d) 5 GHz
Answer: B
Detailed solution:
CPU time formula:
Clockcycles
CP U time =
Clockrate
Clock cycles of A:
Clock cycles of B:
CyclesB = 1.2 × 1010
Clock rate of B:
1.2 × 1010
ClockRateB =
6
= 2 × 109 Hz = 2 GHz
2 GHz
Answer: D
Detailed solution:
In the Post-PC era:
• Devices such as smartphones, tablets, and IoT devices are connected
to the Internet.
• Many computing tasks are handled by cloud servers rather than lo-
cally.
19
Therefore:
(a)and(c)arecorrect
Answer: C
Detailed solution:
Performance ratio:
tB
k=
tA
tA = 8 s, tB = 20 s
20
k= = 2.5
8
So:
Ais2.5timesf asterthanB
20
Answer: C
Detailed solution:
The program execution time depends on the clock period.
If the memory latency decreases but the clock cycle time remains un-
changed, then the CPU clock frequency does not change.
Therefore:
Question 54. Why did the clock frequency of Intel processors begin to
stop increasing around 2004?
a) Because the demand for computation decreased
b) Because of the “power wall”
c) Because of the shift to multiprocessor systems
21
d) To reduce manufacturing cost during the economic crisis
Answer: B
Detailed solution:
Around 2004, processor manufacturers encountered the power wall: in-
creasing clock frequency further caused excessive power consumption and
heat dissipation problems.
As a result:
• Clock rates stopped scaling as before.
• Industry focus shifted toward multicore design rather than only in-
creasing frequency.
Thus, the direct reason is:
thepowerwall
Data for the next four questions: A code segment contains 1000
instructions, in which load/store instructions account for 40%, jump in-
structions account for 20%, branch instructions account for 10%, and the
remaining are arithmetic instructions. The CPI values are: load/store
= 3.5, jump = 1, branch = 2.5, arithmetic = 3. The computer operates
at a clock frequency of 2 GHz.
Question 55. Compute the execution time of the above code segment.
a) 1375 ns
b) 2750 ns
c) 1735 ns
d) 1953 ns
Answer: A
Detailed solution:
First compute the number of instructions of each type:
22
Total clock cycles:
Clock frequency:
f = 2 × 109 Hz
Execution time:
2750
T = s
2 × 109
= 1.375 × 10−6 s = 1375ns
1375ns
Question 56. To make the program run 2.5 times faster, to what value
must the CPI of the load/store instructions be improved?
a) 2.5
b) 2.0
c) 1.5
d) All are incorrect
Answer: D
Detailed solution:
Original total cycles:
2750
So:
400x + 1350 = 1100
23
400x = −250
x = −0.625
Question 57. Compute the average CPI of the above code segment.
a) 1.75
b) 1.35
c) 2.75
d) 2.35
Answer: C
Detailed solution:
Average CPI is:
T otalcycles
AverageCP I =
T otalinstructions
Thus:
2750
AverageCP I = = 2.75
1000
2.75
Question 58. The load/store instructions are improved so that their CPI
is reduced by half. What is the speedup of the whole system (speedup is
defined as the ratio of the old execution time to the new execution time)?
a) ≈ 0.75
b) ≈ 1.34
c) ≈ 1.75
d) ≈ 1.00
24
Answer: B
Detailed solution:
Original load/store CPI:
3.5
Speedup:
Oldtime Oldcycles
Speedup = =
N ewtime N ewcycles
2750
= ≈ 1.34
2050
1.34
25
Total number of instructions:
Average CPI:
900 × 106
CP I avg = ≈ 2.14
420 × 106
CP I avg ≈ 2.14
Question 60. To make the program run 1.5 times faster, to what value
must the CPI of FP instructions be reduced?
a) 0.8
b) 1.0
c) 0.5
d) 0.2
Answer: C
Detailed solution:
Original total cycles:
900 × 106
To run 1.5 times faster, the new total cycles must be:
900 × 106
= 600 × 106
1.5
So:
200 × 106 x + 500 × 106 = 600 × 106
26
200 × 106 x = 100 × 106
x = 0.5
0.5
Question 61. What is the execution time of the program if the CPI of
integer and floating-point instructions decreases by 40%, while the CPI
of data-transfer and branch instructions decreases by 30%? Assume the
processor operates at 2 GHz.
a) ≈ 0.45 s
b) ≈ 0.29 s
c) ≈ 0.35 s
d) ≈ 0.5 s
Answer: B
Detailed solution:
New CPI values:
F P : 2 × 0.6 = 1.2
Integer : 1 × 0.6 = 0.6
Datatransf er : 4 × 0.7 = 2.8
Branch : 2 × 0.7 = 1.4
200 × 106 × 1.2 + 100 × 106 × 0.6 + 80 × 106 × 2.8 + 40 × 106 × 1.4
Clock frequency:
f = 2 × 109 Hz
Execution time:
580 × 106
T = = 0.29 s
2 × 109
0.29 s
27
a) Integrated as a component in systems, with strict constraints on
power/performance/cost
b) Large volume, high performance
c) General-purpose, supporting a wide variety of software
d) Used in network environments
Answer: A
Detailed solution:
Embedded computers are typically:
• built into a larger system,
• designed for dedicated tasks,
• constrained by power, performance, physical size, and cost.
Therefore, the best description is:
V olatilememory
28
d) Reduced clock frequency
Answer: B
Detailed solution:
A multicore processor contains multiple processing cores on one chip. This
design allows multiple tasks or threads to execute in parallel, but software
often needs parallel programming techniques to fully benefit.
Therefore:
M ultipleprocessorsonthesamechip, requiringparallelprogramming
Algorithm
29
Answer: A
Detailed solution:
Throughput measures how much work a system completes in a given
amount of time.
Therefore, throughput is:
thenumberof taskscompletedperunittime
P erf ormanceof A 15
= = 1.5
P erf ormanceof B 10
So machine A is:
1.5timesf asterthanmachineB
30