Accumulator
This block implements an accumulator with the option to reset the state.
Library
Activate/Dynamical
Description
This block implements an accumulator with the option to reset the state. The block can be configured with or without direct feedthrough. If direct feedthrough is selected, the current value of the accumulator is copied on the output synchronously when the block is activated. Otherwise, the previous value is copied. When the clk port is activated, dX is added to the internal state. When the reset port is activated, the internal state is set to X0. If both the reset and the clock are activated, priority can be given to one or the other through the last parameter.
Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
x0 | Initial value | Initial value of the accumulator. | Matrix | |
feed | Feedthrough | If direct feedthrough is selected, the current value of the accumulator is copied on the output synchronously when the block is activated. Otherwise, the previous value is copied. | Number | 0 |
reset_priority | Reset has priority over clock. | If the block is activated through both ports synchronously, choose reset over clock. | Number | 0 |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
dX | explicit | input | 1 | |
X0 | explicit | input | 2 | |
Port 3 | explicit | output | 1 | |
clk | activation | input | 1 | |
reset | activation | input | 2 |