GATE Computer ScienceVery hardGATE CS (PYQ pattern)
The back-edge branch of an inner loop executes the outcome pattern T T T N (three taken, one exit), repeated for 6 consecutive outer iterations (24 executions in all). A 2-bit saturating counter (0,1 predict not-taken; 2,3 predict taken; taken increments, not-taken decrements) starts at state 0. How many mispredictions occur?
- A. 8
- B. 7
- C. 6
- D. 12
Correct answer: A. 8
From state 0 it mispredicts the first two T's (0→1→2), then predicts taken; each N costs one misprediction (3→2) and the counter stays in the taken half. That gives 2 + 6 exits = 8 versus a 1-bit predictor which mispredicts twice per iteration.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A memory system has access time 40 ns and cycle time 60 ns per module. If the addresses are low-order interleaved over 4 such modules and…
- 90% of a program parallelises perfectly, but coordinating p processors adds an overhead of 0.005·p of the single-processor run time, so…
- Three caches with 4 one-word lines each see the word-address trace [0, 4, 0, 8, 4, 0, 12, 4, 0, 8]: (i) direct-mapped, (ii) 2-way…
- A 5-stage pipeline has stage delays 200, 150, 300, 250 and 100 ps and a 25 ps latch overhead per stage. The 300 ps stage is split into two…
- Physical memory is 2 GB, virtual address space 2⁴⁸ bytes, pages 16 KB, and each PTE stores the frame number plus 6 control bits, rounded…
- A program of 10⁹ instructions runs on a 2 GHz machine. 30% of instructions take 1 cycle, 50% take 2 cycles and 20% take 5 cycles. The…