Register to reply

Embarrassing electronics problem (logic gates)

Share this thread:
wannab
#1
Feb2-13, 07:10 AM
P: 32
Hi,

I'm fairly new to and not very good at electronics (my A-level project was an LDR that turned on a light, LOL, and I got an A! {UK education for you}) and was wondering how the basic logic gates work.

From hyperphysics this is an AND gate:


Here's how I understand this
Transistors work by producing one output iff there are two active inputs. So a current flows through A as well as the 6V voltage source, this produces an output that flows to the next transistor which, along with an active B - will produce an output in "out", assuming the ratios of the resistances are all accurate (and whatever parameters a transistor has). If I am accurate with this then a simple acknowledgement would be great with any relevant refinements or elaborations.

Here's another AND gate.

Here's how I understand this
I don't. Diodes only allow current in one direction so how could this ever produce any output? Or does this work because diodes are imperfect and after a certain threshold voltage they will both allow a current. If so it seems strange that anyone would use this as the diodes are being used somewhat against their intended purpose.

If you are willing could you please clear up all of my uncertainties? Would be greatly appreciated
Phys.Org News Partner Engineering news on Phys.org
Amazon worker piloted drone around Space Needle
Five next-generation technologies for positioning, navigation and timing
Hoverbike drone project for air transport takes off
NascentOxygen
#2
Feb2-13, 07:37 AM
HW Helper
Thanks
P: 5,145
Hi wannab,

Quote Quote by wannab View Post
Transistors work by producing one output iff there are two active inputs. So a current flows through A as well as the 6V voltage source, this produces an output that flows to the next transistor which, along with an active B - will produce an output in "out", assuming the ratios of the resistances are all accurate (and whatever parameters a transistor has). If I am accurate with this then a simple acknowledgement would be great with any relevant refinements or elaborations.
Yes, that explanation is adequate (just) and works for this circuit.

Here's another AND gate.

Here's how I understand this
I don't. Diodes only allow current in one direction so how could this ever produce any output? Or does this work because diodes are imperfect and after a certain threshold voltage they will both allow a current. If so it seems strange that anyone would use this as the diodes are being used someone against their intended purpose.
What's labelled V is supposed to be a constant supply voltage, say +6V. When you apply 0V to the input at one of the diodes, what is the voltage at "out"? When you apply +6V to both diode inputs, what is the voltage at "out"?
SredniVashtar
#3
Feb2-13, 07:38 AM
P: 94
Try to look at the diodes as switches.
When they conduct they are closed switches. If you use two level of voltage, 0 volts and V volts, you can get the diodes to conduct when you apply 0 volts to the corresponding terminal.

You then have direct connection to 0 volt potential, that is mass. Output is 0 volts (if the diode is ideal) and resistor R is dissipating the power in the form of heat.
This happens if at least one diode is conducting.

If neither diode is conducting, i.e. their input a both high, no current is flowing through R, hence no voltage can drop across it, and the output is V volts, i.e. high.

jim hardy
#4
Feb2-13, 01:38 PM
Sci Advisor
PF Gold
jim hardy's Avatar
P: 3,515
Embarrassing electronics problem (logic gates)

Great question. I'll just try to add a teeny point to what's been said already.

You'll find it helpful, i think, to imagine yourself very small and inside the circuit, 'feeling" the voltages tug at you as if you were a charge carrier.
In your second example imagine yourself sitting at the bottom of that resistor.
That's the node of R, OUT, and the two diode anodes.


You feel the V+ pulling UP through the resistor, that's why it is called a "pullup resistor",
and you feel nothing through the diodes as shown because there's nothing on other side of them to "pull down".
IF you tie either diode to low, then you would feel that pull and it will overwhelm the V+ because the diode can pass more current than the resistor. Output will then be low.

So your second circuit is an AND, ie to have high output both inputs must be not low but high.

It is useful to accustom yourself to this kind of simple analysis.
That is because some systems define TRUE as HIGH, others define TRUE as LOW.
THAT gets confusing, especially when designers mix high-true and low-true in the same logic system.
You need to be able to fall back on your basic circuit analysis.

Keep up the good work .

old jim
wannab
#5
Feb2-13, 05:41 PM
P: 32
What's labelled V is supposed to be a constant supply voltage, say +6V. When you apply 0V to the input at one of the diodes, what is the voltage at "out"? When you apply +6V to both diode inputs, what is the voltage at "out"?
Surely it doesn't matter because the diode is blocking the current? I'm confused. To me this looks like it will always give an output as the 6V goes straight to the output before meeting the diodes.
rbj
#6
Feb2-13, 06:39 PM
P: 2,251
Quote Quote by wannab View Post
Surely it doesn't matter because the diode is blocking the current? I'm confused. To me this looks like it will always give an output as the 6V goes straight to the output before meeting the diodes.

