GATE Computer ScienceModerateGATE CS (PYQ pattern)
A loop body is LW, ADD (uses the loaded value), SW, ADDI, BNE and runs 1000 times on a 5-stage pipeline with forwarding: the ADD right after the LW stalls 1 cycle and each taken BNE costs 2 flush cycles. The loop is unrolled twice (500 iterations of LW, LW, ADD, ADD, SW, SW, ADDI, BNE), with the loads scheduled so that no load-use stall remains; the BNE is still taken in every iteration. Ignoring pipeline fill, what is the speed-up of the unrolled loop?
- A. 1.25
- B. 2.00
- C. 1.60
- D. 1.45
Correct answer: C. 1.60
Original: 5 instructions + 1 stall + 2 flush = 8 cycles × 1000 = 8000. Unrolled: 8 instructions + 0 stalls + 2 flush = 10 cycles × 500 = 5000. Speed-up 8000/5000 = 1.60. Counting instructions only (5000 vs 4000) gives 1.25.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A cache has 64 sets of 4 ways. Exact LRU stores the full recency order of each set using the minimum number of bits; tree pseudo-LRU…
- A fully pipelined floating-point adder has latency 4 cycles and can start one addition every cycle; a dependent addition starts only when…
- Two branches share one 2-bit saturating counter (aliasing in a small predictor table): X is always taken, Y is never taken, and they…
- On a processor with base CPI 1.0, the L1 cache has 40 misses per 1000 instructions. Of these, 10 per 1000 instructions also miss in the L2…
- A physically tagged 64 KB, 4-way cache has 64-byte blocks, 48-bit physical addresses and 4 KB pages. How many tag bits does each line…
- In a custom 8-bit floating-point format there is 1 sign bit, 4 exponent bits (bias 7) and 3 fraction bits, with IEEE-like rules (exponent…