GATE Computer ScienceVery hardGATE CS (PYQ pattern)
A branch alternates T, N, T, N, … for 20 executions, starting with T. A 2-bit saturating counter (states 0-3, predicts taken in states 2 and 3; taken increments, not-taken decrements) is run twice on this stream: once starting in state 1 and once starting in state 0. How many mispredictions does it make in each run (state-1 run, state-0 run)?
- A. 20 and 20
- B. 10 and 10
- C. 10 and 20
- D. 20 and 10
Correct answer: D. 20 and 10
From state 1 the counter flips 1↔2 and each prediction is the opposite of the outcome (always wrong, 20). From state 0 it flips 0↔1, predicts not-taken always, and so misses only the 10 T outcomes.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A 5-stage pipeline with full forwarding has a measured CPI of 1.40 (ideal 1). 25% of instructions are loads, and 40% of loads are…
- A disk spins at 6000 rpm and each track holds 256 KB. A 1 MB file is stored on 4 consecutive tracks of the same cylinder-group; a head…
- Over 1000 memory references, 40 miss in L1 and 20 of those also miss in L2. L1 hit time is 1 cycle, L2 hit time 10 cycles, and memory adds…
- Radix-2 Booth recoding of an 8-bit multiplier performs one add or subtract at each change between adjacent bits (with an implied 0 to the…
- A pipeline with ideal CPI 1 handles branches (frequency 20%, of which 40% are taken) in one of three ways: (a) stall for 3 cycles on every…
- A three-word memory-to-memory instruction ADD @A, B (opcode word, address word A, address word B) computes M[B] ← M[M[A]] + M[B], where @A…