search
Log In
2 votes
106 views

What effect does Loop Unrolling have on the ans? What is the ans if we don't use it?

in CO and Architecture 106 views
0
I don't think there will be any effect, because these sort of for loops are always unrolled.

1 Answer

0 votes
Loop unrolling is generally done to reduce the number of condition checking and branching. Branching and control instruction create control hazards in the pipelining mechanism. We use several approaches to deal with this control hazard, either we take some branch prediction or we put NOP (stall cycles) in the pipeline. In this particular question, the loop is running two times. If a compiler does not perform any loop unrolling then there will condition check for 3 times, and each of the time either we stall the pipeline or use some branch prediction. Suppose if we are using stall mechanism then 3 times we need to stall the pipeline. But due to unrolling, this condition check, hence the number of control hazard reduces. As the loop is running only two times and unrolling is done we do not need to consider any control hazards and directly can compute the number of cycles required.

Related questions

0 votes
0 answers
1
102 views
we do forwarding from WB stage to EX or from WB to MEM stage??
asked Dec 18, 2018 in CO and Architecture sushmita 102 views
3 votes
2 answers
2
242 views
Suppose the functions F and G can be computed in 8 and 3 nanoseconds by functional units UF and UG, respectively. Given three instances of UF and three instances of UG, it is required to implement the computation F(G(Xi)) for 1 ≤ i ≤ 13. A control Unit selects next task/s and ... complete this computation is ( in nanoseconds): (A) 28 (B) 33 (C) 43 (D) 49 my answer is 43 but gatebook answer is 49.
asked Dec 18, 2018 in CO and Architecture sushmita 242 views
0 votes
0 answers
3
92 views
Design a binary multiply pipeline unit for two 4 bit operands.Use minimum number of CSA's and CPA's.Show all interconnections and bus width in the schematic diagram.Calculate the output of each CSA and CPA for A=11111111 and B=11111111
asked Oct 31, 2018 in CO and Architecture LavTheRawkstar 92 views
...