RDRankDeterminant
Video lessons › Physics · Unit 19 · Electronic Devices · Chapter 5 · Logic Gates

Combinations of Gates

8-minute video lesson in English, narrated with a computer voice.

Full notes, solved examples and practice for this lesson
Open the lesson Free: sign up to open it.

How to read any combination of logic gates: label every gate from the inputs to the output, the exclusive OR (XOR) and exclusive NOR (XNOR) gates with their Boolean expressions and truth tables, input waveforms cut into time intervals, the staircase lamp puzzle, and an XOR built from four NAND gates using De Morgan's theorem, with two JEE-style solved problems and the classic traps.

Chapters

  1. 0:00Introduction
  2. 0:29Reading a circuit: from the inputs to the output
  3. 0:59Exclusive OR (XOR)
  4. 2:22Exclusive NOR (XNOR)
  5. 3:21Input waveforms: cut the time axis
  6. 3:46Example 1: XOR output for two input waveforms
  7. 5:20Example 2: XOR gate built from four NAND gates
  8. 7:30Quick revision: reading gate circuits, XOR, XNOR, waveforms

Transcript

0:00Introduction

Hello everyone! Let us start with a small puzzle. Think of a staircase light, with one switch at the bottom and another at the top. Flip either switch, and the lamp changes, on to off, or off to on. So which logic gate is hiding in that wiring? Keep that question in mind. Today we build two new gates from the basic ones, and learn to read any combination of gates. Such circuits come up often in JEE, so let's begin.

0:29Reading a circuit: from the inputs to the output

So, suppose a question joins three or four gates together. Where do you begin, at the output, or at the inputs? You begin at the inputs, and work towards the final output, one gate at a time. Right? As you go, label the output of every gate, and write its Boolean expression right there. Okay? Finally, simplify, or fill in a truth table, one column at a time. Let us try this method on a brand new gate. Clear?

0:59Exclusive OR (XOR)

Our first new gate is the exclusive OR, called XOR for short. On screen, the output Y equals A B bar, plus A bar B, where A and B are the inputs. The line on top of a letter is a bar, meaning NOT, so B bar is NOT of B, okay? Letters side by side mean AND, and the plus sign means OR. With me? Now its truth table, column by column. The pair A comma B, in brackets, takes four values: zero zero, zero one, one zero, and one one. Okay? The term A B bar is one only when A is one and B is zero, so its column reads zero, zero, one, zero. The term A bar B is one only when A is zero and B is one, giving zero, one, zero, zero. Right? Now a question that catches many students. When both inputs are one, an OR gate gives one. So what does XOR give in that row? If you said one, careful, that is the trap. It gives zero, because both terms are zero there. So the Y column reads zero, one, one, zero. Treat XOR like OR, and you lose marks in that last row. In words, the output is one when the inputs differ, and zero when they are the same. Got it?

2:22Exclusive NOR (XNOR)

Now its partner, the XNOR gate, short for exclusive NOR. Here, Y equals A B, plus A bar B bar. The first term is one when both inputs are one, and the second when both are zero. Okay? So, in which rows of the truth table is the output one? Yes, exactly, the first row and the last row. So, for the same four input pairs, the column reads one, zero, zero, one. Compare it with XOR, and every output is flipped. Right? In words, the XNOR output is one when the inputs are the same. With me? Now, back to our staircase puzzle. Wired one way, the lamp is on when the two switches are in different positions, and that is the XOR gate. Wired the other way, it is on when they are in the same position, and that is the XNOR gate. So the answer depends on the wiring, and our puzzle is solved.

3:21Input waveforms: cut the time axis

Clear? Sometimes the inputs are waveforms, which switch between zero and one as time goes on. So first, mark every instant at which any input changes, okay? These instants cut the time axis into intervals, and inside each interval, no input changes. So each interval is just one row of the truth table. Apply it, and you have the output. Got it?

3:46Example 1: XOR output for two input waveforms

Let us try the first example. Input A is one for t between zero and two seconds, and zero afterwards. Input B is one for t between one and three seconds, and zero otherwise. The less-than signs mark these ranges, t is the time, and s stands for seconds. When is the output of an XOR gate equal to one? Pause the video and try it first. Done? Okay, let's check. Input A changes at two seconds, and input B at one second and at three seconds. So the instants are one, two and three seconds, giving four intervals. Okay? From zero to one second, input A is one but B is zero. The pair in brackets is one, zero, so the inputs differ, and XOR gives one. Right? From one to two seconds, both inputs are one, the same, so the output is zero. With me? From two to three seconds, input A has dropped to zero, while B is still one. The inputs differ again, so Y is one. Clear? Many students stop at this point. But is anything left to check after three seconds? Yes, there is one more interval, after three seconds, shown with the greater-than sign. There both inputs are zero, so the output is zero. Always check the last interval, okay? So the XOR output is one from zero to one second, and from two to three seconds, exactly where the inputs disagree. Got it?

5:20Example 2: XOR gate built from four NAND gates

Now a harder one, using the course's figure. There are four NAND gates, each an AND shape with a small circle at its output for the NOT. The first gate takes A and B, and gives A B whole bar, one long bar over both letters, okay? The second takes A and that output, the third takes B and that output, and the fourth combines them to give Y, the final output. Show that Y is the XOR of the two inputs. Pause the video and try it first. Done? Okay, let's check, gate by gate from the inputs. Gate one gives A B whole bar. By De Morgan's theorem, break the bar and change the sign, so it equals A bar plus B bar. Right? Gate two is a NAND of input A and this output. So under one long bar, we get A times, in brackets, A bar plus B bar. Open the bracket, and the first term is A dot A bar, the dot meaning AND. So what is A dot A bar? Yes, exactly, it is zero, because A and A bar can never both be one. So under the bar, A dot A bar plus A B bar loses its first term, and gate two gives the NOT of A B bar. Okay? Gate three works the same way. Here B times A bar survives, and B times B bar is zero, so gate three gives the NOT of A bar B, with me? Now gate four, a NAND of these two outputs. So Y is one long bar over two terms, the NOT of A B bar, and the NOT of A bar B, joined by the dot. It looks scary, right? But one more step does it. Apply De Morgan once more: break the long bar, and change the dot to a plus. Each term then has two bars, and two bars cancel. So Y equals A B bar, plus A bar B, exactly the XOR gate. The figure shows this same expression, and its truth table reads zero, one, one, zero. Four NAND gates make an XOR gate. Clear?

7:30Quick revision: reading gate circuits, XOR, XNOR, waveforms

So, quick revision. First, label every gate's output and its expression, working from the inputs to the output Y, okay? Second, XOR gives one when the inputs differ, and XNOR gives one when they are the same. Third, for waveforms, cut time wherever an input changes, then use the truth table in each piece. You have done really well today. Now go and try the practice problems on this page. All the best!

More videos in Unit 19 · Electronic Devices