### Author Topic: Measuring transconductance of any circuit  (Read 996 times)

0 Members and 1 Guest are viewing this topic.

#### promach

• Regular Contributor
• Posts: 99
• Country:
##### Measuring transconductance of any circuit
« on: December 14, 2018, 12:32:44 pm »
May I know if the following transconductance measurement test circuit is correct ?

I suspect that I need to use some derivative function because changing the mosfets width by a large factor does not change the gm result much at all.

However, my test circuit is simulated in AC, not DC, therefore I really confuse if I should use derivative function or not ?

Note: X1 is a CMOS inverter

« Last Edit: December 14, 2018, 12:34:29 pm by promach »

#### Wimberleytech

• Frequent Contributor
• Posts: 498
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #1 on: December 14, 2018, 01:39:58 pm »
What is your end goal here?  Is this a step in solving a larger problem?

In small signal,
Vout = Vin * gm * Rout.

If you have Vin, Vout, and Rout, you calculate gm.  For your inverter, gm depends on the dc bias point.

You can simulate this using .ac but you want the frequency to be low enough so that there are no reactive effects.

#### promach

• Regular Contributor
• Posts: 99
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #2 on: December 14, 2018, 02:30:41 pm »
Quote
What is your end goal here?  Is this a step in solving a larger problem?

See this inductor calculation especially the the small gm values

However, this forum thread is focused on checking whether my transconductance measurement circuit is correct or not.

Quote
For your inverter, gm depends on the dc bias point

OK, I will use this netlist instead for biasing the CMOS inverter in saturation mode for both mosfets.

#### Wimberleytech

• Frequent Contributor
• Posts: 498
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #3 on: December 15, 2018, 01:32:23 am »
Quote
What is your end goal here?  Is this a step in solving a larger problem?

See this inductor calculation especially the the small gm values

However, this forum thread is focused on checking whether my transconductance measurement circuit is correct or not.

Quote
For your inverter, gm depends on the dc bias point

OK, I will use this netlist instead for biasing the CMOS inverter in saturation mode for both mosfets.

This is helpful.  You need to simulate the entire circuit using dc operating point analysis (.op).  This will bias the inverter properly.  Then, simply look at the spice operating point output file.  It will give you the gm of all transistors.  For the inverter, you will sum the gm of each transistor and that is the total gm for the inverter.

#### Wimberleytech

• Frequent Contributor
• Posts: 498
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #4 on: December 15, 2018, 01:42:52 am »
Quote
This is helpful.  You need to simulate the entire circuit using dc operating point analysis (.op).  This will bias the inverter properly.  Then, simply look at the spice operating point output file.  It will give you the gm of all transistors.  For the inverter, you will sum the gm of each transistor and that is the total gm for the inverter.

For example...see attached.

#### promach

• Regular Contributor
• Posts: 99
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #5 on: December 15, 2018, 12:39:49 pm »
Quote
For the inverter, you will sum the gm of each transistor and that is the total gm for the inverter.

This method only works for small circuit (where we have derived the transfer function for overall Gm)

Quote
simply look at the spice operating point output file.  It will give you the gm of all transistors.

I need overall Gm of a black-box circuit block, not the gm of every individual mosfets (this is not really helping since overall Gm is not a function of gm alone).

Furthermore, unlike in LTspice and Cadence. ngspice does not give user the gm value of each mosfets even after .op analysis.
« Last Edit: December 15, 2018, 12:48:38 pm by promach »

#### Wimberleytech

• Frequent Contributor
• Posts: 498
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #6 on: December 15, 2018, 02:09:15 pm »
Quote
For the inverter, you will sum the gm of each transistor and that is the total gm for the inverter.

This method only works for small circuit (where we have derived the transfer function for overall Gm)

Quote
simply look at the spice operating point output file.  It will give you the gm of all transistors.

I need overall Gm of a black-box circuit block, not the gm of every individual mosfets (this is not really helping since overall Gm is not a function of gm alone).

Furthermore, unlike in LTspice and Cadence. ngspice does not give user the gm value of each mosfets even after .op analysis.

Are you solving a small-signal problem or a large-signal problem? (You said, earlier that it was SS...have you changed your mind?) Think about it.

If ngspice will not give you transconductances, then don't use it.  Use LTSpice.  Frankly, my money would be on ngspice giving gm values.  Hell, it has Berkeley Spice lineage!  ---read chapter 13 of ngspice manual---
« Last Edit: December 15, 2018, 02:37:08 pm by Wimberleytech »

#### Wimberleytech

