0

I have this question which asks me to find the dependence types RAW, WAR, WAW, based on these instruction numbers, and I have the answer in the table, but I can't remember how to arrive at this answer. I want to know how to arrive at that table based on that list of 4 instructions I0, I1, I2, I3

List all of the dependence types RAW, WAR, WAW. List the dependencies in the respective table by writing the instruction numbers in the respective table

I0: r1 = r2 + r3
I1: r3 = r1 - r2
I2: r4 = r1 + r3
I3: r1 = r2 * r3

RAW Dependence            WAR Dependence                    WAW Dependence
From Inst    To Inst      From Inst    To Inst              From Inst    To Inst
I0            I1            I0            I1                  I0            I1
I0            I2            I1            I3
I1            I2            I2            I3
I1            I3
Alex
  • 15
  • 6
  • 2
    It's the register numbers that tell you whether there's a hazard. (When other instructions read a register written by one instruction.) The instruction numbers just tell you the relative order so you know if it's an dependency or anti-dependency. Just use the literal meaning of those abbreviations: Read After Write is when an instruction reads a register after an earlier instruction wrote it. https://en.wikipedia.org/wiki/Hazard_(computer_architecture)#Data_hazards The words in these terms have their literal English meanings making them self-explanatory as to which kind is which – Peter Cordes Aug 02 '20 at 22:09
  • @PeterCordes Is the WAW dependence up there incorrect? Should it be I0 I3 – Alex Aug 02 '20 at 23:28
  • 1
    Yes, it should be I0 to I3. Those are the only 2 instructions that write the same register. – Peter Cordes Aug 03 '20 at 04:55

0 Answers0