Implements an adder-subtractor that operates on bit patterns. AddSub nodes may be cascaded and pipelined to achieve higher throughput rates. This node supports scalar Boolean values, arrays of Boolean values, and scalar values of integer and fixed-point data types.
carry in/inverted borrow in
A Boolean that determines whether this node accounts for an additional LSB. For example, the LSB could come from the bit pattern of the carry out/inverted borrow out output of an upstream AddSub node. If sub? is FALSE and carry in/inverted borrow in is TRUE, this node adds one extra LSB to x + y. If sub? is TRUE and carry in/inverted borrow in is FALSE, this function subtracts one extra LSB from x – y.
A Boolean that determines whether this node ignores the value you wire to x. Use this Boolean to remove x from the expression this node calculates. For example, use this Boolean to return –y instead of x – y.
A Boolean that determines whether this node performs subtraction or addition. Use this Boolean to change the operation of this node programmatically.
||The node calculates x - y.
||The node calculates x + y.
An input to this node. 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).
An input to this node. If y is a fixed-size Boolean array, the first array element represents the LSB and the last element represents the MSB.
carry out/inverted borrow out
A Boolean that returns TRUE if the data type of sum cannot represent the result of an unsigned addition operation. This Boolean returns FALSE if the data type of sum cannot represent the result of an unsigned subtraction operation. In this situation, this node wraps the value of sum. If you cascade this node, you can use this output to specify whether a downstream node carries or borrows a value. To specify that a downstream node uses this value, wire carry-out/inverted borrow-out to the carry-in/inverted borrow-in input of the downstream node.
The result this node computes. The result depends on not only the values of x and y, but also the values of any Boolean inputs. This node applies the Wrap overflow mode to sum in the following situations: sub? is TRUE and carry out/inverted borrow out returns FALSE, sub? is FALSE and carry out/inverted borrow out returns TRUE.