EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: JoeN on March 14, 2015, 05:36:35 am

Title: Academic question about wiring a logic gate from discrete MOSFETs
Post by: JoeN on March 14, 2015, 05:36:35 am
I want to wire up a few gates from discrete MOSFETs.  I am using 2N7000s and BS250s if that matters.  Did the inverter, that works.  Now I am going to do an AND gate and I notice something that is a little weird on the schematic that I find everywhere for how to do this:

(https://www.eevblog.com/forum/beginners/academic-question-about-wiring-a-logic-gate-from-discrete-mosfets/?action=dlattach;attach=141682)

One of the MOSFETs, Q3, is wired as a four-terminal device with the body detached from the source.  Is that a show-stopper for doing this with discretes?  Looking at the schematic, it feels like the gate should still work just forgetting about that body connection.  Will it?  If so, why and if not, why not?

Maybe I should just not be so lazy and wire this and see if it works or not.    :-\
Title: Re: Academic question about wiring a logic gate from discrete MOSFETs
Post by: ataradov on March 14, 2015, 07:02:27 am
It will work either way. The reason it is shown this way is that when you actually make a chip on a single p-type substrate, you automatically end up with bodies of all NFETs connected together. PFETs are usually also connected together, but this is mostly for ease of manufacture reason.

It does not matter for simple gates, but may matter for more complex logic circuits and other analog trickery.
Title: Re: Academic question about wiring a logic gate from discrete MOSFETs
Post by: ataradov on March 14, 2015, 07:12:50 am
And just in case you want to play with gutted "real CMOS" device, there is a funny chip CD4007.  They are not that expensive and are fun to play with if you are learning about CMOS logic.
Title: Re: Academic question about wiring a logic gate from discrete MOSFETs
Post by: JoeN on March 14, 2015, 07:35:55 am
And just in case you want to play with gutted "real CMOS" device, there is a funny chip CD4007.  They are not that expensive and are fun to play with if you are learning about CMOS logic.

Very cheap.  TI still makes it.  Looks like they took over this IC from Harris a while back.  27 cents reel price.

http://www.ti.com/product/CD4007UB (http://www.ti.com/product/CD4007UB)

Thanks for the other pointers too.
Title: Re: Academic question about wiring a logic gate from discrete MOSFETs
Post by: SeanB on March 14, 2015, 08:05:54 am
The 4007 makes a pretty good analogue part as well. It is not a digital device, more like a nice matched analogue fet set that you can even use for digital work.
Title: Re: Academic question about wiring a logic gate from discrete MOSFETs
Post by: amyk on March 14, 2015, 04:08:39 pm
If you really want MOSFETs with separate bulk terminals, they're available:

http://www.nteinc.com/specs/400to499/pdf/nte464.pdf (http://www.nteinc.com/specs/400to499/pdf/nte464.pdf)

...but quite expensive.
Title: Re: Academic question about wiring a logic gate from discrete MOSFETs
Post by: Zero999 on March 14, 2015, 08:18:56 pm
http://wiki.analog.com/university/courses/electronics/electronics-lab-28#build_cmos_logic_functions_using_cd4007_array (http://wiki.analog.com/university/courses/electronics/electronics-lab-28#build_cmos_logic_functions_using_cd4007_array)
Title: Re: Academic question about wiring a logic gate from discrete MOSFETs
Post by: free_electron on March 16, 2015, 05:47:30 am
The reason for this is that the two mosses share the same well.
A well is a doped region in the wafer. A well can be N or P doped.

The wafer itself is intrinsic (not doped)

Those two transistors really dont exist as separate elements.

What we do i simply create a well and put as many gates across as we need. If we need a four input logic port we simply put four gates (mosfet gate) side by side. The piece between the gates is then the drain of one and source of the next one.
Title: Re: Academic question about wiring a logic gate from discrete MOSFETs
Post by: rs20 on March 16, 2015, 05:57:50 am
Just to reiterate: As mentioned briefly earlier, in many (most?) cases, these circuits will work absolutely fine with normal, discrete, 3-terminal MOSFETs. Most circuits I found didn't have the body connection drawn at all:

(http://www.c-jump.com/CIS77/images/figure_3_7_AND_gate.png)

Why? Because whether you connect the body to the local source or the global GND/VSS, the circuit generally behaves identically, at least in straightforward digital stuff. So the body isn't really worth drawing at all, and you can just build it out of discrete FETs.

Exercise: use your knowledge of discrete FETs, and simulate on paper what that circuit will do for all four input permutations. Figure out Vgs for each transistor, is it on or off, etc etc. You can thus prove all of this stuff for yourself.

Title: Re: Academic question about wiring a logic gate from discrete MOSFETs
Post by: Zero999 on March 16, 2015, 08:53:46 am
I don' think anyone except for the original poster said it wouldn't work with discrete MOSFETs.

It's just much cheaper to use the CD4007 which is also a handy IC to have around for analogue electronics.You can build a nice op-amp with the CD4007 plus a some BJTs or just use two CD4007s.
Title: Re: Academic question about wiring a logic gate from discrete MOSFETs
Post by: rs20 on March 16, 2015, 09:17:10 am
Sorry, by "people feeling confused", I meant any future people who scan through this thread and miss the first sentence of message #2. Everything participating in this thread is on board, I know  :) Edited message accordingly.
Title: Re: Academic question about wiring a logic gate from discrete MOSFETs
Post by: JoeN on March 20, 2015, 07:05:39 am
I don' think anyone except for the original poster said it wouldn't work with discrete MOSFETs.

Really?  What I recall saying, having just now copied it from the original message was this:

Looking at the schematic, it feels like the gate should still work...

But I did ask if it would work or not just to be sure.

P.S.  I was able to get INVERT, AND, and OR gates to work out of these discrete transistors no problem.
Title: Re: Academic question about wiring a logic gate from discrete MOSFETs
Post by: Zero999 on March 20, 2015, 08:42:29 am
I don' think anyone except for the original poster said it wouldn't work with discrete MOSFETs.

Really?  What I recall saying, having just now copied it from the original message was this:

Looking at the schematic, it feels like the gate should still work...

But I did ask if it would work or not just to be sure.

P.S.  I was able to get INVERT, AND, and OR gates to work out of these discrete transistors no problem.

Note I said everyone but the original poster which is you!

Did you have any problems with any of the circuits?
Title: Re: Academic question about wiring a logic gate from discrete MOSFETs
Post by: JoeN on March 20, 2015, 11:23:45 pm
Did you have any problems with any of the circuits?

No problems with the 3 circuits referenced here which were INVERT, AND (and NAND obviously prior to the inverter stages), and OR (and NOR ...) .  I went on to try a flip flop and had problems with that which the community here explained so I am reworking it but came up short on p-channel signal MOSFETs to complete that so I am waiting for a few more from an eBay seller.  I have a bunch of power P-channel MOSFETs but I don't even want to mess with those.