SUM - Summer (Single-Ended IO)
Model Kind
General
Model Sub-Kind
Spice Subcircuit
SPICE Prefix
X
Model Name
SUM
SPICE Netlist Template Format
@DESIGNATOR %1 %2 %3 @MODEL #|PARAMS:| ?X_OFFSET|X_OFFSET=@X_OFFSET| ?Y_OFFSET|Y_OFFSET=@Y_OFFSET| ?X_GAIN|X_GAIN=@X_GAIN| ?Y_GAIN|Y_GAIN=@Y_GAIN| ?OUT_GAIN|OUT_GAIN=@OUT_GAIN| ?OUT_OFFSET|OUT_OFFSET=@OUT_OFFSET|
Parameters (definable at component level)
The following component-level parameters are definable for this model type and are listed on the Parameters tab of the Sim Model dialog. To access this dialog, simply double-click on the entry for the simulation model link in the Models region of the Component Properties dialog.
X_Offset | X input offset (Default = 0). |
Y_Offset | Y input offset (Default = 0). |
X_Gain | X input gain (Default = 1). |
Y_Gain | Y input gain (Default = 1). |
Out_Gain | output gain (Default = 1). |
Out_Offset | output offset (Default = 0). |
Notes
This is a two-input summer with offset and gain adjustment available on both inputs and output. It takes the inputs and processes them to obtain the output result as follows:
- The inputs are offset, in accordance with the values specified for the
X_Offset
andY_Offset
parameters. - The offset signals are then multiplied by the values for gain specified in the respective
X_Gain
andY_Gain
parameters. - The resulting values are summed
- The result is then multiplied by the value specified for the
Out_Gain
parameter. - The output result is then offset in accordance with the value specified for the
Out_Offset
parameter.
The process can be expressed mathematically as follows:
Output =((((X + X_Offset) * X_Gain) + ((Y + Y_Offset) * Y_Gain)) * Out_Gain) + Out_Offset
The input signals can be either single-ended current or single-ended voltage signals.
The built-in XSpice summer function can take two or more inputs, with no upper limit on the number of inputs considered. This particular 2-input version is defined using the hierarchical sub-circuit syntax. Within the sub-circuit definition, the XSpice summer model is called and the parameters of the sub-circuit file parsed to this model.
Entering a value for a parameter on the Parameters tab of the Sim Model dialog will override its specified value in the sub-circuit file.
To check the default values of the supplied 2-input summer, open the appropriate sub-circuit (.ckt
) file. You can view the content of this file for the model specified on the Model Kind tab of the Sim Model dialog, by clicking on the Model File tab at the bottom of the dialog. The default parameter values are listed in the .SUBCKT
line.
Examples
Consider the summer in the above image, with the following characteristics:
Pin1 (in_a) is connected to net In1
Pin2 (in_b) is connected to net In2
Pin3 (out) is connected to net Out
Designator is U1
X_Offset = 2V
(defined on the Parameters tab)
X_Gain = 4
(defined on the Parameters tab)
Y_Offset = 4V
(defined on the Parameters tab)
Y_Gain = 4
(defined on the Parameters tab)
Out_Gain = 0.1
(defined on the Parameters tab)
Out_Offset = -2.4V
(defined on the Parameters tab)
The entries in the SPICE netlist would be:
*Schematic Netlist:
XU1 IN1 IN2 OUT SUM PARAMS: x_offset=2V y_offset=4V x_gain=4 y_gain=4
+ out_gain=0.1 out_offset=-2.4V
.
.
*Models and Subcircuit:
.SUBCKT SUM 1 2 3 PARAMS: x_offset=0.0 y_offset=0.0 x_gain=1.0 y_gain=1.0
+ out_gain=1.0 out_offset=0.0
A1 [1 2] 3 sum1
.model sum1 summer(in_offset=[{x_offset} {y_offset}] in_gain=[{x_gain} {y_gain}]
+ out_gain={out_gain} out_offset={out_offset})
.ENDS SUM
The effect of the function can be seen in the resultant waveforms obtained by running a transient analysis of the circuit.
In this example, the following analysis parameters on the Transient/Fourier Analysis page of the Analyses Setup dialog have been used:
- Transient Start Time - set to
0.000
- Transient Stop Time - set to
50.00m
- Transient Step Time - set to
200.0u
- Transient Max Step Time - set to
200.0u