A vector processor with 16 lanes can perform an operation on 1024 elements…
2024
A vector processor with 16 lanes can perform an operation on 1024 elements with each operation taking 5 clock cycles. How many cycles are needed to complete the operation?
- A.
320
- B.
80
- C.
100
- D.
128
Attempted by 52 students.
Show answer & explanation
Correct answer: A
Concept: A vector processor applies one instruction across all of its lanes at the same time, so N elements need ceil(N ÷ L) separate vector instructions to complete, where L is the number of lanes. If each such instruction takes C clock cycles to execute, and the instructions run one after another (no overlap), the total time to process all N elements is (ceil(N ÷ L)) × C clock cycles.
Given values: N = 1024 elements, L = 16 lanes, C = 5 clock cycles per vector instruction.
Number of vector instructions required = 1024 ÷ 16 = 64 (1024 divides evenly by 16, so no partial instruction remains).
Total clock cycles = 64 instructions × 5 cycles per instruction = 320 cycles.
Cross-check: Working backward, 320 cycles ÷ 5 cycles per instruction = 64 instructions, and 64 instructions × 16 lanes per instruction = 1024 elements — matching the given element count exactly.
Final answer: 320 clock cycles are required to complete the operation.
A video solution is available for this question — log in and enroll to watch it.