optional · CSS study notes
Performance Metrics
CSS Optional — Paper-II, Section-A · Chapter 7 · 🔥 Guaranteed numerical topic
Every quantitative claim about a processor reduces to one equation. If you memorise nothing else from this chapter, memorise the CPU performance equation — most performance numericals in the paper are a rearrangement of it.
🗺️ Architecture Diagram — What Determines Performance
graph LR
IC["Instruction Count
Program / Compiler / ISA"] --> T["Execution Time
T = IC x CPI x Cycle Time"]
CPI["CPI
Organization / ISA"] --> T
CT["Clock Cycle Time
Hardware Technology"] --> T
T --> MIPS["MIPS = Clock Rate / CPI"]
P["Parallel Fraction P"] --> AM["Amdahl's Law
Speedup = 1 / (1-P + P/S)"]
S["Speedup Factor S"] --> AM
1. The Fundamental Confusion: Response Time vs Throughput
- Response time (execution time) — how long one task takes from start to finish. What a user cares about.
- Throughput — how many tasks complete per unit time. What a server operator cares about.
These are not the same and can move in opposite directions. Adding a second processor roughly doubles throughput but does not halve the response time of a single-threaded task. Examiners like this distinction because it exposes shallow preparation.
2. The CPU Performance Equation
or
The three factors are influenced by different things — a point worth stating in any performance answer:
| Factor | Primarily determined by |
|---|---|
| Instruction Count | Program, compiler, and ISA |
| CPI | CPU organization and ISA |
| Clock Cycle Time | Hardware technology and circuit design |
This is why optimising one factor can worsen another: RISC lowers CPI but raises instruction count (see CISC vs RISC).
2A. CPI — All Formulas ⭐
CPI (Cycles Per Instruction) is the average number of clock cycles each instruction takes. Nearly every performance numerical in the paper uses one of the forms below.
Basic definitions
Weighted / Average CPI (mixed instruction set)
When different instruction types take different numbers of cycles:
where = fraction of instructions of type , and
Use ⑤ when the question gives counts, ⑥ when it gives percentages. They are the same equation.
IPC — the inverse
Superscalar processors quote IPC because their CPI falls below 1 (more than one instruction completes per cycle). CPI = 0.5 means IPC = 2.
Effective CPI with stalls (memory, branches, hazards)
CPI and MIPS
CPI-based speedup
(valid when instruction count is unchanged)
Quick reference — what a CPI value tells you
| CPI value | Meaning |
|---|---|
| < 1 | Superscalar — multiple instructions complete per cycle |
| = 1 | Ideal single-issue pipelined processor |
| 1–2 | Typical modern processor with cache misses and branch penalties |
| > 4 | Non-pipelined, or heavily stalled by memory |
Remember: lower CPI is better. More cycles per instruction means slower execution.
3. Clock Rate and Cycle Time
- 1 GHz → cycle time = 1 ns
- 2 GHz → cycle time = 0.5 ns
- 4 GHz → cycle time = 0.25 ns
4. MIPS and Its Limitations
or
MIPS is an unreliable metric and examiners reward candidates who say so. It cannot be used to compare machines with different instruction sets, because one machine's instructions may do far more work than another's. A CISC machine at 100 MIPS may outperform a RISC machine at 200 MIPS. MIPS has been sardonically called "Meaningless Indicator of Processor Speed."
MFLOPS (millions of floating-point operations per second) is similarly limited for general workloads but meaningful for scientific computing.
5. Amdahl's Law (high-yield)
Amdahl's Law quantifies the limit on speedup when only part of a program can be improved.
where = fraction of execution time that is improvable/parallelizable, and = speedup factor applied to that fraction
Maximum theoretical speedup (as S → ∞):
The insight worth writing in an answer: the serial fraction is the hard ceiling. If 10% of a program cannot be parallelised, then no matter how many thousands of processors you add, the speedup can never exceed 10×. This is the fundamental argument against assuming that more cores always solve performance problems.
6. Speedup and Efficiency in Parallel Systems
Efficiency of 1.0 (100%) means perfect linear scaling — rarely achieved because of communication overhead and the serial fraction.
🧮 Solved Numerical 1 — Basic Execution Time
Q: A program has 10,000 instructions with an average CPI of 2, running on a 1 GHz processor. Find the execution time.
Given: , , clock = 1 GHz
Solution:
Answer: 20 μs.
🧮 Solved Numerical 2 — Mixed Instruction CPI (very common exam form)
Q: A program has the following instruction mix on a 2 GHz processor. Find the average CPI and total execution time.
| Instruction type | Count | CPI |
|---|---|---|
| ALU | 50,000 | 1 |
| Load | 30,000 | 4 |
| Store | 10,000 | 3 |
| Branch | 10,000 | 2 |
Step 1 — Total cycles for each type:
Step 2 — Average CPI:
Step 3 — Execution time (cycle time = 1/2 GHz = 0.5 ns):
Answer: Average CPI = 2.2, Execution time = 110 μs.
Insight for the examiner: Load instructions are only 30% of the count but consume 120,000/220,000 ≈ 55% of all cycles. This is why memory optimisation matters more than ALU optimisation — and it links directly to Cache Memory.
🧮 Solved Numerical 3 — Amdahl's Law (standard form)
Q: A program is 80% parallelizable and is run on 4 processors. Find the speedup and efficiency.
Given: ,
Speedup:
Efficiency:
Answer: Speedup = 2.5×, Efficiency = 62.5%.
Note we used 4 processors but gained only 2.5× — the serial 20% is already dragging efficiency down to 62.5%.
🧮 Solved Numerical 4 — Amdahl's Ceiling
Q: For the same program (80% parallelizable), what is the maximum possible speedup with unlimited processors?
Answer: 5×, no matter how many processors are added. Adding a million processors to an 80%-parallel program still yields under 5× — the definitive argument that parallel hardware alone cannot rescue a serial algorithm.
🧮 Solved Numerical 5 — Amdahl's Law Applied to a Component
Q: Floating-point operations account for 40% of a program's execution time. A new FPU makes them 5× faster. What is the overall speedup?
Given: ,
Solution:
Answer: 1.47× overall. A 5× improvement to one component yields under 1.5× overall — the classic lesson: optimise the common case, not the fast case.
🧮 Solved Numerical 6 — Comparing Two Machines
Q: Machine A: 2 GHz, CPI = 1.5. Machine B: 3 GHz, CPI = 3. Both execute the same program with the same instruction count. Which is faster and by how much?
Answer: Machine A is 1.33× faster, despite its lower clock speed. This is the "megahertz myth" — a classic exam trap testing whether you know clock rate alone determines nothing.
🧮 Solved Numerical 6A — CPI from Percentages (form ⑥)
Q: A program has the following instruction mix given as percentages. Find the average CPI.
| Type | Frequency | CPI |
|---|---|---|
| ALU | 45% | 1 |
| Load | 25% | 3 |
| Store | 15% | 2 |
| Branch | 15% | 4 |
Step 1 — Verify fractions sum to 1:
Step 2 — Apply the weighted formula:
Answer: Average CPI = 2.10.
Always verify the percentages total 100% before calculating — if they do not, you have misread the table.
🧮 Solved Numerical 6B — Effective CPI with Memory and Branch Stalls (forms ⑨–⑪)
Q: A processor has a base CPI of 1.0. 35% of instructions access memory. The cache miss rate is 4% with a 60-cycle miss penalty. 20% of instructions are branches, with a 10% misprediction rate and a 5-cycle penalty. Find the effective CPI.
Step 1 — Memory accesses per instruction (every instruction is fetched, plus 35% data accesses):
Step 2 — Memory stall cycles per instruction:
Step 3 — Branch stall cycles per instruction:
Step 4 — Effective CPI:
Answer: Effective CPI = 4.34.
Interpretation: the ideal CPI of 1.0 becomes 4.34 in practice — the processor runs 4.34× slower than its theoretical peak, and memory stalls account for 3.24 of the 3.34 added cycles (97%). Naming memory as the dominant bottleneck is the analytical point examiners reward.
🧮 Solved Numerical 6C — CPI and IPC Conversion (form ⑦)
Q: A superscalar processor completes 3.2 billion instructions per second at a clock rate of 1.6 GHz. Find its IPC and CPI.
Answer: IPC = 2.0, CPI = 0.5.
A CPI below 1 is possible only on a superscalar processor issuing multiple instructions per cycle — a single-issue pipelined machine can at best reach CPI = 1.
🧮 Solved Numerical 6D — Finding CPI from Execution Time (form ③)
Q: A program of 800,000 instructions executes in 0.6 ms on a 2 GHz processor. Find the CPI.
Answer: CPI = 1.5.
Cross-check with the forward equation:
🧮 Solved Numerical 7 — MIPS Calculation
Q: A 2 GHz processor has an average CPI of 2.5. Calculate its MIPS rating.
Answer: 800 MIPS — while noting in the exam that this figure is meaningless for cross-architecture comparison.
🎯 CSS Exam Angle
Performance numericals appear in nearly every attempt, most often as Amdahl's Law or a mixed-instruction-mix CPI problem. A full-marks answer:
- Writes the formula first, before substituting — partial marks are awarded for this alone.
- Shows working line by line with units.
- Boxes or bolds the final answer with its unit.
- Adds a one-line interpretation ("adding processors cannot exceed 5× because 20% is serial"). This interpretive sentence is what separates a pass from a strong score.
🔁 Repeated CSS Questions
- State Amdahl's Law and apply it to a numerical problem. (Very frequently repeated)
- Given an instruction mix with per-type CPI values, calculate average CPI and execution time. (Numerical — frequently repeated)
- Why is MIPS considered an unreliable measure of processor performance?
- Differentiate between response time and throughput.
- Compare two processors with different clock rates and CPI values. Which is faster? (Numerical)
- Explain the three factors of the CPU performance equation and what determines each.
- Define CPI and IPC. How are they related? (Frequently repeated)
- Calculate the effective CPI of a processor accounting for cache misses and branch mispredictions. (Numerical)
- Derive CPI given execution time, clock rate, and instruction count. (Numerical)
⚠️ MCQ Traps
- Higher CPI means a slower processor — more cycles are needed per instruction. Candidates often assume "higher = better."
- A higher clock rate does not guarantee better performance. Clock rate is only one of three factors (see Numerical 6).
- Amdahl's Law is limited by the serial fraction, not the parallel one. With P = 0.9, the ceiling is 10×, not 90×.
- MIPS cannot compare different instruction set architectures. Only meaningful within the same ISA family.
- In Amdahl's formula, S is the speedup applied to the improved fraction, which is usually — but not always — the number of processors. Read the question carefully.
- Efficiency falls as processors are added, even in a well-parallelised program.
- CPI below 1 requires a superscalar processor. A single-issue pipelined machine bottoms out at CPI = 1.
- CPI and IPC are reciprocals — CPI = 1/IPC. Lower CPI and higher IPC both mean better performance.
- Instruction fetch counts as a memory access. In effective-CPI problems use
1 + data-access fraction, not just the data fraction — omitting the fetch is the most common error here. - Base CPI is the ideal, stall-free value. Effective CPI is always ≥ base CPI.
📜 Past-Paper Questions & MCQs (CSS 2016–2026)
2017 · Paper-II · Q2(b) · 6 marks
Q. If clock speed reaches its maximum, what are the two methods to increase the performance of a computer? Briefly explain.
Ans.
- 1. More parallelism: use multiple cores and multiprocessors, and deeper pipelines and superscalar execution, so more work is done per clock cycle.
- 2. Better architecture and memory: reduce CPI and memory delay by using larger and multi-level caches, faster memory, branch prediction, specialised hardware (GPU, accelerators) and a better instruction set.
- Why clock speed is limited: dynamic power is approximately P = αCV²f (activity factor α, switched capacitance C, voltage V, frequency f). Higher frequencies can require greater voltage and cooling, so frequency alone is not a sustainable performance strategy.
- Example: Four independent tasks on four cores can execute concurrently; alternatively, improved cache locality lowers memory-stall cycles even when clock frequency remains unchanged. More parallelism is limited by the serial fraction (Amdahl's law), and a larger cache does not always produce better performance.
- Six-mark conclusion: Improve work completed per cycle through parallel execution and reduce cycles lost per instruction through more efficient memory and processor organization.
2018 · Paper-I · Q2(e) · 2 marks
Q. Why do modern processors use more power when their clock frequency is increased?
Ans.
- Dynamic power is P = C·V²·f. Each clock tick charges and discharges the transistors, so more ticks per second mean more switching energy per second.
- A higher frequency usually also needs a higher supply voltage, and power grows with V², so in practice power rises roughly with the cube of frequency, producing heat.
Numerical example: the clock is raised from 2 GHz to 4 GHz and the supply voltage from 1.0 V to 1.2 V (same capacitance C):
Doubling the clock raises the power by about 2.9 times.
2024 · Paper-II · Q2(b) · 7 marks
Q. How does the choice of architectural level impact the performance of a computer system? Give a numerical comparison between two architectural levels, highlighting strengths and weaknesses.
Ans.
- Architectural level is where a function is implemented: directly in hardware (digital logic), in microcode, or in software on top of the instruction set.
Numerical comparison 1 — a 32-bit multiply done at two levels (clock 1 GHz, software instructions take 1 cycle each):
Given: the hardware multiplier takes 3 cycles. The software shift-and-add routine loops 32 times, with 3 instructions per loop (test bit, add, shift).
The hardware level is about 32 times faster. Summary of strengths and weaknesses:
| Level | Cycles for one multiply | Time at 1 GHz | Strength | Weakness |
|---|---|---|---|---|
| Hardware multiplier | 3 | 3 ns | Very fast | Costs chip area, fixed |
| Software (repeated add and shift) | About 100 | 100 ns | No extra hardware, flexible | About 30 times slower |
Numerical comparison 2 — pipelined and non-pipelined execution ( instructions, stages, stage time ):
The speed-up approaches the number of stages as grows.
- Conclusion: lower levels (hardware) give speed, while higher levels (software) give flexibility and low cost.
2024 · Paper-II · Q2(c) · 6 marks
Q. A processor executes 1 billion instructions per second and has an instruction execution cycle of 4 cycles per instruction. Calculate the overall execution time for a program of 1 million instructions. Discuss how reducing the cycles per instruction affects performance.
Ans.
Given: instructions, , rating per second.
Assumption A — the 10⁹ is the clock rate (1 GHz). This is the reading that fits the second part of the question, because CPI then matters:
Assumption B — literal reading: 10⁹ instructions per second (the CPI is already inside this rate):
Here the clock would be . State your assumption in the answer, because the working is what earns the marks.
Effect of reducing CPI (Assumption A, and ):
| CPI | Execution time | MIPS | Speed-up over CPI = 4 |
|---|---|---|---|
| 4 | 4 ms | 250 | 1.0 |
| 3 | 3 ms | 333 | 1.33 |
| 2 | 2 ms | 500 | 2.0 |
| 1 | 1 ms | 1,000 | 4.0 |
- With instruction count and clock fixed, execution time is directly proportional to CPI, so halving the CPI halves the time.
- CPI is reduced by pipelining, caches, branch prediction, superscalar issue and simpler instructions.
- The catch: simplifying instructions can raise the instruction count (as in RISC), so always judge by the full equation .
2025 · Paper-II · Q4(a) · 10 marks
Q. A 40 MHz processor runs a program of 100,000 instructions: integer arithmetic 45,000 (1 cycle), data transfer 32,000 (2 cycles), floating point 15,000 (2 cycles), control transfer 8,000 (2 cycles). Determine the effective CPI, MIPS rate and execution time.
Ans.
Given: , . Mix: integer arithmetic 45,000 (1 cycle), data transfer 32,000 (2 cycles), floating point 15,000 (2 cycles), control transfer 8,000 (2 cycles).
Required: effective CPI, MIPS rate and execution time.
Step 1 — Check the instruction total:
Step 2 — Cycles used by each type ():
Step 3 — Effective CPI:
Cross-check with the fractions ():
Step 4 — Cycle time:
Step 5 — Execution time:
Step 6 — MIPS rate:
Cross-check with the time:
Answer: Effective CPI = 1.55, MIPS rate ≈ 25.8, Execution time = 3.875 ms.
MCQs
2025 P-II · Q3. If computer A executes a program in 10 seconds and computer B runs the same program in 15 seconds, how much faster is computer A than B?
- (A) 5.1 times
- (B) 1.4 times
- (C) 1 time
- (D) 1.5 times ✅
- Answer: (D) 1.5 times.
- Working:
- Why: performance is the reciprocal of execution time. The faster machine takes less time, so we divide the longer time by the shorter one. The wrong options come from dividing the other way round or from subtracting the times.
2025 P-II · Q4. A processor having a clock cycle of 0.25 ns will have a clock rate of:
- (A) 2 GHz
- (B) 3 GHz
- (C) 4 GHz ✅
- (D) 8 GHz
- Answer: (C) 4 GHz.
- Working:
- Why: frequency is the reciprocal of the period. Check with the table above: 0.25 ns is one quarter of 1 ns, so the rate is 4 times 1 GHz.