the diode connected to A will not be blocking if the input to terminal A is low. that diode will then conduct. same for B.
SredniVashtar
#7
Feb3-13, 04:02 AM
P: 94
Quote Quote by wannab View Post
Surely it doesn't matter because the diode is blocking the current? I'm confused. To me this looks like it will always give an output as the 6V goes straight to the output before meeting the diodes.
That would be true if there were not a resistor in between. The role of the resistor is to "drop the voltage to zero" when the diodes are conducting.
Again, I am assuming ideal diode behavior here.

Try redraw the circuit using a closed switch connected to earth for D1, and an open switch (also connected to earth, but that's immaterial) for D2. What you see is just a resistor connected between +V and earth, and your output connected to earth. That is output voltage is earth's voltage.
wannab
#8
Feb3-13, 06:31 AM
P: 32
Quote Quote by rbj View Post
the diode connected to A will not be blocking if the input to terminal A is low. that diode will then conduct. same for B.
Why? I thought (at least ideal) diodes blocked all current? Or is it like I said before that it works because diodes aren't ideal?

Also why is there a disconnected ground in the picture? What's that supposed to mean?
Jony130
#9
Feb3-13, 07:02 AM
P: 406
Well, I think that you should back to basics.
And try analysis this circuit
Attached Thumbnails
0.PNG  
wannab
#10
Feb3-13, 09:58 AM
P: 32
I hate diodes. Do I have to understand them or can I just do everything with transistors?
Jony130
#11
Feb3-13, 10:09 AM
P: 406
In this Diode AND gate circuit we force both A and B into HIGH state.
We have this situation

Both diodes are "OFF". No current flows through R1 resistor. If no current flow through resistor, there is no voltage drop across resistor. So the output voltage is in HIGH state (10V).
But if for example we have A input at HIGH state and B input at LOW state. D2 diode is forward bias. So there must be a current flow through R1 resistor.

So the Output is at LOW state (0.6V - D2 diode forward voltage drop).
Attached Thumbnails
1.PNG   2.PNG  
Jony130
#12
Feb3-13, 10:18 AM
P: 406
Quote Quote by wannab View Post
I hate diodes. Do I have to understand them or can I just do everything with transistors?
How can you understand transistor circuit if you don't understand how diode work?
And base-emitter junction is just a diode (PN junction).

Diode allows current to flow in one direction (called the diode's forward direction), while blocking current in the opposite direction (the reverse direction).


Only small reverse current will flow and this current is essentially constant no matter what reverse bias is applied. If reverse bis voltage increased sufficiently beyond reverse breakdown voltage. Diode will begin to pass a large reverse current which can destroy the diode.
Forward-biased diode ( the diode is ON)

Reverse-biased diode (diode is OFF)
wannab
#13
Feb3-13, 10:37 AM
P: 32
Quote Quote by Jony130 View Post
How can you understand transistor circuit if you don't understand how diode work?
I don't know, but all the pictures involving diodes in this thread don't make any sense to me.
wannab
#14
Feb3-13, 10:55 AM
P: 32
Why don't they just show the transistor AND gate like this?



It's like they're making it confusing on purpose.
Jony130
#15
Feb3-13, 11:04 AM
P: 406
They do that because this circuit will work in real life.
http://hyperphysics.phy-astr.gsu.edu...etron/and4.gif .
And circuit that you have drew, show only the concept not real working circuit.
FOIWATER
#16
Feb3-13, 11:04 AM
PF Gold
FOIWATER's Avatar
P: 372
Transistors are created from multiple PN junctions, which is what a diode is.

There is voltage at the output when the diodes are both reversed biased. Which will happen if both A and B are high. If either A or B is low a diode conducts, if they are both low both will conduct. But it only takes one diode conducting to "steer" current left and there is less voltage available at the output than Vout(1) (that voltage which corresponds to a logic high).

So - if either of the inputs is low, current is steered left through that diode to ground, there is not adequate voltage at the output to correspond to a logic high.
NascentOxygen
#17
Feb4-13, 12:39 AM
HW Helper
Thanks
P: 5,145
Quote Quote by wannab View Post
it's like they're making it confusing on purpose.
...
SredniVashtar
#18
Feb4-13, 07:03 AM
P: 94
Quote Quote by wannab View Post
I don't know, but all the pictures involving diodes in this thread don't make any sense to me.
Have you even tried to replace the diodes with switches?
Because it looks like you are experiencing problems with basic circuit theory, not diodes.

In logic gates like the one you've shown here, diodes and transistors are nothing more than controlled switches. Transistors can act as closed or open switches by providing a suitable base or gate voltage. Diodes can act as closed or open switches by providing a suitable voltage at the 'gate input' terminal (if Vanode>Vcathode then it's a closed switch, otherwise it's open).

Once you understood how the gate works with ideal devices, you can refine your analysis by considering the effects of real devices (like diode drop voltage, internal resistances, parasitic capacitances...).


Register to reply

Related Discussions
Open Circuit Problem with Logic Gates Electrical Engineering 6
Logic gates - Electronics Engineering, Comp Sci, & Technology Homework 11
A little electronics question about logical gates... Engineering, Comp Sci, & Technology Homework 40
Logic gates problem...Need to check if my answers are correct.. Introductory Physics Homework 2
Electronics XOR gates Introductory Physics Homework 11