CO-Grand Test 1-Q13

+1 vote

Consider the following instruction sequence for a hypothetical RISC processor.

                                         T. R_1 \leftarrow R_2+R_3

                                         U. R_4 \leftarrow R_5+R_6

                                         V. R_5 \leftarrow R_7+R_8

                                        W. R_9 \leftarrow R_5+R_1

                                        X. R_{10} \leftarrow R_4+R_1

                                        Y.R_{11}\leftarrow R_{10}+R_1

                                        Z. R_{9} \leftarrow R_1+R_4

Which of the following is a possible legal execution order for this instruction on an out-of-order processor without register renaming?

(A) T,U,X,V,W,Z,Y

(B) T,U,X,V,Z,W,Y

(C) T,V,U,X,W,Y,Z

(D) U,T,V,Y,X,W,Z

 

asked Jun 25 in Computer Organization by gbeditor (11,310 points)
edited Jun 26 by gbeditor

2 Answers

0 votes
 
Best answer

(A)

T. R_1 \leftarrow R_2+R_3

U. R_4 \leftarrow R_5+R_6    Here is a dependency between U and X so there must be 2 stall

X. R_{10} \leftarrow R_4+R_1

V. R_5 \leftarrow R_7+R_8    Here is a dependency between V and W so there must be 2 stall

W. R_9 \leftarrow R_5+R_1

Z. R_{9} \leftarrow R_1+R_4

Y.R_{11}\leftarrow R_{10}+R_1

(B)

T. R_1 \leftarrow R_2+R_3

U. R_4 \leftarrow R_5+R_6    Here is a dependency between U and X so there must be 2 stall

X. R_{10} \leftarrow R_4+R_1

V. R_5 \leftarrow R_7+R_8   Dependency between V and W there is one stall

Z. R_{9} \leftarrow R_1+R_4

W. R_9 \leftarrow R_5+R_1

Y.R_{11}\leftarrow R_{10}+R_1

(C)

T. R_1 \leftarrow R_2+R_3

V. R_5 \leftarrow R_7+R_8  Here is a dependency between V and U so 2 stalls

U. R_4 \leftarrow R_5+R_6   Here is a dependency between U and X so 2 stalls 

X. R_{10} \leftarrow R_4+R_1  Here is a dependency between X and Y so 1 stall

W. R_9 \leftarrow R_5+R_1

Y.R_{11}\leftarrow R_{10}+R_1

Z. R_{9} \leftarrow R_1+R_4

(D)

U. R_4 \leftarrow R_5+R_6

T. R_1 \leftarrow R_2+R_3   Dependency between T and Y so 1 stall

V. R_5 \leftarrow R_7+R_8

Y.R_{11}\leftarrow R_{10}+R_1     

X. R_{10} \leftarrow R_4+R_1        

W. R_9 \leftarrow R_5+R_1 

Z. R_{9} \leftarrow R_1+R_4   

So from all of them, answer should be D because of less number of stalls        

answered Jun 27 by 23rishiyadavpro20 (6,590 points)
selected Jul 2 by gbmentor
+2 votes
Y is not there in test time.
answered Jun 26 by tsnikhilsharmagate2018 (18,160 points)
Giving marks for all, for ranking, will put the right choice later
Answer:
...