The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+1 vote
176 views

asked in CO and Architecture by Boss (10.1k points) | 176 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
Answer is given 6.
+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,,

1 Answer

+3 votes
Best answer

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.

answered by Boss (15.5k 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

Related questions

+4 votes
0 answers
7
asked Jan 11, 2018 in CO and Architecture by thepeeyoosh Active (1.9k points) | 590 views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,811 questions
54,540 answers
188,429 comments
75,595 users