Login Join Maker Pro

# BJT vs MOSFET for logic gates help

#### Tristan369

Oct 29, 2020
32
For 10pf it looks like it takes about 20ms per mV, it seemed instant on my breadboard, charged right up to 5V. I tried putting one on each side and this happened

The capacitor instantly charges to 2.5 volts. It doesn't seem like there is any way to get these two things to mix haha

#### ratstar

Aug 20, 2018
485
hmm must be true then. did u read my idea? (put a loop around the capacitor with a high value resistor, to discharge the leak charge.)

#### Tristan369

Oct 29, 2020
32
I did but I didn't get it. Wouldn't that just drain the capacitor? It also needs to keep its charge while the device is powered off.

#### ratstar

Aug 20, 2018
485
Yeh its being charged by a low amperage, so you make a low amperage constantly come out of the capacitor and it should emptyize it away.

 oh... yeh it would slowly leak away. if u need it to stay charged it wont work.

yes it only stays on temporarily, I thought thats all you needed.
If you keep polling it, you can keep refreshing it like DRAM.

#### Nanren888

Nov 8, 2015
623
I'm not sure that we are all on the same page. I, at least, am having some trouble working out what's intended.
.
Certainly didn't follow ratstar's explanation, sorry.
.
On your diagram when the switch is open there is no bias on the gate. So, the gate capacitance is charged when the switch is connected, then floats. There is discharge path for the gate charge on the gate capacitance. If the simulator model FET is reasonable, and the switch ideal, this will cause the gate to float at the previous gate voltage, 5volts, for a long time.
I'm no expert at mosfets, but maybe look up biasing them to see how its normally done.
.
The 2n7000 data lists a leakage current (gate voltage zero) of 1 microAmp, going up with temperature. It will be higher for the power devices you were using. Don't know what sort of capacitor values you are wanting to use, and not sure how long you want the charge on the capacitor to stay stable, before refresh, but 1uA is quite small.
.
Regarding numbers of transistors in circuits, I don't know what you were looking at, but it's not common to build these things form discretes. Equivalent circuits are often of chips, where it can be cheaper to put in another mosfet or four than to put in a resistor. So not always easy to interpret.

#### Tristan369

Oct 29, 2020
32
Ah I see ya I just didn't know MOSFET's basically had capacitors in them. I brought up capacitors solely for non-volatile memory, that is memory that lasts beyond powering down the circuit (and potentially last for years). So any amount of discharge is undesired. The capacitor need to be completely separated from the rest of the circuit or else it will slowly discharge. If I used MOSFET's around the capacitor, they would basically combine into one capacitor (if I understand it correctly) breaking its isolation from the rest of the circuit. So I think even real solid state computer memory probably uses BJT's because MOSFET's just do not work with capacitors.

I was thinking of using MOSFET's for other things that don't involve capacitance. So in a situation where I have to choose between the energy loss of resistors with BJT's, or loosing energy through leakage with MOSFET's, is the MOSFET still more energy efficient?

#### Harald Kapp

##### Moderator
Moderator
Nov 17, 2011
13,062
Certainly didn't follow ratstar's explanation, sorry.
I feel with you

