+1 vote
186 views | 186 views
0
0
7?
0
No,as given multiply and addition operation are executing using register addressing mode.i m not able to understand meaning of underlined line.
0
+3

https://gateoverflow.in/116940/gatebook-mt2

I was talking about line u underlined

+1
Consider 2 instructions -
1. Add $R_a, \ R_b, \ \color{RED}{R_d}$
2. Mul $R_c, \ \color{RED}{R_d}, \ R_e$

Now, according to underlined line, as the result of instruction 1 is required by instruction 2, so instruction 1 will take 2 clock cycles and instruction 2 will take 1 clock cycle only.
0
Okk thank you so much,,

Expression- $XY + XYZ +YZ$
Initially,
$X$ is in $R_0$,
$Y$ is in $R_1$,
$Z$ is in $R_2$.

$MUL \ \ R_0, \ R_1, \ R_4​​​​$    // 1 clock cycle   (XY)
$MUL \ \ R_1, \ R_2, \ R_5​​​$    // 1 clock cycle   (YZ)
$MUL \ \ R_4, \ R_2, \ R_6​​​$    // 1 clock cycle   (XYZ)
$ADD \ \ R_4, \ R_5, \ \color{Red}{R_7}$    // 2 clock cycle   (XY + YZ)
$ADD \ \ \color{Red}{R_7} \ R_6, \ R_8$     // 1 clock cycle   (XY + XYZ + YZ)

Total 6 clock cycles.

by Boss (16k points)
edited by
0
Got it ,thank you
0
The 3rd instruction (MUL  R4, R2, R6) uses the result R6, which is used in the very next instruction, due to which the 3rd instruction should take 2 clock cycles for completion. So, shouldn't the answer be 7, then ?
+1
@the_bob, Now see the answer. Did some changes.
0
@Soumya29

Yeah, thanks a lot !! :)
0
in the question, They Said the content of Ro R1 R2 not modifyied