# Embarrassing electronics problem (logic gates)

• wannab
In summary: Now, the voltage at the output is...?In summary, the conversation discusses the functioning of basic logic gates, specifically the AND gate. The first example uses transistors to produce an output when both inputs are active, while the second example uses diodes as switches to control the output voltage. The conversation also includes an explanation of how the diodes work in the second example and the importance of analyzing circuits using basic principles.
wannab
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 acknowledgment 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

Last edited by a moderator:
Hi wannab, http://img96.imageshack.us/img96/5725/red5e5etimes5e5e45e5e25.gif

wannab said:
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 acknowledgment 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"?

Last edited by a moderator:
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.

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

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.

wannab said:
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.

wannab said:
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.

rbj said:
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?

Well, I think that you should back to basics.
And try analysis this circuit

#### Attachments

• 0.PNG
2.2 KB · Views: 717
I hate diodes. Do I have to understand them or can I just do everything with transistors?

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).

#### Attachments

• 1.PNG
1.6 KB · Views: 646
• 2.PNG
2.3 KB · Views: 752
wannab said:
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).

http://forum.allaboutcircuits.com/cache.php?url=http://forum.allaboutcircuits.com/attachment.php?attachmentid=48551&stc=1&d=1352653220
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)
http://forum.allaboutcircuits.com/cache.php?url=http://forum.allaboutcircuits.com/attachment.php?attachmentid=48547&stc=1&d=1352650592
Reverse-biased diode (diode is OFF)
http://forum.allaboutcircuits.com/cache.php?url=http://forum.allaboutcircuits.com/attachment.php?attachmentid=48548&stc=1&d=1352650592

Last edited by a moderator:
Jony130 said:
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.

Why don't they just show the transistor AND gate like this?

It's like they're making it confusing on purpose.

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.

wannab said:
it's like they're making it confusing on purpose.
...

wannab said:
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...).

Last edited:
wannab, think of diodes as one-way valves. if the applied voltage is positive (or exceeds about 0.6 v), it conducts and if the applied voltage is negative, it does not conduct.

wannab said:
I hate diodes. Do I have to understand them or can I just do everything with transistors?

I think your problem is that you think you can jump into a topic like Electronics half way through and pick it up from there. This is just not true. The basics are absolutely essential for making progress further on. To have the remotest clue about what a transistor is doing and how it can work in a circuit, you need to understand, first, how simple circuits with just resistors operate. If you think that you already have that sussed then you should be able to answer most of the questions http://www.facstaff.bucknell.edu/mastascu/elessonshtml/Resist/Resist2.html. If not, then there is little point in trying to understand Logic Circuits at the component level (you can always design combinational logic circuits by treating the units as black boxes because all the different logic technologies follow the same 'rules' of logic).

If you have started or completed any Physics or Electronics course then you should have or will have the knowledge. Otherwise, you will need to do a bit of self-education. There is no easy way to 'get' Electronics. Some people approach it by building and testing circuits on their own. That can work but you can't beat being taught the basics first.

There is no point in saying that you just don't like diodes. You can't be selective in this way. The expression "blocking the current" means very little, in the wrong context.

sophiecentaur said:
I think your problem is that you think you can jump into a topic like Electronics half way through and pick it up from there. This is just not true. The basics are absolutely essential for making progress further on. To have the remotest clue about what a transistor is doing and how it can work in a circuit, you need to understand, first, how simple circuits with just resistors operate. If you think that you already have that sussed then you should be able to answer most of the questions http://www.facstaff.bucknell.edu/mastascu/elessonshtml/Resist/Resist2.html. If not, then there is little point in trying to understand Logic Circuits at the component level (you can always design combinational logic circuits by treating the units as black boxes because all the different logic technologies follow the same 'rules' of logic).

If you have started or completed any Physics or Electronics course then you should have or will have the knowledge. Otherwise, you will need to do a bit of self-education. There is no easy way to 'get' Electronics. Some people approach it by building and testing circuits on their own. That can work but you can't beat being taught the basics first.

There is no point in saying that you just don't like diodes. You can't be selective in this way. The expression "blocking the current" means very little, in the wrong context.
Ignoring one silly misreading I got 100%

OK then. What's the problem with diodes, which go low resistance when forward biased and high resistance when reverse biased? That's all you need to remember when you look at the diode logic circuit. You can't let diodes spoil your day. Have another go.
Are you doing a course at the moment?

sophiecentaur said:
OK then. What's the problem with diodes, which go low resistance when forward biased and high resistance when reverse biased? That's all you need to remember when you look at the diode logic circuit. You can't let diodes spoil your day.

It makes some sense to me if the diodes let some current through the wrong direction, but not as much as the transistor AND gate does.

Are you doing a course at the moment?
Nope.

As you say, the leakage current for a diode is fractions of a microAmp and for transistor circuits the leakage could be higher. But is this relevant, when all a logic gate needs to detect is whether an input is near one or the other discrete levels? What do you think that tiny reverse current can do to effect the operation of the circuit? It has 'no significant' effect at all.

In the Diode version of an OR gate, if one input OR the other OR both are held at a 'low' voltage, then current will flow through the common resistor (at the top) and the output voltage will be low (a logic 0). This output level (0.6V) will be low enough to act as a 'zero' input for a subsequent gate. This process can only be taken so far, because each gate will have an output voltage value which is 0.6V higher than the previous one. The 0.6Vs will add up, eventually the resulting ('0') voltage output will be almost at the input supply level . This is where a transistor (active) gate works better because the logic levels are maintained/ regenerated from gate to gate.

## 1. What are logic gates?

Logic gates are electronic circuits that perform basic logical operations such as AND, OR, and NOT. They are the building blocks of digital systems and are used to process binary data.

## 2. What is an embarrassing electronics problem?

An embarrassing electronics problem refers to a malfunction or error in a device or circuit that is embarrassing or inconvenient for the user. This could include a device suddenly turning off or not working properly in front of others.

## 3. What are some common causes of embarrassing electronics problems?

Some common causes of embarrassing electronics problems include faulty wiring, defective components, incorrect connections, and power surges. These issues can lead to unexpected errors or malfunctions in electronic devices.

## 4. How can logic gates contribute to embarrassing electronics problems?

Logic gates can contribute to embarrassing electronics problems if they are not designed or implemented correctly. For example, if an incorrect logic gate is used in a circuit, it can cause unexpected results or malfunctioning of the device.

## 5. How can I prevent embarrassing electronics problems related to logic gates?

To prevent embarrassing electronics problems related to logic gates, it is important to use the correct gates for a given circuit and to double-check all connections and wiring. Regular maintenance and testing can also help identify and prevent any potential issues before they become embarrassing problems.

Replies
12
Views
548
Replies
9
Views
3K
Replies
4
Views
1K
Replies
29
Views
4K
Replies
16
Views
4K
Replies
3
Views
3K
Replies
8
Views
3K
Replies
28
Views
4K
Replies
13
Views
4K
Replies
68
Views
4K