{"id":663,"date":"2017-05-13T13:37:59","date_gmt":"2017-05-13T17:37:59","guid":{"rendered":"http:\/\/www.circuitcrush.com\/?p=663"},"modified":"2021-06-30T21:10:31","modified_gmt":"2021-07-01T01:10:31","slug":"logic-gates-basics-tutorial","status":"publish","type":"post","link":"https:\/\/www.circuitcrush.com\/logic-gates-basics-tutorial\/","title":{"rendered":"A Tutorial On Logic Gates"},"content":{"rendered":"<p>Logic gates (or just gates) are one of most basic building blocks for computers and all things digital.<\/p>\n<p>Like most things in electronics, I could write a large book concerning all things logic gate-related. Some of these things include truth tables, Boolean algebra, combinational logic, DeMorgan\u2019s theorems and more.<\/p>\n<p>This tutorial on logic gates is meant to be an introduction to the various gates and how they work. <!--more-->As such, we will cover some aspects of some of the above topics while reserving others for future, non-introductory posts.<\/p>\n<p>The article aims primarily at the beginner who knows some basics of electronics but isn\u2019t sure what a gate is or maybe hasn\u2019t even heard of one yet.<\/p>\n<p>However, even if you\u2019re not a beginner you may find this post to be a good review on the basics of various logic gates and what they do.<\/p>\n<h1><strong>Logic Gates: Some Basics<br \/>\n<\/strong><\/h1>\n<p>To properly discuss logic gates, we first need to understand truth tables.<\/p>\n<p>A truth table is simply a list of all possible input values to a logic gate (or really any digital circuit) and the output response for each input combination. We usually list the inputs in ascending binary order.<\/p>\n<p>Sound confusing? Let\u2019s go through the picture below, which is a truth table for a 2-input AND gate. We\u2019ll discuss the details of what an AND gate is and how it works shortly.<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-666 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/AND-Gate-Truth-Table.png\" alt=\"AND gate truth table\" width=\"269\" height=\"158\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/AND-Gate-Truth-Table.png 269w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/AND-Gate-Truth-Table-150x88.png 150w\" sizes=\"(max-width: 269px) 100vw, 269px\" \/><\/p>\n<p><em>Figure 1: AND gate truth table<\/em><\/p>\n<p>Because 2<sup>2<\/sup> = 4, there are four possible input combinations for a 2-input AND gate. These are listed in the input columns of the table. Usually, the inputs are denoted with letters, so we have input A and input B.<\/p>\n<p>The output is usually denoted with the letter Y. In the table above, we can see whether the output is HIGH (1) or LOW (0) for each of the four inputs. Note that since digital circuits speak in binary, the inputs and outputs can only consist of ones and zeros.<\/p>\n<p>If we had a 3-inpout AND gate the table could be extended. This time there\u2019d be eight rows instead of four because 2<sup>3<\/sup> = 8, with each combination corresponding to binary numbers 000 (decimal 0) to 111 (decimal 7). The third input would be labeled C.<\/p>\n<h2><strong>The Simplest of Logic Gates<br \/>\n<\/strong><\/h2>\n<p>The simplest logic gate technically isn\u2019t really a gate at all though some refer to it as a NOT gate. Nonetheless, it is a very important part of digital design.<\/p>\n<p>An inverter simply takes one input (either a 1 or a 0) and inverts the signal, outputting the opposite level, or the complement of the input. I won\u2019t insult your intelligence by drawing a truth table for this but just to drive the point home if I were to put a 1 or a HIGH on an inverter it\u2019s output would be a 0 or a LOW.<\/p>\n<p>The most commonly used symbol for an inverter is below.<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-667 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/Inverter.png\" alt=\"Logic gates\" width=\"323\" height=\"165\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Inverter.png 323w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Inverter-150x77.png 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Inverter-300x153.png 300w\" sizes=\"(max-width: 323px) 100vw, 323px\" \/><\/p>\n<p><em>Figure 2: schematic symbol for an inverter. The input is A and the output is Y.<\/em><\/p>\n<h2><strong>Logic Gates: Are You Active?<br \/>\n<\/strong><\/h2>\n<p>Notice the bubble on the output of the inverter in figure 2. This bubble represents inversion.<\/p>\n<p>Bubbles on the inputs and outputs of gates also represent the gate\u2019s active level.<\/p>\n<p>The active level is the logic level defined as the ON state for a particular circuit input or output. This level is either HIGH or LOW.<\/p>\n<p>An active LOW terminal is ON when it is in the logic LOW state (0), indicated by the bubble.<\/p>\n<p>An active HIGH terminal is considered to be ON when it is in the logic HIGH state (1), indicated by the absence of a bubble.<\/p>\n<p>In other words, if there is no bubble on the input or output we assume an active HIGH.<\/p>\n<p>A quick note on positive vs. negative logic is in order here. Back in the day, some applications assumed a HIGH was a 0 and a LOW was a 1. This was called negative logic. This kind of logic turns an AND gate into an OR gate and vice-versa (from the prospective of positive logic). This was confusing.<\/p>\n<p>Today, you\u2019re unlikely to see this and positive logic where a HIGH is a 1 and a LOW is a 0 is the dominant convention. Because of this, we shall say no more about negative logic. Just be aware that it does exist.<\/p>\n<h1><strong>The Basic Logic Gates<br \/>\n<\/strong><\/h1>\n<p>All digital logic functions can be made by using various combinations of the three basic logic functions: NOT, AND, and OR.<\/p>\n<p>As we know, NOT is the same as inversion.<\/p>\n<p>The functions of logic gates can be shown in truth tables or written with Boolean functions.<\/p>\n<p>Boolean algebra gets its name from the nineteenth-century mathematician George Boole. It describes the relation between the inputs and outputs of a digital circuit. The input and output values are called Boolean variables.<\/p>\n<p>For example, the Boolean expression that represents an inverter is:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-668\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/Inverter-Boolean.jpg\" alt=\"inverter Boolean equation\" width=\"61\" height=\"30\" \/><\/p>\n<p>The way to pronounce this is <em>Y<\/em> equals NOT <em>A<\/em> or <em>Y<\/em> equals <em>A<\/em> bar. Remember that a bar over a variable represents the complement or opposite of that variable.<\/p>\n<p>The Boolean expression for the AND gate is:<\/p>\n<p style=\"text-align: center;\"><em>Y = A\u00b7B<\/em><\/p>\n<p>Often, this equation is written without the dot. Either way, it means the same thing and says that <em>Y<\/em> equals <em>A<\/em> AND <em>B<\/em>. The expression is similar to algebraic multiplication and is also called the logical product.<\/p>\n<p>Figure 1 shows the AND gate truth table. The AND function combines two or more input variables so that the output is HIGH only if all inputs are HIGH.<\/p>\n<p>In other words, with an AND gate any LOW in, regardless of the number of inputs, means a LOW output. So, if we have a ten input AND gate and 9 inputs are HIGH but one is LOW the output will be LOW.<\/p>\n<p>Because of this, an AND gate can determine when certain conditions are simultaneously true.<\/p>\n<p>Another common application of this gate is to enable the passage of a signal at certain times and inhibit it at others. This is done by asserting one of the inputs on a 2-input AND gate to HIGH for the desired amount of time while some digital signal is fed into the other input. Since one input is HIGH for a period of time and the AND function\u2019s output is HIGH when all inputs are HIGH, the original signal \u201cpasses\u201d through the gate and appears at the output.<\/p>\n<p>If we wish to stop passage of the signal, all we need to do is pull one of the two inputs LOW and the output will be LOW regardless of what the signal at the other input does.<\/p>\n<p>Below, we can see the normal symbol for the AND gate.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-669 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/AND-gate-Symbol.png\" alt=\"Logic Gates - AND gate symbol\" width=\"308\" height=\"140\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/AND-gate-Symbol.png 792w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/AND-gate-Symbol-600x273.png 600w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/AND-gate-Symbol-150x68.png 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/AND-gate-Symbol-300x136.png 300w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/AND-gate-Symbol-768x349.png 768w\" sizes=\"(max-width: 308px) 100vw, 308px\" \/><\/p>\n<p><em>Figure 3: AND gate schematic symbol<\/em><\/p>\n<p>If we string the output of this gate into another AND gate, we can make a 3-input AND gate.<\/p>\n<p>Another helpful way to think of the AND function is a set of switches in series. Only when both switches close does the lamp light up.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-670 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/AND-Gate-Switches.jpg\" alt=\"AND gate made from switches\" width=\"445\" height=\"258\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/AND-Gate-Switches.jpg 530w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/AND-Gate-Switches-150x87.jpg 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/AND-Gate-Switches-300x174.jpg 300w\" sizes=\"(max-width: 445px) 100vw, 445px\" \/><\/p>\n<p><em>Figure 4: AND gate represented by switches<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>The symbol for the OR gate, which is another basic gate, is below. The truth table follows.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-671 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/OR-Gate.jpg\" alt=\"Logic gates - OR gate symbol\" width=\"296\" height=\"156\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/OR-Gate.jpg 296w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/OR-Gate-150x79.jpg 150w\" sizes=\"(max-width: 296px) 100vw, 296px\" \/><\/p>\n<p><em>Figure 5: OR gate schematic symbol<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-673 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/OR-Gate-Truth-Table.png\" alt=\"OR gate truth table\" width=\"268\" height=\"159\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/OR-Gate-Truth-Table.png 268w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/OR-Gate-Truth-Table-150x89.png 150w\" sizes=\"(max-width: 268px) 100vw, 268px\" \/><\/p>\n<p><em>Figure 6: OR gate truth table<\/em><\/p>\n<p>The Boolean expression for the OR function is:<\/p>\n<p style=\"text-align: center;\"><em>Y <\/em>= <em>A<\/em> + <em>B<\/em><\/p>\n<p>The way to pronounce this is <em>Y<\/em> equals <em>A<\/em> OR <em>B. <\/em>You may be tempted to think that this is just like algebraic addition since ANDing is similar to multiplication. They are similar, but there are some differences.<\/p>\n<p>Take a look at the truth table which is telling us that 1 + 1 = 1. This is true for ORing, but obviously not true for addition.<\/p>\n<h3 style=\"text-align: center;\">Become the Maker you were born to be. Try <a href=\"https:\/\/learnarduinonow.com\">Arduino Academy<\/a> for FREE!<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-4238\" src=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2.png\" alt=\"\" width=\"473\" height=\"180\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2.png 828w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2-300x114.png 300w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2-150x57.png 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2-768x292.png 768w\" sizes=\"(max-width: 473px) 100vw, 473px\" \/><\/p>\n<p>The 2-input OR gate has an output that is HIGH when any or both inputs are HIGH. In other words, a HIGH in means a HIGH out, regardless of the number of inputs. If we have a ten input OR gate and only one input is HIGH, the output will still be HIGH.<\/p>\n<p>We can use an OR gate to build a simple alarm. By wiring a magnetic switch whose output is HIGH when opened to an OR gate, then feeding that output to the appropriate circuit, we have a simple alarm.<\/p>\n<p>We can also represent the OR function as a set of switches in parallel. When both or either switch closes, the lamp lights. Only when both switches are open does the lamp remain off.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-674 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/OR-Gate-Switches.jpg\" alt=\"OR gate made from switches\" width=\"427\" height=\"281\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/OR-Gate-Switches.jpg 503w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/OR-Gate-Switches-150x99.jpg 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/OR-Gate-Switches-300x197.jpg 300w\" sizes=\"(max-width: 427px) 100vw, 427px\" \/><\/p>\n<p><em>Figure 7: OR gate represented by switches<\/em><\/p>\n<p>If we string the output of a 2-input OR gate into another 2-input OR gate we can make a 3-input gate, just like was the case with the AND gate.<\/p>\n<h2><strong>NAND and NOR Logic Gates<\/strong><\/h2>\n<p>We know that we can combine NOT, AND, and OR gates to make any other logic function. Special logic gates exist for several of these functions. Two of the most common are NAND and NOR. In fact, each of them can be used to create any logic function, just like the three basic gates.<\/p>\n<p>NAND and NOR are contractions of NOT and AND and NOT and OR. A NAND gate is NOT an AND gate and a NOR gate is NOT an OR gate. This will make more sense in a minute.<\/p>\n<p>A NAND gate <em>is<\/em> an AND gate whose output is fed into an inverter (or NOT gate). A NOR gate <em>is<\/em> an OR gate whose output is fed into an inverter.<\/p>\n<p>The algebraic expression for the NAND function is:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-675\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/NAND-Boolean.jpg\" alt=\"NAND gate Boolean equation\" width=\"77\" height=\"32\" \/><\/p>\n<p>Look at the picture of the NAND gate below. Notice the bubble on the output. The NAND gate has active HIGH inputs and an active LOW output.<\/p>\n<p>The truth table is below the symbol. After inspecting the table, we can see why a NAND gate is NOT an AND gate; a LOW in yields a HIGH output. This is the opposite of the AND function where a LOW in produces a LOW out.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-676 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/NAND-Gate.png\" alt=\"NAND gate symbol\" width=\"297\" height=\"131\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/NAND-Gate.png 640w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/NAND-Gate-600x264.png 600w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/NAND-Gate-150x66.png 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/NAND-Gate-300x132.png 300w\" sizes=\"(max-width: 297px) 100vw, 297px\" \/><\/p>\n<p><em>Figure 8: a NAND gate<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-677 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/NAND-Gate-Truth-Table.png\" alt=\"NAND truth table\" width=\"261\" height=\"166\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/NAND-Gate-Truth-Table.png 261w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/NAND-Gate-Truth-Table-150x95.png 150w\" sizes=\"(max-width: 261px) 100vw, 261px\" \/><\/p>\n<p><em>Figure 9: NAND gate truth table<\/em><\/p>\n<p>The algebraic expression for the NOR function is:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-678\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/NOR-Boolean.jpg\" alt=\"NOR Boolean equation\" width=\"84\" height=\"30\" \/><\/p>\n<p>Look at the picture of the NOR gate below. Notice the bubble on the output. The NOR gate has active HIGH inputs and an active LOW output.<\/p>\n<p>The truth table is below the symbol. After inspecting the table, we can see why a NOR gate is NOT an OR gate; a HIGH in yields a LOW output. This is the opposite of the OR function where a HIGH in produces a HIGH out.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-679 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/NOR-Gate.png\" alt=\"Logic gates - NOR gate\" width=\"288\" height=\"127\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/NOR-Gate.png 640w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/NOR-Gate-600x264.png 600w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/NOR-Gate-150x66.png 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/NOR-Gate-300x132.png 300w\" sizes=\"(max-width: 288px) 100vw, 288px\" \/><\/p>\n<p><em>Figure 10: a NOR gate<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><em><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-680 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/NOR-Gate-Truth-Table.png\" alt=\"NOR gate truth table\" width=\"281\" height=\"158\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/NOR-Gate-Truth-Table.png 281w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/NOR-Gate-Truth-Table-150x84.png 150w\" sizes=\"(max-width: 281px) 100vw, 281px\" \/><\/em><\/p>\n<p><em>Figure 11: NOR gate truth table<\/em><\/p>\n<p>Making a 3-input NAND or NOR gate from 2-input gates is slightly different than before. We cannot simply tie 2 NANDs or NORs together as this will produce a different logic function.<\/p>\n<p>To make a multiple input NAND gate, one must start with an AND gate, then feed its output into a NAND gate.<\/p>\n<p>The situation is similar with the NOR gate. To make a multiple input NOR gate, one must start with an OR gate then feed its output into a NOR gate.<\/p>\n<p>One more interesting point about these logic gates is that both can become inverters if you short the inputs together.<\/p>\n<h2><strong>Exclusive Logic Gates<br \/>\n<\/strong><\/h2>\n<p>The exclusive OR (XOR) is a special case of the OR function. It\u2019s output (for a 2-input gate) is HIGH when one (and only one) of the inputs is HIGH. To extend what we just learned, the output of a multiple-input (more than 2-input) XOR gate is HIGH when an odd number of the inputs are HIGH.<\/p>\n<p>Another way to think of an XOR gate is that the output is HIGH when the inputs are different and LOW when they\u2019re the same. This can be useful for things such as error detection in digital communications.<\/p>\n<p>The Boolean equation for the XOR function is:<\/p>\n<p style=\"text-align: center;\"><em>Y = A <\/em>\u2295<em> B<\/em><\/p>\n<p>The symbol for the XOR gate is below with the truth table below that.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-682 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/Exclusive-OR-Gate.gif\" alt=\"XOR gate\" width=\"294\" height=\"145\" \/><\/p>\n<p><em>Figure 12: XOR gate<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-683 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/XOR-Gate-Truth-Table.jpg\" alt=\"XOR truth table\" width=\"296\" height=\"168\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/XOR-Gate-Truth-Table.jpg 296w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/XOR-Gate-Truth-Table-150x85.jpg 150w\" sizes=\"(max-width: 296px) 100vw, 296px\" \/><\/p>\n<p><em>Figure 13: XOR gate truth table<\/em><\/p>\n<p>The exclusive NOR (XNOR) function is the complement of the XOR function and shares some of the properties.<\/p>\n<p>Its Boolean equation is:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-684\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/XNOR-Boolean.jpg\" alt=\"XNOR Boolean equation\" width=\"88\" height=\"30\" \/><\/p>\n<p>The output of the XNOR gate is HIGH when the inputs are the same and LOW when they are different. Another name for the XNOR gate is the coincidence gate due to this property.<\/p>\n<p>The gate\u2019s symbol and truth table are below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-685 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/XNOR-Gate.png\" alt=\"XNOR symbol\" width=\"327\" height=\"144\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/XNOR-Gate.png 640w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/XNOR-Gate-600x264.png 600w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/XNOR-Gate-150x66.png 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/XNOR-Gate-300x132.png 300w\" sizes=\"(max-width: 327px) 100vw, 327px\" \/><\/p>\n<p><em>Figure 14: XNOR gate<\/em><\/p>\n<p>&nbsp;<\/p>\n<p><em><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-686 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/XNOR-Gate-Truth-Table.gif\" alt=\"XNOR truth table\" width=\"300\" height=\"186\" \/>\u00a0<\/em><\/p>\n<p><em>Figure 15: XNOR gate truth table<\/em><\/p>\n<p>&nbsp;<\/p>\n<h2><strong>Don\u2019t Judge a Logic Gate by Its Cover<br \/>\n<\/strong><\/h2>\n<p>The symbols for all the gates thus far are the most common in my corner of the world. However, there are other symbols for the same gates. Depending on where you live you may see some people, books, or other publications represent the various logic gates this way. The chart below summarizes the various symbols for the different logic gates.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-687 alignnone\" src=\"http:\/\/www.circuitcrush.com\/wp-content\/uploads\/Logic-Gates.png\" alt=\"Logic gates\" width=\"559\" height=\"708\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Logic-Gates.png 559w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Logic-Gates-118x150.png 118w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Logic-Gates-237x300.png 237w\" sizes=\"(max-width: 559px) 100vw, 559px\" \/><\/p>\n<p><em>Figure 16: various symbols for logic gates<\/em><\/p>\n<p>Notice that the short diagonal line on the outputs of the rectangular symbols in the far-right column denote an active LOW output just like the bubble on the symbols in the left column.<\/p>\n<h1><strong>There\u2019s So Much More<br \/>\n<\/strong><\/h1>\n<p>Wow, we\u2019ve gone through more than 2100 words so far and I haven\u2019t even had a chance to mention Mr. DeMorgan, go into any detail about Boolean algebra, or discuss combinational logic. Nor have I had the chance to discuss other important factors concerning logic gates such as fan out, propagation delay, power dissipation and more.<\/p>\n<p>Just like all subjects electronic, volumes can be written on logic gates alone. But, since I don\u2019t want this blog post to become a monster, we\u2019ll pick up on those subjects in some future posts.<\/p>\n<p>At least now you have some of the basics now. Can you replace anything you\u2019re doing on an Arduino or microcontroller with a few simple gates?<\/p>\n<p>I bet you can.<\/p>\n<p>After all, you can kill a fly with a grenade just as well as you can with a fly swatter, but which method makes the most sense?<\/p>\n<p>Until next time, comment and tell us about your favorite uses for logic gates.<\/p>\n<h2 style=\"text-align: center;\">Become the Maker you were born to be. Try <a href=\"https:\/\/learnarduinonow.com\">Arduino Academy<\/a> for FREE!<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4238\" src=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2.png\" alt=\"\" width=\"828\" height=\"315\" srcset=\"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2.png 828w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2-300x114.png 300w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2-150x57.png 150w, https:\/\/www.circuitcrush.com\/wp-content\/uploads\/FB_Cover2-768x292.png 768w\" sizes=\"(max-width: 828px) 100vw, 828px\" \/><\/p>\n<a target=\"_blank\" href=\"https:\/\/www.drpeterscode.com\/index.php\"><img src=\"https:\/\/www.circuitcrush.com\/wp-content\/plugins\/dpabottomofpostpage\/apixel1x1.jpg\" ><\/a><table><\/table>","protected":false},"excerpt":{"rendered":"<p>Logic gates (or just gates) are one of most basic building blocks for computers and all things digital. Like most things in electronics, I could write a large book concerning all things logic gate-related. Some of these things include truth tables, Boolean algebra, combinational logic, DeMorgan\u2019s theorems and more. This tutorial on logic gates is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":692,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[85],"tags":[86],"class_list":{"0":"post-663","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-logic-gates","8":"tag-logic-gates","9":"entry"},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/www.circuitcrush.com\/wp-content\/uploads\/Logic-Gates-1.png","_links":{"self":[{"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/posts\/663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/comments?post=663"}],"version-history":[{"count":1,"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/posts\/663\/revisions"}],"predecessor-version":[{"id":4336,"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/posts\/663\/revisions\/4336"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/media\/692"}],"wp:attachment":[{"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/media?parent=663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/categories?post=663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.circuitcrush.com\/wp-json\/wp\/v2\/tags?post=663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}