GATE | GATE-CS-2016 (Set 2) | Question 40

Suppose the functions F and G can be computed in 5 and 3 nanoseconds by functional units UF and UG, respectively. Given two instances of UF and two instances of UG, it is required to implement the computation F(G(Xi)) for 1 <= i <= 10. ignoring all other delays, the minimum time required to complete this computation is ________________ nanoseconds [Note that this is originally a Fill-in-the-Blanks Question] (A) 28
(B) 20
(C) 18
(D) 30


Answer: (A)

Explanation:
Background:Explanation:
Pipelining is an implementation technique where multiple instructions are overlapped in execution.
The stages are connected one to the next to form a pipe – instructions enter at one end, progress
through the stages, and exit at the other end.
Pipelining does not decrease the time for individual instruction execution. Instead, it increases
instruction throughput. The throughput of the instruction pipeline is determined by how often an instruction exits the pipeline.

The same concept is used in pipelining. Bottleneck here is UF as it takes 5 ns while UG takes 3ns
only. We have to do 10 such calculations and we have 2 instances of UF and UG respectively.
Since there are two functional units, each unit get 5 numbers of units to compute on. Suppose
computation starts at time 0. which means G starts at 0 and F starts at 3rd second since G finishes computing first element at third second.
So, UF can be done in 5*10/2=25 nano seconds. For the start UF needs to wait for UG output for 3 ns and rest all are pipelined and hence no more wait. So, answer is 3+25=28

This solution is contributed by Nitika Bansal

Another solution :
Since there are two functional units each unit get 5 numbers of units to compute on. Suppose computation starts at time 0.
which means G starts at 0 and F starts at 3rd second since G finishes computing first element at third second.
Time at which F ends computing = 3 + 5*5 = 28


Quiz of this Question

My Personal Notes arrow_drop_up