ID 683337
Date 3/23/2022
Public

## 14.4.2. Accumulator (Acc)

The Acc block implements an application-specific floating-point accumulator.

r= acc(x, n)

The acc block allows accumulating data sets of variable lengths. The block indicates a new data set by setting n high with the first element of the accumulation.

Figure 98. New Data Set

This example accumulates x0 + x1 + x2 and y0 + y1 + y2.

The acc block has single and double-precision floating-point data inputs and outputs.

.

Table 146.  Parameters for the Add Block
Parameter Description
LSBA This parameter defines the weight of the accumulator’s LSB, and therefore the accuracy of the accumulation. This value and the maximum number of terms to be accumulated sets the accuracy of the accumulator. The maximum number of terms the design can accumulate can invalidate the log_2(N) lower bits of the accumulator. For instance, if an accuracy of 2^(-30) is enough, and you add 1k of numbers, LSBA = –30 – log2(1k) , which is approximately –40.
MSBA The weight of the MSB of the accumulation result. Adding a few guard bits to the value has little impact on the implementation size. You can set this parameter in one of the following ways:
• For a stock simulation, to limit the value of any stock to \$100k before the simulation is invalid, use a value of ceil(log_2(100K))~ceil(16.6)=17
• For a simulation where the implemented circuit adds numbers <=1, for one year, at 400MHz, use ceil(log_2(365*86400*400*10^6))~54
maxMSBX The maximum weight of the inputs. When adding probabilities <=1 set this weight to 0. When adding data from sensors, set bounds on the input ranges. Alternatively, set MaxMSBX = MSBA. However, the size of the architecture may increase.
Table 147.  Port Interface for the Acc Block
Signal Direction Type Description Vector Data Support Complex Data Support
x Input Single or double Operand Yes No
n Input Boolean Control Yes No
r Output Single or double Output Yes No
xO Output Boolean This flag goes high when the input value has a weight larger than selected value for MaxMSBX. The result of the accumulation is then invalid. Yes No
xU Output Boolean If this flag goes high, an input value is completely shifted out of the accumulator. This flag warns that the value of LSBA is possibly too large. Yes No
aO Output Boolean This flag goes high when the accumulated value has a weight larger than MSBA. The result of the accumulation is then invalid. Yes No