retagged by
2,640 views
4 votes
4 votes
A certain pipelined RISC machine has 8 general-purpose registers R0, R1, . . . , R7 and supports the following operations.
ADD Rs1, Rs2, Rd /* Add Rs1 to Rs2 and put the sum in Rd */
MUL Rs1, Rs2, Rd /* Multiply Rs1 by Rs2 and put the product in Rd */

An operation normally takes one cycle; however, an operation takes two cycles if it produces a result required by the immediately following operation in an operation sequence. Consider the expression AB + ABC + BC, where variables A, B, C are located in registers R0, R1, R2. If the contents of these three registers must not be modified, what is the minimum number of clock cycles required for an operation sequence that computes the value of AB + ABC + BC ?
(A) 5
(B) 6
(C) 7
(D) 8
retagged by

1 Answer

Best answer
8 votes
8 votes

Given answer is correct. I have used 3 extra registers and arrows will give idea of what previous result has been used. Answer is 6 cycles.

selected by

Related questions

0 votes
0 votes
1 answer
3
0 votes
0 votes
0 answers
4