Question

Suppose the functions FF and GG can be computed in 5 and 3 nanoseconds by functional units UFU_F and UGU_G, respectively. Given two instances of UFU_F and two instances of UGU_G, it is required to implement the computation F(G(Xi))F(G(X_i)) for 1≤i≤101 \le i \le 10. Ignoring all other delays, the minimum time required to complete this computation is ________ nanoseconds.

Official answer and solution
Official answer
28
From
Official GATE 2016 answer key

Solution

Schedule the pipeline execution of the two functional units to determine the total completion time.

We need to compute F(G(Xi))F(G(X_i)) for 10 inputs (1≤i≤101 \le i \le 10).

  • GG requires 3 ns on a UGU_G unit (2 units available: G1,G2G_1, G_2).
  • FF requires 5 ns on a UFU_F unit (2 units available: F1,F2F_1, F_2).
  • F(G(Xi))F(G(X_i)) can only start after G(Xi)G(X_i) finishes.

Schedule UGU_G instances (2 parallel units, 3 ns each):

  • Inputs X1,X2X_1, X_2: processed from t=0t = 0 to t=3t = 3. (Ready at t=3t = 3)
  • Inputs X3,X4X_3, X_4: processed from t=3t = 3 to t=6t = 6. (Ready at t=6t = 6)
  • Inputs X5,X6X_5, X_6: processed from t=6t = 6 to t=9t = 9. (Ready at t=9t = 9)
  • Inputs X7,X8X_7, X_8: processed from t=9t = 9 to t=12t = 12. (Ready at t=12t = 12)
  • Inputs X9,X10X_9, X_{10}: processed from t=12t = 12 to t=15t = 15. (Ready at t=15t = 15)

Schedule UFU_F instances (2 parallel units, 5 ns each):
Because each FF operation takes 5 ns (which is longer than 3 ns), the UFU_F units are the bottleneck and run continuously without waiting once primed:

  • Batch 1 (X1,X2X_1, X_2): Ready at t=3t = 3. Processed on F1,F2F_1, F_2 from t=3t = 3 to t=8t = 8.
  • Batch 2 (X3,X4X_3, X_4): Ready at t=6≤8t = 6 \le 8. Processed on F1,F2F_1, F_2 from t=8t = 8 to t=13t = 13.
  • Batch 3 (X5,X6X_5, X_6): Ready at t=9≤13t = 9 \le 13. Processed on F1,F2F_1, F_2 from t=13t = 13 to t=18t = 18.
  • Batch 4 (X7,X8X_7, X_8): Ready at t=12≤18t = 12 \le 18. Processed on F1,F2F_1, F_2 from t=18t = 18 to t=23t = 23.
  • Batch 5 (X9,X10X_9, X_{10}): Ready at t=15≤23t = 15 \le 23. Processed on F1,F2F_1, F_2 from t=23t = 23 to t=28t = 28.

The entire computation completes at t=28t = 28 ns.

Therefore, the minimum time required is 28 nanoseconds.

Final answer

28

Common trap

Adding latencies sequentially without pipelining (10×8/2=4010 \times 8 / 2 = 40), or ignoring the initial 3 ns delay of the first GG stage.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2016 Computer Science and Information Technology (CS) Session 2
Question
40 of 65, printed as CS Q.30
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.