Accumulates or decrements x. This node supports multi-channel operations and feedback scaling.
This node supports only Boolean arrays and scalar values of integer and fixed-point data types.
Data to add to or subtract from the value of sum. If x is a fixed-size Boolean array, the first array element represents the least-significant bit (LSB) and the last element represents the most-significant bit (MSB). In applications with multiple channels, interleave the data and wire one element per clock cycle to x.
A Boolean that specifies whether to start a new accumulation from 0.
TRUE | Ignores any previous value of sum and begins a new accumulation by loading the value of x. |
FALSE | Continues accumulating from previous executions. |
Restarting the Accumulation from a Specific Channel
In multi-channel applications, this input affects the channel whose data arrives at x during the clock cycle when load changes. For example, if you accumulate data from two channels for eight clock cycles, x receives data from channel 1 during the first, third, fifth, and seventh clock cycles. To restart accumulation for channel 1, set load to True during any of those clock cycles. The accumulation from channel 2 continues unchanged.
Default: FALSE
A Boolean that specifies whether to operate on the value of x. Use this input to operate on only valid values of x. For example, you can wire the output valid output of a High Throughput Math node to this input to ensure Accumulator operates only if the upstream node produces a valid result.
TRUE | Accumulates the current value of x. |
FALSE | Ignores x and does not change sum. |
Ignoring Values from a Specific Channel
In multi-channel applications, this input affects the channel whose data arrives at x during the clock cycle when enable changes. For example, if you accumulate data from two channels for eight clock cycles, x receives data from channel 1 during the first, third, fifth, and seventh clock cycles. To ignore only the second value from channel 1, set enable to FALSE during the third clock cycle, and then set it back to TRUE during the fifth clock cycle. The accumulation from channel 2 continues unchanged.
Default: TRUE
A Boolean that specifies whether Accumulator accounts for an extra least-significant bit (LSB) when calculating sum. For example, the LSB could come from the bit pattern of the carry out/inverted borrow out output of an upstream Accumulator node.
TRUE |
If sub? is also TRUE—Calculates sum - x. If sub? is FALSE—Calculates sum + x + 1(LSB). |
FALSE |
If sub? is TRUE—Calculates sum - x - 1(LSB). If sub? is also FALSE—Calculatessum + x. |
Result this node calculates.
This result depends on not only the value of x, but also the values of any Boolean inputs on the node, such as load and enable. In multi-channel applications, sum accumulates separately for each channel.
This function applies the Wrap overflow mode to sum in any of the following situations:
A Boolean that indicates whether the data type of the sum cannot represent the result of an unsigned addition operation or unsigned subtraction operation.
TRUE | The data type of sum cannot represent the result of an unsigned addition operation. |
FALSE | The data type of sum cannot represent the result of an unsigned subtraction operation. In this situation, this node wraps the value of sum. |
To start a new accumulation, set the load input to TRUE. Then, reset load to FALSE for as long as you want sum to accumulate values.
Two factors define how this node operates on data from multiple channels:
Given an interleaved data set from two channels, this behavior means that during a cycle when x is from channel 1, the node returns a sum value for channel 2. For a detailed example of this behavior, refer to the Examples tab for this node.
If you cascade instances of this node, specify whether a downstream node carries or borrows a value. To specify that a downstream node uses the value, wire the carry-out/inverted borrow-out output to the carry-in/inverted borrow-in input of the downstream Accumulator node.
To return the value of carry-out/inverted borrow-out during the same clock cycle as the value of sum, place a checkmark in the Register carry-out/inverted borrow-out checkbox. This feature is useful if you cascade Accumulator nodes and do not want any delay between the carry-out/inverted borrow output output of one node and the carry-in/inverted borrow-in input of the downstream node. By default, this checkbox does not contain a checkmark, which means this node returns the carry-out/inverted borrow-out result one clock cycle before the value of sum.
This node can increase simulation run time significantly when you use it in conjunction with downloading, stopping, or running the FPGA VI.
The following table shows an example of how this node computes sum + x in an application that accumulates interleaved data from two channels.
Clock cycle | x input | Explanation of x | sum output | Explanation of sum |
---|---|---|---|---|
1 | 6 | Channel 1, sample 1 | - | Accumulator does not return a sum during the first clock cycle because it requires one clock cycle to execute. |
2 | 8 | Channel 2, sample 1 | 6 (the accumulation of channel 1) | Although x receives data from channel 2, sum returns the calculation from channel 1 data received during clock cycle 1. During cycle 1, sum was 0 and x was 6, so this node returns 6. |
3 | 44 | Channel 1, sample 2 | 8 (the accumulation of channel 2) | Although x receives data from channel 1, sum returns the calculation from channel 2 data received during clock cycle 2. During cycle 2 sum for channel 2 was 0 and x was 8, so this node returns 8. |
4 | 5 | Channel 2, sample 2 | 50 (the accumulation of channel 1) | 6 (sum from clock cycle 2) + 44 (x from clock cycle 3) |
5 | 2 | Channel 1, sample 3 | 13 (the accumulation of channel 2) | 8 (sum from clock cycle 3 ) + 5 (x from clock cycle 4) |
6 | 3 | Channel 2, sample 3 | 52 (the accumulation of channel 1) | 50 (sum from clock cycle 4) + 2 (x from clock cycle 5) |
7 | - | There is no more data from channel 1. | 16 (the accumulation of channel 2) | 13 (sum from clock cycle 5) + 3 (x from clock cycle 6) |
Where This Node Can Run:
Desktop OS: none
FPGA: All devices
Web Server: Not supported in VIs that run in a web application