Gates from Diodes and Switches
Open the lesson
How two diodes and a resistor make an OR gate and an AND gate, why real silicon diodes shift the output by about 0.7 V, why a NOT gate needs an amplifying device, and how switches and a lamp make AND, OR, NOT, NAND and NOR gates, with two JEE-style solved problems and the classic traps.
Chapters
- 0:00Introduction
- 0:29The diode OR gate
- 1:44The diode AND gate
- 2:43Real diodes, and the missing NOT gate
- 3:29Gates from switches and a lamp
- 5:09Example 1: diode OR gate output for all four inputs
- 6:16Example 2: diode AND gate output and current through R
- 7:38Quick revision: diode gates, 0.7 V drop, switch gates
Transcript
0:00Introduction
Hello everyone! Let us start with a small puzzle. Take a battery, a lamp and a switch. You close the switch, and the lamp comes on, right? But today we will build a circuit where closing the switch makes the lamp go out. How can that be? Keep that question in mind. We will also build real logic gates with nothing more than two diodes and one resistor. Questions on such simple gate circuits do come up in JEE, so let's begin.
0:29The diode OR gate
So, here is the course's figure, and first the left circuit. Inputs A and B come in from the left, and Y, on the right, is the output, okay? Each triangle with a bar at its tip is a diode, labelled D one and D two, the D with a small one or two below it. The rectangle is the resistor R, and the three short lines at the bottom are the earth symbol. Notice, both diodes point towards the output, and the resistor joins the output to earth. With me? Suppose input A is high and input B is low. What happens to diode D one? Yes, exactly, D one is forward biased, so it conducts. That is the rule on screen: a high input forward biases its diode, and the diode pulls the output high. One high input is enough. Okay? Now let both inputs be low. Then no diode is forward biased, no current flows through the resistor, and the output simply sits at earth, at zero. Right? So the output is high when A or B is high. That is Y equals A plus B, an OR gate. And remember, this plus sign means OR, not ordinary addition. Got it?
1:44The diode AND gate
Now look at the right circuit. Same parts, but now the diodes point away from the output, towards the inputs. And the resistor goes up to plus five volts, the supply shown at the top, instead of down to earth. Okay? So let input A be low, at zero, and input B be high. Which diode conducts now? That is correct, it is D one, the diode joined to the low input. Its input end is low, so it is forward biased, and it pulls the output down. So any one low input makes the output low. Clear? Now make both inputs high. Then neither diode conducts, no current flows through the resistor, and the output stays high, at plus five volts. With me? So the output is high only when A and B are both high. That is Y equals A dot B, an AND gate, where the dot means AND. Right?
2:43Real diodes, and the missing NOT gate
So far our diodes were ideal. With real diodes, the levels shift by the diode drop, about zero point seven volts for silicon diodes. Okay? Now take a diode OR gate made with silicon diodes. One input is at five volts, and the other is at zero volts. Is the output still five volts? It is not, and this is a common trap. The conducting diode drops about zero point seven volts, so the output is five minus zero point seven, which gives four point three volts. Still high, but not five. Got it? Now the NOT gate. Here the course is very clear: a NOT gate cannot be made from diodes and resistors alone. It needs an amplifying device. Clear?
3:29Gates from switches and a lamp
Now, gates with just switches and a lamp. First, the code on screen. Closed switch means one, and a glowing lamp means one. So an open switch is zero, and a dark lamp is zero. Okay? Put two switches in series with the lamp. The lamp glows only when both switches are closed. So this is an AND gate. Right? Now put the two switches in parallel with each other. Closing either switch completes the circuit, so the lamp glows if A or B is closed. That is an OR gate. With me? Now the twist from our puzzle. The lamp is fed from the battery through a resistor, and a switch, A, is connected across the lamp itself. What happens to the lamp when you close this switch? Yes, exactly, the lamp goes out, because the closed switch shorts it. So a closed switch, one, gives a dark lamp, zero, and an open switch, zero, gives a glowing lamp, one. That is Y equals A bar, where the bar on top means NOT. It is a NOT gate, and our puzzle is solved. Got it? Next, two switches in series, both across the lamp. The lamp goes out only when both are closed. So the output is zero only when A and B are both one. That is Y equals A dot B, with a bar over the whole thing, a NAND gate. Clear? And last, two switches in parallel, both across the lamp. Now closing either switch shorts the lamp, so it glows only when both are open. That is Y equals A plus B, with a bar over the whole thing, a NOR gate. So switches across the lamp always bring in the bar. Okay?
5:09Example 1: diode OR gate output for all four inputs
Now, Example one. In the diode OR gate of the figure, the diodes are ideal, and the inputs are zero volts or five volts. Find the output for all four input combinations. Pause the video and try it first. Done? Okay, let's check. The pair in brackets, zero comma zero, means input A is zero and input B is zero too. Then no diode conducts, and the output is zero volts. Right? Now zero comma one, or one comma zero. Here one stands for five volts, so exactly one input is at five volts. Its diode conducts and, being ideal, passes the full five volts to the output. Clear? And now both inputs are at five volts. So is the output now ten volts? That is the trap, so be careful, because the output stays at five volts, not ten. An ideal diode cannot lift the output above its input. In Boolean terms, one plus one is one, not two. Got it?
6:16Example 2: diode AND gate output and current through R
Now Example two, a little harder. In the diode AND gate of the figure, the resistor is one kilo-ohm, written as k with the Greek letter capital omega, the symbol for ohm. The diodes are ideal. Input A is at zero volts, and input B is at five volts. Find the output voltage, and the current through the resistor. Pause the video and try it first. Done? Okay, let's check. Input A is low, so D one is forward biased, just as we saw. Being ideal, it conducts and ties the output to input A, so the output is zero volts. Right? Now look at D two. Its input is high, at five volts, while the output is at zero, so D two does not conduct. Clear? Now the current. The output is at zero volts, so is the current through the resistor also zero? That is the trap here, so be careful. The top of the resistor is at plus five volts, and its bottom is at the output, at zero volts. So the voltage across it is five minus zero, which is five volts. Okay? So the current, capital I, is five volts over one kilo-ohm, which gives five milliamperes, written m A on screen. Zero output, yet five milliamperes of current. Nice, isn't it?
7:38Quick revision: diode gates, 0.7 V drop, switch gates
So, quick revision. Diodes towards the output, resistor to earth, give OR. Diodes away, resistor to plus five volts, give AND. Real silicon diodes shift the levels by about zero point seven volts, and NOT needs an amplifying device. With switches across the lamp, one gives NOT, two in series give NAND, and two in parallel give NOR. Now go and try the practice problems on this page. All the best!
More videos in Unit 19 · Electronic Devices
- Energy Bands in Solids
- Intrinsic Semiconductors
- Doping: n-type and p-type
- Mobility and Conductivity
- IIT-JEE Questions: Semiconductors
- AIEEE and Earlier JEE Main Questions: Semiconductors
- Biasing and the Characteristic
- Circuits with Ideal Diodes
- Circuits with Real Diodes
- Diodes with Varying Inputs
- IIT-JEE Questions: Junction Diode
- AIEEE and Earlier JEE Main Questions: Junction Diode
- The Half-Wave Rectifier
- Full-Wave Rectifiers
- Filters
- Past JEE Questions: Rectifiers
- The Zener Diode as a Voltage Regulator
- The Light-Emitting Diode
- The Photodiode
- The Solar Cell
- Earlier JEE Main Questions: Special Diodes
- Digital Signals and the Basic Gates
- NAND and NOR: the Universal Gates
- Boolean Algebra and De Morgan's Theorems
- Combinations of Gates
- AIEEE and Earlier JEE Main Questions: Logic Gates
- Overview
- Set 1
- Set 2