APPLICATION NOTE
1
Introduction
Behavioral Modeling is the process of developing a model for a device or a system component representing the
behavior rather than from a microscopic description. You can use Behavioral Modeling in the domain of analog
simulation to model new device types and for black-box modeling of complex systems.
In this document, examples are used to show how the Analog Behavioral Modeling feature of PSpice can be used
to:
Calculate square roots
Use ideal non-linearity from look-up tables
Design small systems
Pass parameters to sub-circuits
Calculating Square Roots
Assume that you need to create a signal whose voltage is the square root of another signal's voltage. A simple
solution is to use a feedback circuit to calculate square roots. But this technique fails if the reference signal goes
negative. The solution then is to use the functional form of Analog Behavioral Modeling:
Esqrt out_hi out_lo value={sqrt(abs(v(input)))}
Figure 1: Square Roots Sub-circuit
This model takes the absolute value of the ground-referenced signal input before evaluating the square-root
function. The absolute-value function is a nonlinear function.
Note: You can also use a floating signal-pair in the model; for example, replace v(input) with v(in_hi)-
v(in_lo) or v(in_hi,in_lo).
Using Ideal Non-Linearity from Look-up Tables
You can introduce ideal non-linearity using the table look-up form of Analog Behavioral Modeling. For example,
the following one-line, ideal OpAmp model has high gain, but its output is clamped between ±15 volts.:
Eamp out 0 table {200K*(v(in_hi)-v(in_lo))}=
+ (-15,-15) (15,15)