Description

Parallel Prefix Sum

Design a hardware module that computes all prefix sums of an input array. For each position i, output the sum of all elements from index 0 to i inclusive.

Example: For input array [1, 2, 3, 4], the output should be [1, 3, 6, 10].

Input

array

Stream of 16-bit Unsigned Integer
Input array.

Output

Stream of 20-bit Unsigned Integer
Prefix sums.