A few remarks:
1. The 2N7000 datasheet states a zero gate voltage drain current of max. 1 µA at room temperature (higher if the junction is hot). So the about 200 nA your simulation shows is in good coincidence with the datasheet.
The 2N7000 is a 200mA, 60 V small signal MOSFET. Not the best choice for logic gates. The CSD15380F3 from TI for example has drain-source leakage of max. 50 nA.
The 2N4117A from Vishay has ultra low leakage 0f 0.2 pA (typ.)
2. MOSFETs should never be operated with floating gates. You should always have a connection to another valid potential. For logic circuits this is usually either GND or Vdd (you'll also find the older Vcc denomination).
You do not need a resistor to achieve this path. This is where complementary MOS (CMOS) comes into play: You have at least two transistors which ensure the above condition (push-pull or "totem-pole" output). @Nanren888 marked in post #25 that in an integrated circuit it is easy to have these additional transistors.
It is, by the way, even much simpler to implement a transistor on a chjp than a resistor (at least if any reasonable amount of accuracy is to be achieved). This is one reason why you will find so many current mirrors in the internal circuit diagram of an ic instead of resistors.
3. Bipolar circuits not always can be translated into MOSFET circuits 1-by-1. A bjt requires a base current, whereas a MOSFET doesn't. Therefore a bjt with open base is off as there is no source for a base current. A MOSFET with open gate may keep a residual charge as stated in other posts before, that keeps the MOSFET on even if the gate is floating. The gate is also susceptible to noise that is capacitively coupled into the gate, Therefore if a MOSFET's gate is not driven by a push-pull output, a gate-source resistor is usually employed to ensure turn-off of the MOSFET without driving signal.
This alone often requires changes to a bjt circuit when MOSFETs are used to account for this fact.
@ratstar : your post #27: You've made some progress in producing a legible schematic diagrams in another thread. Why do you fall back to your nonsensical, illegible sketches here? These are not MOSFET symbols at all. Also wires don't go through resistors, they start and end at the resistor. You've seen enough good examples to know better.

Last edited:

#### Tristan369

Oct 29, 2020
32
Oh ok. So if you aren't using CMOS design, MOSFET's aren't necessarily more efficient than BJT's? I have heard that MOSFET's are faster? Are there any other pros and cons to using the two for something like a computer? Thank you your reply was very helpful.

#### Harald Kapp

##### Moderator
Moderator
Nov 17, 2011
13,062
MOSFET's aren't necessarily more efficient than BJT's?
It is always difficult to generalize. But not necessarily is well expressed.
I have heard that MOSFET's are faster?
Also cannot be generalized. There are MOSFETs that are powerful but rather slow and bjts that are lightning fast (e.g. for high frequency communication). Non-satisfying answer: it depends.
Are there any other pros and cons to using the two for something like a computer?
Bjts typically (again, not always) dissipate more power as you require a base current to drive them whereas for a MOSFET a voltage is sufficient (plus, of course, a small initial current to charge the gate). But again: it depends on the circuit. bjt circuits can be made efficient and MOSFET circuits can guzzle power when operated inappropriately or simply at very high frequencies

Summary: It depends on what you are doing and how you are doing it.

#### Tristan369

Oct 29, 2020
32
Ok great. So how about a BJT like the 2n2222? Compared to the 2n7000. And is there a way to measure efficiency?

#### Harald Kapp

##### Moderator
Moderator
Nov 17, 2011
13,062
how about a BJT like the 2n2222? Compared to the 2n7000.
Again: depends on the circuit you use them in.

And is there a way to measure efficiency?
If you can define what efficiency means to you, then you should be able to measure it.
Example: build an oscillator, one version with bjt, another version with MOSFET. Then compare power consumption.
But other parameters may have an influence on the efficiency, too. E.g. cleanliness of the output waveform, stability of the frequency etc. A power saving circuit may be worthless if the output signal is heavily distorted.
Efficiency may also be influenced by other factors. For example a fast computer with high power dissipation when running may actualy be more efficient than a slower computer with lower power consumption. Why? The faster computer will have finished a given task in less time and then go into sleep mode while the slower computer still works on the task. So overall the faster, high power computer may acally dissipate less total energy than the slower computer.

#### Tristan369

Oct 29, 2020
32
Interesting, so is measuring the amps going through a circuit how one would measure power consumption? I get less amps the more resistance the circuit has so is high resistance good for efficiency? I thought it was the opposite and resistors only dissipated energy as heat. But it kind of makes sense the more resistance the slower a battery might discharge and the longer it would last.

#### ratstar

Aug 20, 2018
485
I think if you have a highly parallel system it has more connections to battery and they all need more and more power to run, but I dont know how much that power is. I have a gtx980 its 2048 cores and a 32 bit bus, and that comes to about 200 watts or maybe double, I cant remember. The cores and the bus is parallel, it all needs separate power, so I think now, so 200 watts / (2048*32) = 3 milliwatts per line. That may be completely wrong, but its all I can think of at the moment. But there may be even more connections to battery than im thinking, but I bet less open connections to battery the more power your getting to your lines for the same watts, Im pretty sure is correct, but I dont know the rest of the details.

So thats what I think causes better (power) performance, less lines to the battery, doing the same task.

Last edited:

#### Harald Kapp

##### Moderator
Moderator
Nov 17, 2011
13,062
is measuring the amps going through a circuit how one would measure power consumption?
Power = voltage times current. Since in a resistive circuit R = V / I, the first equation can also be expressed as:
1. P = V² / R or
2. P = I² × R
I get less amps the more resistance the circuit has so is high resistance good for efficiency?
Again you're either trying to be too general or I do not understand your intent. For a given voltage, high resistance minimizes power (equation 1). But low power isn't necessarily efficient (although in many cases it is).
Example: charging your cellphone by a low current will take ages, You wouldn't consider this to be efficient.

resistors only dissipated energy as heat.
They do. But you can't have your cake and eat it: Either you want fas circuit and are willing to spend the energy needed to operate it or you do not want to spend much energy but are willing to accept a slow circuit. It's the reason why computers reduce their clock frequency when operated at high power and not cooled sufficiently.

#### Harald Kapp

##### Moderator
Moderator
Nov 17, 2011
13,062
I think if you have a highly parallel system it has more connections to battery and they all need more and more power to run,
It is not the connections that dissipate power, it is the circuits attached. Many circuit connected to power by a single line will dissipate as much energy as the same number of circuits attached to the powre source by multiple connections.
but I dont know the rest of the details.
So please stop confusing other forum members with half-knowledge or ignorance.

#### ratstar

Aug 20, 2018
485
Yeh but they all get less power (current divider), so what if its not enough power to run the lines anymore?

#### Tristan369

Oct 29, 2020
32
Ok I ya I see what you are saying I guess I'm going for some certain minimum frequency with a certain minimum amount of transistors and being able to power it with idk 5V 500mA I guess lol I don't get why it uses more power to go faster, do transistors just need more power to switch them faster or is the idea that switching them more often uses more energy?

#### ratstar

Aug 20, 2018
485
I don't get why it uses more power to go faster, do transistors just need more power to switch them faster or is the idea that switching them more often uses more energy?

I know this one! its true I think.

Its because if you charge and backcharge a capacitor faster at the same power you actually charge and backcharge the capacitor half as far, because it double backed on itself twice as quick.

So to get the same amount of charge, at twice the hz, you have to use twice the power.
hence twice the problems.

=)

