GATE Computer ScienceHardGATE CS
Six instructions execute in program order: I1: LW R1, 0(R2) I2: ADD R3, R1, R4 I3: SUB R4, R3, R2 I4: SW R3, 4(R1) I5: AND R1, R4, R3 I6: OR R2, R1, R3 (The first register of LW, ADD, SUB, AND and OR is the destination; SW writes memory only.) Count every ordered pair of instructions i < j (adjacent or not, and regardless of any write in between) that has a RAW, WAR or WAW register dependence. What is the triple (RAW, WAR, WAW)?
- A. (9, 4, 1)
- B. (8, 5, 1)
- C. (9, 5, 1)
- D. (9, 5, 2)
Correct answer: C. (9, 5, 1)
RAW: R1 written by I1 is read by I2, I4, I6 (3); R3 by I2 is read by I3, I4, I5, I6 (4); R4 by I3 is read by I5 (1); R1 by I5 is read by I6 (1): total 9. WAR: I3 overwrites R4 read by I2 (1); I5 overwrites R1 read by I2 and I4 (2); I6 overwrites R2 read by I1 and I3 (2): total 5. WAW: only R1 (I1 and I5): 1.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A cache has 4 lines of one word each. The word-address trace 0, 4, 0, 4, 1, 5, 1, 5, 2, 6, 3, 7, 0, 4, 1, 5, 8, 0, 8, 4, 2, 6 is applied…
- A 4-bit non-restoring divider divides the unsigned dividend Q = 1101 (13) by the divisor M = 0011 (3). The accumulator A is 5 bits wide…
- In IEEE 754 single precision (round-to-nearest-even), let a = 2²⁴ = 16777216, b = 1 and c = 1. The two sums S₁ = (a + b) + c and S₂ = a +…
- Three processors P0, P1, P2 use a snooping MESI write-invalidate protocol on one block that is initially invalid everywhere. A read miss…
- A program has a serial fraction of 5% when run on 1 processor. Under Amdahl's law (fixed problem size) the speedup on 64 processors is SA…
- A process of size s = 4 MB runs under paging with a one-level page table in which each page-table entry occupies e = 8 bytes. The wasted…