• Frequent Contributor
• Posts: 498
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #7 on: December 15, 2018, 02:24:12 pm »
"I need overall Gm of a black-box circuit block, not the gm of every individual mosfets (this is not really helping since overall Gm is not a function of gm alone)."

Add the gm of the pch and the nch transistors together to get the overall transconductance of the inverter.

#### promach

• Regular Contributor
• Posts: 99
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #8 on: December 15, 2018, 04:00:55 pm »
Quote
it has Berkeley Spice lineage!  ---read chapter 13 of ngspice manual---

Huh ? Chapter 13 is about verilog-A model

Quote
Add the gm of the pch and the nch transistors together to get the overall transconductance of the inverter.

This method only works well for small circuit such as cmos inverter (where we have derived the transfer function for overall Gm)

Note the title of this forum thread again

Quote
Are you solving a small-signal problem or a large-signal problem?

The following is self-biasing for cmos inverter input such that both mosfets are in saturation mode.

« Last Edit: December 15, 2018, 04:32:10 pm by promach »

#### Wimberleytech

• Frequent Contributor
• Posts: 498
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #9 on: December 16, 2018, 12:41:41 am »
Here is the chapter 13 reference: https://www.csd.uoc.gr/~hy121/2013a/datasheets/ngspice-user-manual.pdf

Do this.

Perform an operating point simulation.
Measure the voltage at Node A at full precision.
Break connection at wire B.
Add a voltage source (V1) to drive Node A with the value measured above.
Run another operating point simulation.
Measure the voltage at the output of the inverter to full precision.
Add a voltage source (V2) to drive the output of the inverter with the value just measured.
Convert the first voltage source (V1), above, to a SINE source with dc offset being the same as before. Set amplitude to 1mV.  Set frequency to 100 Hz.
Run a transient simulation.
Measure current in the second voltage source, V2.  This current divided by the input ac voltage is your GM.

I am pretty sure there is a better way to do this, and I will give it some thought, but this is one way.

This can be simplified by just making V2 the same dc value as V1 and skip the second operating-point simulation.  The results will be practically the same.

#### Wimberleytech

• Frequent Contributor
• Posts: 498
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #10 on: December 16, 2018, 03:19:36 am »
Here is another way.

Build the test setup using current source and controlled source as shown.
Run transient analysis.
Measure the voltage at the input of the DUT.
Since I and V are known, calculate GM.

The following users thanked this post: promach

#### promach

• Regular Contributor
• Posts: 99
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #11 on: December 16, 2018, 12:16:32 pm »
Quote
Build the test setup using current source and controlled source as shown

1) Is E1 a transconductance simulation element ? If yes, it seems not really practical to assign value of 100 to E1 ?

2) Any reason for using "sine" current source ?

3) Why transient analysis ? I suppose doing a DC sweep across Vin and doing derivative on Iout and Vin is the definition of Gm ?
« Last Edit: December 16, 2018, 12:29:41 pm by promach »

#### Wimberleytech

• Frequent Contributor
• Posts: 498
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #12 on: December 16, 2018, 12:26:30 pm »
Quote
Build the test setup using current source and controlled source as shown

1) Is E1 a transconductance simulation element ? If yes, it seems not really practical to assign value of 100 to E1 ?
Why (Why not)?
E1 is functioning like an opamp.  Something higher than 100 would be better, but I was concerned about convergence.
Quote
2) Any reason for using "sine" current source ?
It is easy...it works
Quote
3) Why transient analysis ? I suppose doing a DC sweep across Vin and doing derivative on Iout and Vin is the definition of Gm ?
You do not need to do a derivative.  Measure delta voltage...you know the delta current.  Algebra.

The following users thanked this post: promach

#### promach

• Regular Contributor
• Posts: 99
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #13 on: December 16, 2018, 12:30:14 pm »
Did you forget the capacitor which is the important component in a gyrator implementation of inductor ?

#### Wimberleytech

• Frequent Contributor
• Posts: 498
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #14 on: December 16, 2018, 12:33:40 pm »
Did you forget the capacitor which is the important component in a gyrator implementation of inductor ?

No.  I am calculating Gm.  Certainly Gm has some frequency dependence...you can factor that in when you pick the sine frequency.

#### promach

• Regular Contributor
• Posts: 99
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #15 on: December 16, 2018, 12:52:00 pm »
Quote
No.  I am calculating Gm.  Certainly Gm has some frequency dependence...you can factor that in when you pick the sine frequency.

Sorry, I still do not get why the capacitor is not included in the test circuit ?

Ideal Leq using gyrator implementation = CL*s/(Gm1*Gm2)

Are you saying that the sine frequency of the current source I1 helps to emulate a capacitor ?
« Last Edit: December 16, 2018, 12:56:07 pm by promach »

