the graph I'm getting says that the circuit can ge...
# general
r
the graph I'm getting says that the circuit can get >10dB gain at 1THz which seems very wrong
l
1. Label your nets. 2. Bias your circuit with currents, not voltages. Or, at least, make the input voltages greater than the input. Try 0.5 V at the tail current source transistor instead of 0.8 V. 3. Try AC = 1 at the non-inverting input. From the inverting input to the output, there is no intermediate nodes. 4. Maybe the models aren't calculating the gate-drain capacitances. Are there any values for drain terminal area?
You should not use measure small-signals for an amplifier without some kind of feedback to stabilize it in the high-gain region. See this article for your testbenches: https://www.edn.com/designing-with-a-complete-simulation-test-bench-for-op-amps-part-2-small-signal-bandwidth/
r
seems odd, I get more sane results when I usea current source in place of the tail current source transistor
never mind, I'm still getting positive gain at 1THz
the only params I can see are L and W
with the tail current source transistor replaced wtih a 20uA current source, I get this
swapping the inputs doesn't make much difference
I think It's a problem with the gate capacitance because I can't find that information anywhere
s
@Rita I suggest to use the 4 terminal mos transistor and explicitly set the body terminal to GND (for nfet) and VCC (for pfet). The 3 terminal symbols set the body terminal via attribute (body=VCC or body=GND) and since you didn't put a label on the VCC net i think these are not connected correctly. This will not solve your issue, however is good practice. and as @Luis Henrique Rodovalho said always label your nets , even the ones you think are not interesting, problems always happen on non interesting nets by murphy rule.
r
even with 4 terminal devices it still gives me the same result
image.png
image.png
s
Yes i said that, the problem is not due to the body connections. Please note: M1 and M5 body terminals must be connected to GND not to the current source, unless you draw these 2 transistors into an insulated p-well, which is very unlikely. I also tried this ac simulation and i got the strange positive gain at THz frequencies, I believe the simulation result is not valid at these frequencies and i am investigating.
I verified also with transient analysis, applying a 1THz sinusoid of 1mV amplitude (small signal) the output is amplified, even with 1fF loading cap on the output. However note transfer function is no more inverting. Input MINUS signal at 1THz is feed-forwarded to the output, this makes sense at these frequencies, what i can't understand (@Luis Henrique Rodovalho) is that there is a 1.64x (4.3dB) amplitude gain
If you look at the phase plot, strange things happen. I suspect at these high frequencies simulation is not valid, but RF gurus will have more authoritative explanations. I have also verified Xyce gives the same results as ngspice , so this is not a simulator issue.
a
I've seen the same behavior in my own design FWIW. Have you tried laying out the circuit, extracting, and simulating on the extracted circuit?
l
I'm getting similar results also... I need to put a capacitive load, otherwise there will be voltage gain at the higher frequencies
image.png
s
Usually I include in open loop simulations the loading of the feedback path. without this loading effect there is >1 gain at unrealistically high frequencies.
l
Hi Rita, check to see if your hand analysis generally agrees with the spice simulation. Since you are measuring the AC response of transistor M1 to the output node you have a 1 pole system that roles off at -20db/decade. The pole frequency is 1/ (2pi*RC) where the R is the output impedance of NCH input transistor ( labeled M1 on your schematic ) in parallel with the output impedance of the PCH transistor (labeled M3 on your schematic ). The output impedance of a transistor is 1/gds where gds is the small-signal drain-to-source conductance. So the output impedance is: (1/gds_m1) // (1/gds_m3). The output capacitance is [Cds of M1] plus [Cdb of M1] plus plus [Cdg of M1] plus [Cds of M3] plus [Cdb of M3] plus [Cdg of M3]. I am not yet familiar with ngspice so I don't know what small signal parameters ngspice reports. For HSPICE, which I am very familiar with, it will report the small signal parameters of all transistors when you do a dc operating point analysis. (.op analysis)
r
so I have a working op amp now, but I'm still getting issues with simulation
image.png
here's the gain phase plot of the op amp configured in voltage follower mode
I've verified the gain phase plot using various sinusoidal inputs
When I try to buffer a signal, this happens though
image.png
It looks like I'm getting at least 30-40dB of gain on all the noise on the input signal, even though the gain phase plot never goes above 10dB
schematic and open loop bode plot (with 1pF load capacitance) if interested
I've tried recreating the same behavior with square waves superimposed on sine waves - no luck there
l
1. Use multipliers. Forget about using wider transistors. Transistors with different lengths and widths have slightly different characteristics, like threshold voltage. For example, M53,58 should be 1x5/0.5. M56,59 should be 2x5/0.5. M62,63 = 10x5/0.5. M57=10x5/0.5. 2. Use 4 terminal devices. 3 terminal devices have a hidden terminal connected to a hierarchical node. In this case, I think that the PMOS bulk terminals are connected to vdd!. Is there a vdd! connected voltage source? NMOS bulk terminals must be connected to GND and you placed it there, so it must be ok. 3. You are using PMOS cascode devices. For 1.8 V VCC, I'm pretty sure you won't have input or output voltage excursion. Stay away from cascode devices for a while. It doesn't even matter, if the NMOS side of the output stage isn't also in cascode configuration.
Also, as we can see in your transient simulation, your amp must be unstable. Very unstable. Try to make a sinusoidal input with 10 mV amplitude and a DC level at 200 mV and see what happens. I don't believe that an input level at 0.9 V is within your amp input voltage excursion.
r
it turned out that I just had to change VCC -> VDD
my body was floating and it was messing up the simulation
the bode plot was right, I'm getting expected results after making that change
here's my new results