GATE Computer ScienceModerateGATE CS (PYQ pattern)
A pipeline has a two-slot delayed branch: the two instructions after every branch always execute. The compiler fills the first slot with a useful instruction for 60% of branches and the second slot for 25% of branches; unfilled slots hold NOPs, which waste one cycle each. Branches are 20% of the useful instructions. In addition, 25% of the useful instructions are loads and 30% of those are followed by a dependent instruction that stalls for one cycle. What is the CPI measured per useful instruction (ideal 1)?
- A. 1.305
- B. 1.230
- C. 1.475
- D. 1.415
Correct answer: A. 1.305
Wasted NOP slots per branch = (1 − 0.6) + (1 − 0.25) = 1.15, so branches add 0.2 × 1.15 = 0.23; load-use stalls add 0.25 × 0.3 = 0.075. CPI = 1 + 0.23 + 0.075 = 1.305. Forgetting the loads gives 1.230; ignoring the filled slots (2 cycles per branch) gives 1.475.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A cache miss fetches an 8-word block. Sending the address takes 1 cycle, a memory access takes 15 cycles and putting one word on the…
- A 1 GHz machine has instruction classes A, B, C with CPI 1, 2 and 3. For the same program, compiler X produces 5×10⁹ class-A, 1×10⁹…
- A non-pipelined datapath takes 100 + 120 + 90 + 150 + 110 ps per instruction. It is cut into those 5 stages with a 10 ps latch after each…
- A device streams 2 MB/s (1 MB = 10⁶ B) into memory on a 1.5 GHz CPU. With interrupt-driven I/O every 4-byte word costs 600 CPU cycles…
- A loop reads 128 words at addresses 0, 64, 128, …, 8128 and repeats this whole sweep three times. The cache is 4 KB, 2-way set-associative…
- A 64 MB byte-addressable memory with a 64-bit data bus (8 bytes per bus word) is built from 4M × 4 DRAM chips. How many chips are needed…