Last edited:

#### Harald Kapp

##### Moderator
Moderator
Nov 17, 2011
13,062
I don't get why it uses more power to go faster,
There are always (!) capacitances in a circuit. Even if you do not put explicitly a capacitor in place. Charging and discharging capacitances dissipates energy as the charging an discharging current needs to pass other components where the voltage drop and the current are responsible for energy dissipation in the form of heat. And even capacitors are not ideal, they have an internal resistance (ESR) that contributes to dissipation. The more often per unit of time you switch, the more charging and discharging current will be present the more power will be dissipated.

#### Audioguru

Sep 24, 2016
3,650
Having no resistance between the gate and source makes it switch quicker. means u should short mosfets, dont use resistors. and they dont dissipate (heat up), if they are like capacitors.
You said everything wrong. Please read about it before saying wrong things.
1) The gate-source of a Mosfet is a capacitor with no resistance. The capacitance makes it difficult to switch quickly since charging and discharging speed needs a fairly high current. It can be switched slowly with an extremely low gate current.
2) If you short the gate to source then the Mosfet turns off and if the gate discharging current is fairly high then the Mosfet turns off quickly.
3) Usually a resistor is used from gate to source to turn off a Mosfet. Usually a resistor is used in series with the gate to limit charging current and avoid oscillation.
4) Of course a Mosfet gets hot which is why many Mosfets are in a case that can be bolted to a heatsink. An IRF540 Mosfet's datasheet shows that if the gate-source voltage is 10V then the on-resistance between drain and source is a maximum of 0.044 ohms when it is cool. Then if the drain to source current is 20A, the heating is (20A squared) x 0.044 ohms= 17.6W and it will need a fairly large heatsink.
5) Only the gate-source of a Mosfet is a capacitor. The drain-source is an on-resistance that is spec'd on the datasheet when it is turned on and it is almost an infinite resistance when it is turned off.

Replies
2
Views
898
Replies
4
Views
880
Replies
1
Views
1K
B
Replies
13
Views
2K
Robert Monsen
R
J
Replies
6
Views
5K
D