reSIDfp::OpAmp Class Reference

`#include <OpAmp.h>`

## Public Member Functions

| OpAmp (const Spline::Point opamp[], int opamplength, double Vddt)
void | reset () const
double | solve (double n, double vi) const

## Detailed Description

Find output voltage in inverting gain and inverting summer SID op-amp circuits, using a combination of Newton-Raphson and bisection.

              +---R2--+
              |       |
    vi ---R1--o--[A>--o-- vo
              vx

From Kirchoff's current law it follows that

    IR1f + IR2r = 0

Substituting the triode mode transistor model K*W/L*(Vgst^2 - Vgdt^2) for the currents, we get:

    n*((Vddt - vx)^2 - (Vddt - vi)^2) + (Vddt - vx)^2 - (Vddt - vo)^2 = 0

Our root function f can thus be written as:

    f = (n + 1)*(Vddt - vx)^2 - n*(Vddt - vi)^2 - (Vddt - vo)^2 = 0

Using substitution constants

    a = n + 1
    b = Vddt
    c = n*(Vddt - vi)^2

the equations for the root function and its derivative can be written as:

    f = a*(b - vx)^2 - c - (b - vo)^2
    df = 2*((b - vo)*dvo - a*(b - vx))

## Constructor & Destructor Documentation

## OpAmp()

reSIDfp::OpAmp::OpAmp | ( | const Spline::Point | opamp[],
|  | int | opamplength,
|  | double | Vddt
| ) |  |

inline

Opamp input -> output voltage conversion

Parameters

  opamp | opamp mapping table as pairs of points (in -> out)
  opamplength | length of the opamp array
  kVddt | transistor dt parameter (in volts)

## Member Function Documentation

## solve()

double reSIDfp::OpAmp::solve | ( | double | n,
|  | double | vi
| ) |  | const

Solve the opamp equation for input vi in loading context n

Parameters

  n | the ratio of input/output loading
  vi | input

Returns
  vo

The documentation for this class was generated from the following files:

- OpAmp.h
- OpAmp.cpp