Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 6 pages
Exam (elaborations)

Computer Architecture: Performance, Pipelining & Memory Exam Q&A

Document preview thumbnail
Preview 2 out of 6 pages

Contains 25 questions with verified step-by-step answers covering all major topics tested in undergraduate CS architecture exams. Topics covered: - Amdahl's Law calculations with full working - CPU Time formula (IC × CPI × Clock Cycle Time) - Pipeline stages and hazard types (structural, data, control) - Forwarding and branch prediction - MIPS assembly language instructions (srl, andi, sub.s) - IEEE 754 floating-point conversion to decimal - Cache memory: EMAT, hit rate, miss rate calculations - Memory hierarchy and locality - Parallel processing: SIMD, MIMD, SMT, Hyper-Threading - Speedup, scalability, and GFLOPS calculations All questions include full step-by-step working. Ideal for last-minute exam revision

Content preview

Computer Architecture
Performance, Pipelining, Assembly & Memory

Computer Organization & Architecture | Undergraduate CS
Questions & Verified Answers

, 25 questions covering Amdahl's Law, CPU time, pipeline hazards, assembly, IEEE 754, cache, and
parallel processing.


Q1. What is Amdahl's Law and what is its formula?
Answer: Speedup = 1 / [(1 - P) + (P / S)], where P is the fraction of the program that can be
parallelized and S is the speedup of that parallelizable portion.
Key insight: the non-parallelizable fraction (1-P) is the bottleneck.
As S approaches infinity, the maximum speedup approaches 1/(1-P).
Example: if 90% of a program is parallelized (P=0.9) and S=10, speedup = 1/(0.1+0.09) ≈ 5.26×
Q2. What is the CPU Time formula?
Answer: CPU Time = Instruction Count × CPI × Clock Cycle Time, or equivalently: CPU Time
= IC × CPI / Clock Frequency.
IC = number of instructions executed
CPI = average clock cycles per instruction
To improve performance: reduce IC, reduce CPI, or increase clock frequency
Q3. What are the three types of pipeline hazards?
Answer: Structural hazards (resource conflict), data hazards (instruction dependency, most
commonly RAW — Read After Write), and control hazards (branch instructions causing
uncertainty about the next fetch).
Structural: solved by stalling or duplicating hardware.
Data (RAW): solved by forwarding/bypassing or inserting NOP stalls.
Control: solved by branch prediction (static/dynamic) or delayed branching.
Q4. Given $t0 = 0xAAAAAAAA, what is $t2 after: srl $t2, $t0, 3 then andi $t2, $t2, 0xFFFF?
Answer: $t2 = 0x00005555
Step 1 — srl $t2, $t0, 3: logical right shift 0xAAAAAAAA by 3 bits.
0xAAAAAAAA binary = 1010 1010 ... (repeating). Shift right 3: 0x15555555
Step 2 — andi $t2, $t2, 0xFFFF: AND with 0x0000FFFF keeps only lower 16 bits.
0x15555555 AND 0x0000FFFF = 0x00005555
Q5. For the C code float f2c(float fahr){ return ((5.0/9.0)*(fahr-32.0)); }, what is the next instruction
compiled by an optimized compiler assuming all constants are already loaded?
A. muls $f0, $f16, $f18
B. sub.s $f18, $f12, $f18
C. lwcl $f18, const32($gp)
D. div.s $f16, $f16, $f18
Answer: B. sub.s $f18, $f12, $f18
The formula requires fahr-32.0 before multiplication.
Since all constants are already loaded, the optimized compiler computes the subtraction first.
sub.s is the MIPS single-precision floating-point subtraction instruction.

Q6. Calculate (8.33×10¹) + (3.87×10⁰) with 3 significant decimal digits. With guard/round digits vs
without — by how many ulp do the answers differ?
Answer: 1
Exact sum: 83.3 + 3.87 = 87.17
With guard and round digits: round to 3 significant digits → 87.2 (digit after 3rd is 7 ≥ 5, round up)

Document information

Uploaded on
May 13, 2026
Number of pages
6
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$8.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
1
Followers
0
Items
38
Last sold
2 months ago


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions