# Urgent Help Needed Please! calculate the effective capacitance

#### bobpease4ever

Joined Jul 28, 2019
23

Imagine a relatively large circuit made out of mosfets.

I need to calculate the effective capacitance that the entire circuit switches during each transition. This includes all the gate capacitances and short circuit currents, glitches etc.
My book tells me the formula is this:
C = I_average/ (f * Vdd)

But from my understanding the correct formula should be I_Average / (2pi * f * Vdd), because the impedance of a cap is 1/2pifVdd instead of 1/fVdd.

Please what is the correct formula? Is there a reason why they are removing the 2pi factor from it ?

THank you!!

#### MisterBill2

Joined Jan 23, 2018
10,481
The "2pif" term is part of how reactance is calculated. Xc=1/2pixfx C .
But that is not going to help very much in the problem you have because you would need to know the instant value of current at moment, and that varies with the voltage at that instant.
So you can consult the data sheets for the gate capacitance of each device and arrive at a more useful number.

#### bobpease4ever

Joined Jul 28, 2019
23
The "2pif" term is part of how reactance is calculated. Xc=1/2pixfx C .
But that is not going to help very much in the problem you have because you would need to know the instant value of current at moment, and that varies with the voltage at that instant.
So you can consult the data sheets for the gate capacitance of each device and arrive at a more useful number.
But there is one tricky point here..... This capacitance is not only made out of the gate capacitances. It also includes the short circuit currents flowing through the mosfets as they switch. So this accounts for those as well. So it's a larger capacitance than simply the sum of all gate capacitances.

So the books tells me to take the average current through a large chunk of time, and perform that calculation. The average current would be the average amplitude (akin to instant amplitude).

But the book leaves out the 2pi. So I am wondering if there's a reason for that.

#### crutschow

Joined Mar 14, 2008
28,486
This capacitance is not only made out of the gate capacitances. It also includes the short circuit currents flowing through the mosfets as they switch.
What "short circuit currents" and where do you think they occur?
A MOSFET is just acting as a switch , on or off.
But the book leaves out the 2pi. So I am wondering if there's a reason for that.
Because you use the 2pi formula when the signal is a single-frequency sinusoid.
Here it is a switching (square-wave) frequency so you use the formula without the 2pi.
It's the current required to charge and discharge the gate capacitance charge.

#### bobpease4ever

Joined Jul 28, 2019
23
What "short circuit currents" and where do you think they occur?
A MOSFET is just acting as a switch , on or off.
Hello Cruts,

When the mosfet switches on or off, part of the current coming from the supply goes to charging the load capacitance, and part of it is simply wasted through the NMOS to ground. This occurs both when it switches on, and off. This is called the short circuit current (even different than leakage which id idle current in the pico amps).

Because you use the 2pi formula when the signal is a single-frequency sinusoid.
Here it is a switching (square-wave) frequency so you use the formula without the 2pi.
It's the current required to charge and discharge the gate capacitance charge.
But a square wave is composed out of sine waves. Fourier... What is the reason you think the 2Pi is removed just because it's a square wave? What if it were a triangle wave instead?

Anyhow. I have been thinking about this, and I have reached the following conclusion:

Power = CfVdd^2
IV = CfVdd^2
So I = CfV

Hence C = I/Vf

And I think this is why they are doing this.

Before that I was thinking that if Vdd = IZ = I/2pi*fC, then C = I/2pi*CVdd

#### crutschow

Joined Mar 14, 2008
28,486
But a square wave is composed out of sine waves. Fourier... What is the reason you think the 2Pi is removed just because it's a square wave? What if it were a triangle wave instead?
Then you would need to use the particular waveshape Fourier amplitude value at all the Fourier frequencies and use them in the 2 PI formula then sum all the frequency values together.
Obviously it's simpler to use the other formula.

#### MisterBill2

Joined Jan 23, 2018
10,481
The remarks so far have presumed that you are driving the gates with a square wave, which may or not be the case.
If you are determining the drive requirements for some device to be mass produced then you need to consider the spread of a number of properties and characteristics of the devices, and be sure to provide enough drive to cover them all, if you want to avoid a less than good production yield. Providing an adequate margin is far cheaper than a lot of rework would be.

#### bobpease4ever

Joined Jul 28, 2019
23
Then you would need to use the particular waveshape Fourier amplitude value at all the Fourier frequencies and use them in the 2 PI formula then sum all the frequency values together.
Obviously it's simpler to use the other formula.
The same would apply for the square wave.... but you said nope..........

But the supply potential is not a square wave. It's wiggly and disordered. Please read my formula derivation and tell is you agree with it. I derived it from the power formula and it makes sense to me. One could also calculate C from power directly.

#### crutschow

Joined Mar 14, 2008
28,486
The same would apply for the square wave.... but you said nope..........
Nope.
Wasn't me that said nope.
You would need to use the Fourier coefficients for whatever waveshape you were using including a square-wave.
Please read my formula derivation and tell is you agree with it.
Looks okay to me.

#### bobpease4ever

Joined Jul 28, 2019
23
Nope.
Wasn't me that said nope.
You would need to use the Fourier coefficients for whatever waveshape you were using including a square-wave.
Looks okay to me.
Nope Cubed.

You said this:
Here it is a switching (square-wave) frequency so you use the formula without the 2pi.

But anyhow even though the inputs to the gates are a square wave indeed, what I am dealing with is the supply current.

Moral of the story is that probably the 2pi is not there not for any reason other than the fact that the formula is derived from the power relationship for the capacitor which does not have the 2pi in it. I was thinking it came from AC ohm's law instead which does have the 2pi.

Yope?

#### MisterBill2

Joined Jan 23, 2018
10,481
Once again I offer a word of caution about designing way to close to the anticipated requirements. Unless having the absolute minimum power consumption is the primary design target, allowing a bit of margin is a very well advised approach. A bit of excess capability is far cheaper, and much better, than being just a bit short of the needed capability.

#### bobpease4ever

Joined Jul 28, 2019
23
Once again I offer a word of caution about designing way to close to the anticipated requirements. Unless having the absolute minimum power consumption is the primary design target, allowing a bit of margin is a very well advised approach. A bit of excess capability is far cheaper, and much better, than being just a bit short of the needed capability.
Hi there.

I am not doing what you are thinking, I think. I have built a circuit to work at sub-threshold levels as part of my master's thesis.

What this entails is finding the total effective capacitance that the power supply switches. For this one has to calculate the average current through the supply, and use the formula I gave above to obtain the capacitance.

This capacitance means the total gate capacitances, plus the capacitance emulated by the parasitic short circuit currents through the MOSes. So if you imagine the total charge supplied by the supply, that charge goes partly into the gates, and partly to ground. The effective capacitance accounts for these elements. It is as if replacing the entire circuit by a single transistor-capacitor.

#### MisterBill2

Joined Jan 23, 2018
10,481
Hi there.

I am not doing what you are thinking, I think. I have built a circuit to work at sub-threshold levels as part of my master's thesis.

What this entails is finding the total effective capacitance that the power supply switches. For this one has to calculate the average current through the supply, and use the formula I gave above to obtain the capacitance.

This capacitance means the total gate capacitances, plus the capacitance emulated by the parasitic short circuit currents through the MOSes. So if you imagine the total charge supplied by the supply, that charge goes partly into the gates, and partly to ground. The effective capacitance accounts for these elements. It is as if replacing the entire circuit by a single transistor-capacitor.
OK, that is a different situation completely. To gain actual data, which is useful for evaluating the correctness of the formulas and theories, a high speed current probe and an oscilloscope able to capture single sweeps will be useful. Quoting Bob Pease, "Real measurements are useful." And it may also be useful to go back to a more fundamental formula of I=C(dv/dt), leading to C=I/(dv/dt) .
Hopefully that will be helpful.

#### bobpease4ever

Joined Jul 28, 2019
23
OK, that is a different situation completely. To gain actual data, which is useful for evaluating the correctness of the formulas and theories, a high speed current probe and an oscilloscope able to capture single sweeps will be useful. Quoting Bob Pease, "Real measurements are useful." And it may also be useful to go back to a more fundamental formula of I=C(dv/dt), leading to C=I/(dv/dt) .
Hopefully that will be helpful.
Hi Bill. Thanks for your time friend.

I am working only with simulations. No physical devices here Only LTSpice.

I am basically doing research on operating cmos circuits at sub-threshold and I gotta tell you......It's fun!

Finding the minimum energy consumption per cycle point. This means finding the value of Vdd for this minimum energy consumption. If the circuit is large enough so that leakage energy is considerable, then it's possibl to find an absolute minimum.

The formula is: Vdd = 2mVth (2 - LambertW(Omega)), where Omega = -2e^2 * Ceff / (W * K * Cg * L),

where LambertW is the inverse function of y = x*exp(x), and W is the total leakage current divided by an inverter's leakage current, K = fitting parameter for inverter delay in the formula t = KCg * Vdd / (I_0 * exp((Vgs-Vt)/mVth)), which is an approx to the prop. delay at sub-threshold, Cg = inverter gate capacitance, and L = number of cascaded mosfets.

Finally, Ceff = effective switched capacitance of entire circuit, meaning total gate cap + short circuit emulated capacitance.

If abs(Omega) < 1/e, then there exists a minimum indeed.

So all this required the Ceff, and Ceff is found by C = I_Average / (f * Vdd),

which brought me here because I thought the formula might be missing a factor of 2pi below, since Xc = 1/i2piWC.

But then I remembered that the formula for the power consumed by the inverter is P = C*Vdd^2*f,

but P = I*V, so IV = C*V^2*f
meaning I = CVf
so C = I/Vf

so apparently this is where the formula comes from,.......................

PHEW

#### MisterBill2

Joined Jan 23, 2018
10,481
OK, and that is a whole lot different from calculating power requirements for mass produced devices.
For knowing the instant capacitance of a device you may have to go to the manufacturer since I don't think that is a published bit of information. And to get an explanation of the mechanism of that so that you could develop a formula will take a good understanding of the physics of the device. THAT is far out of my realm, unfortunately.

#### OBW0549

Joined Mar 2, 2015
3,566
For knowing the instant capacitance of a device you may have to go to the manufacturer since I don't think that is a published bit of information. And to get an explanation of the mechanism of that so that you could develop a formula will take a good understanding of the physics of the device.
Actually, for CMOS logic devices that information is often included right in the data sheet, as the "power dissipation capacitance" Cpd, as in the 74HC00 data sheet excerpted below. See note 3 for how to compute power dissipation using Cpd.: