I am confused in finding RAW dependencies whether we have to find only in adjacent instructions or non-adjacent also.

consider the following assembly code

I1: ADD R1 , R2, R2;

I3: SUB R4, R1 , R5;

FIND THE NUMBER OF READ AFTER WRITE(RAW) DEPENDENCIES IN THE Above Code.

I am getting 2 dependency I2-I1 and I4-I3.

• I'd say it includes non-adjacent instructions. For example, in a 5-levels pipeline (F-D-E-M-W), there is 2 cycles between exectution and registers updates. – TEMLIB Sep 27 '15 at 22:12

Adjacency is not relevant for determining Read-After-Write dependences. You simply list all the instructions where one of the source registers reads the value produced by some previous instruction.

So (assuming that your assembly language is OPERATOR DEST SRC1 SRC2) you are missing, for example, that the first source operand of I3 dependends on the value written by I1. (You are missing several others as well.)