#### Wimberleytech

• Frequent Contributor
• Posts: 498
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #16 on: December 16, 2018, 01:14:57 pm »
Quote
No.  I am calculating Gm.  Certainly Gm has some frequency dependence...you can factor that in when you pick the sine frequency.

Sorry, I still do not get why the capacitor is not included in the test circuit ?

Ideal Leq using gyrator implementation = CL*s/(Gm1*Gm2)

Are you saying that the sine frequency of the current source I1 helps to emulate a capacitor ?

In your equation...is Gm1 a function of the capacitor??

No, the sine is not emulating a capacitor.

#### promach

• Regular Contributor
• Posts: 99
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #17 on: December 16, 2018, 01:31:07 pm »
Quote
In your equation...is Gm1 a function of the capacitor??

The answer is no. Gm1 is the overall transconductance of cmos inverter. Gm1 is independent of capacitor. Same applies to Gm2

#### Wimberleytech

• Frequent Contributor
• Posts: 498
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #18 on: December 16, 2018, 01:33:40 pm »
Quote
In your equation...is Gm1 a function of the capacitor??

The answer is no. Gm1 is the overall transconductance of cmos inverter. Gm1 is independent of capacitor. Same applies to Gm2

Great!  We are making progress.  That is why my method to calculate Gm has no reactive components.
« Last Edit: December 17, 2018, 12:45:58 am by Wimberleytech »

#### promach

• Regular Contributor
• Posts: 99
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #19 on: December 17, 2018, 12:12:17 am »
Quote
That is why my method to calculate Gm has on reactive components.

Investigate the Gm blocks separately as suggested by the forum title itself
This is my personal opinion as of now but please bear in mind that I could be wrong as well

#### Wimberleytech

• Frequent Contributor
• Posts: 498
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #20 on: December 17, 2018, 12:20:38 am »
Quote
That is why my method to calculate Gm has on reactive components.

Investigate the Gm blocks separately as suggested by the forum title itself
This is my personal opinion as of now but please bear in mind that I could be wrong as well

That is perfectly fine to do them separately.  What I have shown you, is a method to simulate and find the Gm of any block.  I have already shown you an example using the inverter.  Here is the diff stage.

The following users thanked this post: promach

#### promach

• Regular Contributor
• Posts: 99
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #21 on: December 17, 2018, 03:55:26 am »
Why use voltage source for E1 (or E2) negative input terminal ?

Why use current source for E1 (or E2) positive input terminal ?

#### Wimberleytech

• Frequent Contributor
• Posts: 498
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #22 on: December 17, 2018, 04:18:35 am »
Why use voltage source for E1 (or E2) negative input terminal ?

Why use current source for E1 (or E2) positive input terminal ?

Does this help?

The following users thanked this post: promach

#### promach

• Regular Contributor
• Posts: 99
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #23 on: December 17, 2018, 12:27:29 pm »
Sorry for my post here, but it "seems" like you are still not measuring the overall transconductance of a circuit block separately (and independently) without using any feedback circuit (which is the opamp or E1/E2 in your previous post).

I understand that you need to set up the DC operating point from the "feedback" test circuit to emulate the actual gyrator, but if that is the case , you "seems" to miss out the capacitor.

Please correct me if I am wrong in any ways.

#### Wimberleytech

• Frequent Contributor
• Posts: 498
• Country:
##### Re: Measuring transconductance of any circuit
« Reply #24 on: December 17, 2018, 01:36:43 pm »
Sorry for my post here, but it "seems" like you are still not measuring the overall transconductance of a circuit block separately (and independently) without using any feedback circuit (which is the opamp or E1/E2 in your previous post).

I understand that you need to set up the DC operating point from the "feedback" test circuit to emulate the actual gyrator, but if that is the case , you "seems" to miss out the capacitor.

Please correct me if I am wrong in any ways.
I set up a Gm analysis test for EACH block (the inverter and the diffamp).  Your gyrator analysis requires these two Gms.  NO CAPACITOR.  The gyrator macro block has the capacitor.  The equations call out Gm1 and Gm2 and a capacitor, CL.

Gm1 does not depend on CL
Gm2 does not depend on CL

The gyrator which includes Gm1 and Gm2 and CL certainly depends on CL.

The feedback circuit I am using is a TEST CIRCUIT.  It is simply measuring the GM of the block (DUT) it is testing.  It has NOTHING to do with the gyrator function itself.  It is exactly the same as you measuring a resistor with a DVM so that you know what its value is to be used in another circuit.  the DVM is not the final circuit...it is the TEST circuit.  The final circuit is where the resistor is placed.

The following users thanked this post: promach

Smf