GATE Computer ScienceModerateGATE CS (PYQ pattern)
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⁹ class-B and 1×10⁹ class-C instructions; compiler Y produces 10×10⁹ class-A, 1×10⁹ class-B and 1×10⁹ class-C instructions. Which code runs faster, and which has the higher MIPS rating?
- A. Y runs faster; Y has the higher MIPS
- B. X runs faster; X has the higher MIPS
- C. X runs faster; Y has the higher MIPS
- D. Y runs faster; X has the higher MIPS
Correct answer: C. X runs faster; Y has the higher MIPS
Cycles: X = 5 + 2 + 3 = 10×10⁹ → 10 s; Y = 10 + 2 + 3 = 15×10⁹ → 15 s, so X is faster. MIPS = instructions / time: X = 7×10⁹/10 s = 700, Y = 12×10⁹/15 s = 800. The slower code has the higher MIPS, because it is padded with cheap instructions.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- 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…
- Every memory reference first looks up a TLB (2 ns, hit ratio 96%). On a TLB miss the hardware walks a 3-level page table, each level…
- An x86-like addressing mode computes EA = base + index × scale + displacement, where the displacement is an 8-bit field that is…