{"id":14511,"date":"2020-10-14T10:09:06","date_gmt":"2020-10-14T17:09:06","guid":{"rendered":"http:\/\/www.autodesk.com\/products\/fusion-360\/blog\/?p=14511"},"modified":"2022-01-07T08:26:21","modified_gmt":"2022-01-07T16:26:21","slug":"incorporating-logic-gates-electronic-circuit","status":"publish","type":"post","link":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/","title":{"rendered":"Incorporating Logic Gates in Your Next Electronic Circuit &#8211; Part 2"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-14571 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Technology-Center-Toronto-2503-1024x682.jpg\" alt=\"fusion-360-pcb-design\" width=\"1024\" height=\"682\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Technology-Center-Toronto-2503-1024x682.jpg 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Technology-Center-Toronto-2503-300x200.jpg 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Technology-Center-Toronto-2503-768x512.jpg 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Technology-Center-Toronto-2503-1536x1024.jpg 1536w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Technology-Center-Toronto-2503.jpg 2000w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Logic gates are the fundamental building blocks of digital electronic circuits. They follow <a href=\"https:\/\/www.youtube.com\/watch?v=gj8QmRQtVao\" target=\"_blank\" rel=\"noopener noreferrer\">Boolean Algebra<\/a> rules, which are very easy to understand and implement for everyone\u2014including beginner-level designers. They help circuits make decisions, so they form a significant chunk of the <a href=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/an-introduction-for-electronics-beginners-printed-circuit-boards-from-10000-feet\/\">microprocessor and microcontroller circuitry<\/a>.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Essentially, there are seven types of logic gates, out of which we have discussed three (AND, OR, NOR) in the <a href=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/logic-gates-electronic-circuits-and-or-nor\/\">previous blog post<\/a>. In this blog post, we will cover the following gates and see how they work when incorporated in <a href=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/everything-you-need-to-know-about-adding-iot-to-your-pcb-design\/\">digital circuits<\/a>:<\/span><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">NOT<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">NAND<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">XOR<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">XNOR<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">By the end of this post, you will be able to perform various mathematical operations using logic gates and build useful circuits that use multiple logic gates\u2019 features.<\/span><\/p>\n<h2><strong>NOT Gate<\/strong><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14544 size-medium\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/1-300x140.png\" alt=\"not-gate\" width=\"300\" height=\"140\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/1-300x140.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/1.png 521w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">NOT gate is, by far, the simplest logic gate because it performs the fundamental function of inverting, which is why a NOT gate is <a href=\"https:\/\/www.electronics-tutorials.ws\/boolean\/bool_3.html\" target=\"_blank\" rel=\"noopener noreferrer\">also called an Inverter<\/a>. What does a logic inverter do?\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">A logic inverter, or a NOT gate, inverts the logic level present on its input terminal. For instance, if there is a \u20181\u2019 on a NOT gate\u2019s input, it will generate a \u20180\u2019 as the output and vice versa. NOT gate is the only gate with a single input terminal, while all the other gates have two or more input terminals. The Boolean equation for a NOT gate can be given as follows:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong>F=A<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Which generates the following truth table:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14537 size-medium\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.29.14-PM-300x163.png\" alt=\"not-gate-truth-table\" width=\"300\" height=\"163\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.29.14-PM-300x163.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.29.14-PM.png 476w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h3><strong>Internal Working<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">We can use <a href=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/how-to-choose-the-right-resistor\/\">resistors<\/a> and <a href=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/transistors-101-detailed-introduction\/\">transistors<\/a> to represent the internal working of a NOT gate. The transistor base acts as the input terminal, while the output is measured from the collector terminal. The circuit is designed, as shown in the diagram below.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14545 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/2-1024x643.png\" alt=\"not-gate-internal-wroking\" width=\"1024\" height=\"643\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/2-1024x643.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/2-300x188.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/2-768x482.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/2.png 1456w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\"><a href=\"http:\/\/www.schwarzbeck.de\/en\/voltage-probes.html\" target=\"_blank\" rel=\"noopener noreferrer\">Voltage probes<\/a> are used to measure the logic level at the input and output terminals. V(A) represents the point where the input signal is measured, while V(F) represents the output terminal. As you can see, a 0V signal is present at the input, which implies that the NOT gate must invert this signal. Let\u2019s study the simulation results.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-14546 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/3-1024x427.png\" alt=\"not-gate-internal-wroking-2\" width=\"1024\" height=\"427\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/3-1024x427.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/3-300x125.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/3-768x320.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/3.png 1359w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">The blue line represents the input signal, which is present at a logic level 0 (0 Volts), while the red line represents the output signal, which resides at logic level 1; this is precisely how a NOT gate works. If logic level \u20181\u2019 is present at the input, the output would be \u20180\u2019.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Simple NOT Gate Circuit<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s see how we can use this gate to implement a practical circuit used in real-life applications. Consider a cabinet where you wish to install a bulb that lights up when the cabinet door is opened and lights off when the door is shut. To do so, you will need a pushbutton switch installed inside the cabinet, such that, when the door closes, the pushbutton remains pressed, and when the door is opened, the button goes back to its original state; where it is not pressed.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">We can simulate this scenario by using a digital pulse signal representing the door\u2019s opening and closing. When the door is open, the button is not pressed; hence it is characterized by a logic level 0. The NOT gate inverts this signal into a high logic level, which in turn, switches the light on. The circuit and its simulation are illustrated below:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14547 size-full\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/4.jpg\" alt=\"simple-not-gate-circuit\" width=\"917\" height=\"485\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/4.jpg 917w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/4-300x159.jpg 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/4-768x406.jpg 768w\" sizes=\"auto, (max-width: 917px) 100vw, 917px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14548 size-full\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/5.png\" alt=\"simple-not-gate-circuit-2\" width=\"964\" height=\"420\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/5.png 964w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/5-300x131.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/5-768x335.png 768w\" sizes=\"auto, (max-width: 964px) 100vw, 964px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">In the simulation results shown above, the blue line represents the pushbutton input, which means when the cabinet door is closed, the input is at logic level 1. The output signal (represented by green and red) is low, which means the bulb is turned off. Similarly, when the cabinet door opens, the bulb lights up.<\/span><\/p>\n<h2><strong>NAND Gate<\/strong><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14549 size-medium\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/6-300x166.jpg\" alt=\"nand-gate\" width=\"300\" height=\"166\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/6-300x166.jpg 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/6.jpg 646w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">NAND gate is one of the most commonly-used logic gates. It is a combination of AND gate and NOT gate. If you look at the symbol, it is merely an AND gate with a tiny \u2018bubble\u2019 connected in series with it; this bubble represents the inverter, i.e., NOT gate. The operation of the NAND gate is similar to AND except that the output is inverted. For instance, if you have two \u2018high\u2019 signals and perform the AND operation on them, you will get a high output. But with NAND, you will get a low output for two 1\u2019s at the input terminals. Thus, we can represent the NAND gate with the following Boolean equation:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong>F= A.B<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Which generates the following truth table showing the output, F, for all possible input combinations:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14538 size-medium\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.30.29-PM-300x173.png\" alt=\"nand-gate-truth-chart\" width=\"300\" height=\"173\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.30.29-PM-300x173.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.30.29-PM.png 648w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h3><strong>Internal Working<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Like the previously discussed gates, we can represent the NAND gate\u2019s internal working using transistors and resistors, as shown in the circuit diagram below. Two transistors are connected in series, with the emitter the first one connected to the second transistor\u2019s collector. The two transistors\u2019 bases act as input terminals of the NAND gate, while the output is measured from the first transistor\u2019s collector. For the output to be high, either one of the transistors must be cut off. We can verify the results through the simulation graph shown below.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14550 size-full\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/7.png\" alt=\"nand-gate-internal-working\" width=\"546\" height=\"795\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/7.png 546w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/7-206x300.png 206w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14551 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/8-1024x405.png\" alt=\"nand-gate-internal-working-2\" width=\"1024\" height=\"405\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/8-1024x405.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/8-300x119.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/8-768x303.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/8-1536x607.png 1536w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/8.png 1582w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">The output of the NAND gate is low only when both inputs are high. This can be seen from the simulation results above, where the red line indicates the output pulse while the blue and green pulses represent the input signals.<\/span><\/p>\n<h3><strong>Simple NAND Gate Circuit<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Now that you know how a NAND gate works, let\u2019s design a simple circuit where a NAND gate performs a real-life task. You can use a NAND gate to build a simple <a href=\"https:\/\/www.fireaction.co.uk\/news\/how-does-a-burglar-alarm-work\/\" target=\"_blank\" rel=\"noopener noreferrer\">burglar alarm<\/a> that goes off when either the burglar\u2019s shadow is detected, or the burglar stands on the pressure sensor present at the house entrance, or if both conditions are met simultaneously.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">An <a href=\"https:\/\/www.youtube.com\/watch?v=2fvXW4OEWLE\" target=\"_blank\" rel=\"noopener noreferrer\">LDR<\/a> is used to detect the burglar\u2019s shadow, while a pressure sensor is used to detect the thief\u2019s presence through the pressure that their body exerts on the ground. To simulate this scenario, the voltage sources are used to represent the LDR and the pressure sensor. The LDR and pressure sensor both produce a low output when the burglar is present. The simulation results are as follows:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14552 size-full\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/9.png\" alt=\"simple-nand-gate-circuit\" width=\"701\" height=\"773\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/9.png 701w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/9-272x300.png 272w\" sizes=\"auto, (max-width: 701px) 100vw, 701px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14553 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/10-1024x355.png\" alt=\"simple-nand-gate-circuit-2\" width=\"1024\" height=\"355\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/10-1024x355.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/10-300x104.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/10-768x266.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/10-1536x533.png 1536w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/10.png 1776w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">The blue pulse represents the alarm\u2019s voltage levels, showing that the alarm is only off when neither there is a shadow present at the entrance nor any pressure sensed. This is the case when no one is present at the door of the house.\u00a0<\/span><\/p>\n<h3><strong>Multiple Gate Design<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Using a single NAND gate to build a circuit was pretty easy, so let\u2019s move on to designing a circuit with multiple NAND gates. We can use various 2-input NAND gates to design a 4-input NAND gate. When all four inputs are high, the output will be low, and when either one of the inputs is 0, the outcome will be high. Two NAND gates are used as input gates. Then two intermediate NAND gates are present, which sends the signal to the output gate. A total of five NAND gates are used to design a 4-input NAND gate, as shown in the circuit below.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14554 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/11-1024x663.png\" alt=\"nand-multiple-date-design\" width=\"1024\" height=\"663\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/11-1024x663.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/11-300x194.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/11-768x497.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/11.png 1449w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/>\u00a0<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14555 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/12-1024x490.png\" alt=\"nand-multiple-date-design-2\" width=\"1024\" height=\"490\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/12-1024x490.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/12-300x144.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/12-768x368.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/12-1536x735.png 1536w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/12-2048x980.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">The red pulse shows the output (F) of the 4-input NAND gate circuit, which is low only when all four inputs (A, B, C, D) are high. Otherwise, the output remains high.\u00a0<\/span><\/p>\n<h2><strong>XOR Gate<\/strong><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14556 size-medium\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/13-300x158.jpg\" alt=\"xor-gate\" width=\"300\" height=\"158\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/13-300x158.jpg 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/13-768x405.jpg 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/13.jpg 913w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">XOR gate, also known as the Exclusive OR gate, is widely used in many logic and combinational circuits. The output of this gate is high only when both of its inputs are different with respect to each other. i.e., if the input signal is either \u201c01\u201d or \u201c10,&#8221; only then the output would be \u201c1.&#8221; Otherwise, the output will be low, i.e., logic level 0.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Alternatively, we can understand the working principle of the XOR gate in another way. Its output is high when there is an odd number of 1s present at the input terminals. For instance, if we have the inputs as A=1 and B=0, then we have only one 1, i.e., an odd number of 1s present at the input, so the output will be high, i.e., F=1. The Boolean expression for a 2-input XOR gate is written as:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong>F=AB+AB<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Which generates the following truth table:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14539 size-medium\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.31.33-PM-300x191.png\" alt=\"xor-gate-truth-table\" width=\"300\" height=\"191\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.31.33-PM-300x191.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.31.33-PM.png 574w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h3><strong>Internal Working<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">We can understand the XOR gate\u2019s internal working using a combination of other logic gates such as OR, AND, and NAND. Remember that the XOR gate is not an original gate, it is a combination of basic gates that we have studied earlier.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Before moving on to the circuit, it is essential to understand that there are different ways to write Boolean equations. You can simplify an equation and change it into another form by applying simple Boolean algebra rules. We won\u2019t go into the details of the mathematics involved here, but all you need to know at this stage is that we can also write the Boolean equation for a 2-input XOR gate as follows:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong>F=A+B.(A.B)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Now let\u2019s move on to the XOR equivalent circuit.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14557 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/14-1024x621.png\" alt=\"xor-gate-internal\" width=\"1024\" height=\"621\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/14-1024x621.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/14-300x182.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/14-768x466.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/14.png 1455w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">As you can see, the inputs A and B are applied to the OR and NAND gates, and then their outputs are connected to the inputs of an AND gate. The outcome is exactly what we get using an XOR gate.\u00a0\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">If you form the equation for the output F, the gates\u2019 equations will match the OR gate equation. The equation for the output of the OR gate is A+B and for NAND is (A.B), and if we put these equations in the AND gate equation, we will get <\/span>F=A+B.(A.B).<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14558 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/15-1024x521.png\" alt=\"xor-gate-internal-2\" width=\"1024\" height=\"521\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/15-1024x521.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/15-300x153.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/15-768x391.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/15.png 1223w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">From the simulation results, it can be determined that the output is high whenever the inputs are not identical, i.e., when the input is either A=0 and B=1 or A=1 and B=0.\u00a0<\/span><\/p>\n<h3><strong>Simple XOR Gate Circuit<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">We can build a half-adder using an XOR gate and an AND gate. This circuit adds two bits at a time and generates two output bits; one is called the \u201csum,\u201d and the other one is called \u201ccarry.\u201d It is analogous to manually adding large numbers in decimal format, where we carry numbers greater than 9 on the number to the left, and then add it. The following circuit is what a half-adder looks like:\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14561 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/18-1024x657.png\" alt=\"simple-xor-gate-circuit\" width=\"1024\" height=\"657\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/18-1024x657.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/18-300x193.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/18-768x493.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/18.png 1084w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">The output of this circuit is simulated as follows:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14560 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/17-1024x478.png\" alt=\"simple-xor-gate-circuit-2\" width=\"1024\" height=\"478\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/17-1024x478.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/17-300x140.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/17-768x358.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/17-1536x717.png 1536w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/17.png 1798w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">To understand this better, let\u2019s study the truth table for a half-adder.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14540 size-medium\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.32.26-PM-300x171.png\" alt=\"xor-gate-truth-table-2\" width=\"300\" height=\"171\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.32.26-PM-300x171.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.32.26-PM-382x216.png 382w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.32.26-PM.png 566w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">When we add 1 and 0, the sum is 1, and the carry bit is 0. However, when two 1s are added together, the sum is 0, and the carry bit is 1. This is exactly what is happening in the half adder circuit, and you can confirm that by studying the simulation graph where the red pulse represents the sum while the green pulse represents the carry bit.\u00a0<\/span><\/p>\n<h3><strong>Multiple Gate Design<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">How about using multiple XOR gates in the same circuit? An even parity bit generator for a 3-bit message can be made by using various XOR gates in the same circuit. A <a href=\"https:\/\/grace.bluegrass.kctcs.edu\/~kdunn0001\/files\/Exclusive_OR_Gate\/5_Exclusive_OR_Gate5.html\" target=\"_blank\" rel=\"noopener noreferrer\">parity generator<\/a> is a type of error-correction tool used in digital circuits. An even parity generator will first scan the message for the number of 1s. If they are even, there is no need to add a 1; hence it will add a 0 as a parity bit. Otherwise, if the number of 1s is odd, then the parity generator will add a \u201c1\u201d as a parity bit to make the number of 1s even. Here is what the circuit looks like.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14561 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/18-1024x657.png\" alt=\"xor-multiple-gate\" width=\"1024\" height=\"657\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/18-1024x657.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/18-300x193.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/18-768x493.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/18.png 1084w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14562 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/19-1024x532.png\" alt=\"xor-multiple-gate-2\" width=\"1024\" height=\"532\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/19-1024x532.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/19-300x156.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/19-768x399.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/19-1536x798.png 1536w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/19.png 1593w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">In the simulation results, it is evident that the parity bit is 1 when the input has an odd (either 1 or 3) number of 1s, and it is 0 when the number of 1s in the input signal is even (2).\u00a0<\/span><\/p>\n<h2><strong>XNOR Gate<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">XNOR gate, also known as Exclusive NOR gate, is a part of many digital electronic circuits. Its symbol is the same ad XOR, except that there is an inverter \u201cbubble\u201d present at the output, which implies that XNOR\u2019s output is opposite to that of the XOR gate. We can also represent the XNOR gate as an XOR gate in series with an inverter, as shown below.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14563 size-medium\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/20-300x118.jpg\" alt=\"xnor-gate\" width=\"300\" height=\"118\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/20-300x118.jpg 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/20-768x301.jpg 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/20.jpg 907w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">The XNOR gate\u2019s output becomes 1 when both of its inputs are the same for each other, i.e. for a 2-input XNOR gate, the output will be high for input combinations \u201c00\u201d and \u201c11.&#8221; Otherwise, when the inputs are different concerning each other, the output is low.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Since this gate produces a high output when its inputs are the same, it is also called as an \u201cequivalence gate,\u201d because you can detect if two inputs are logically equal or not. Another way to understand an XNOR gate\u2019s working is to produce a high output when the number of 1s at the input terminals is even. For instance, if the input combination for a 3-input XNOR gate is \u201c101,\u201d then the output would be high (1) because there are two 1\u2019s present at the input terminals, which is an even count. <\/span><span style=\"font-weight: 400;\">The Boolean equation for the XNOR gate is written as:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong>F=A.B+A.B<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Which generates the following truth table for a two-input XNOR gate:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14541 size-medium\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.33.29-PM-300x204.png\" alt=\"xnor-gate-truth-table\" width=\"300\" height=\"204\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.33.29-PM-300x204.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.33.29-PM.png 620w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h3><strong>Internal Working<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">We can understand an XNOR gate\u2019s internal working by breaking it down into a combination of the basic gates such as AND, OR, and NOT gates. Using the Boolean equation, we can design the simple logic gates circuit as follows:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14564 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/21-1024x656.png\" alt=\"xnor-gate-internal\" width=\"1024\" height=\"656\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/21-1024x656.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/21-300x192.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/21-768x492.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/21.png 1026w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14565 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/22-1024x410.png\" alt=\"xnor-gate-internal-2\" width=\"1024\" height=\"410\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/22-1024x410.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/22-300x120.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/22-768x308.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/22-1536x616.png 1536w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/22.png 1572w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">The simulation results show a blue-colored output pulse, which is high only when both the inputs are logically equal. Otherwise, the output resides at logic level 0. XNOR gates are widely used in digital electronic circuits, including full-adders, subtractors, and parity checkers and generators.<\/span><\/p>\n<h2><strong>Building Complex Circuits Using Logic Gates<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">Now that you have studied the different types of logic gates, their equations, truth tables, internal working, circuits, and applications, let\u2019s see how we can combine all or some of the seven types of logic gates in a single circuit.\u00a0<\/span><\/p>\n<h3><strong>4-Bit Comparator\u00a0<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">A <a href=\"https:\/\/easyeda.com\/ankitjain21\/4-bit-comparator\" target=\"_blank\" rel=\"noopener noreferrer\">4-bit comparator<\/a>, as the name suggests, compares two 4-bit signals and generates the result as either equal to (A=B), lesser than (A&lt;B), or greater than (A&gt;B). It uses a combination of different logic gates to compare the four bits one-by-one. The first bit of the first word is compared with the first bit of the second word, and so on.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Consider the first 4-bit word A = A<\/span>3A2A1A0 <span style=\"font-weight: 400;\">and the second word B = B<\/span><span style=\"font-weight: 400;\">3<\/span><span style=\"font-weight: 400;\">B<\/span><span style=\"font-weight: 400;\">2<\/span><span style=\"font-weight: 400;\">B<\/span><span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\">B<\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\">, where A<\/span><span style=\"font-weight: 400;\">3<\/span><span style=\"font-weight: 400;\"> and B<\/span><span style=\"font-weight: 400;\">3<\/span><span style=\"font-weight: 400;\"> are the most significant bits, while A<\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\"> and B<\/span><span style=\"font-weight: 400;\">0<\/span><span style=\"font-weight: 400;\"> are the least significant bits. A 4-bit comparator circuit for comparing the words A and B is shown below.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14566 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/23-1024x763.png\" alt=\"complex-circuit-logic-gate\" width=\"1024\" height=\"763\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/23-1024x763.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/23-300x224.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/23-768x572.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/23.png 1213w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">The input signals for the 8 bits are in the form of digital pulses that periodically swing between logic levels 0 and 1. The output is generated based on comparing the two 4-bit words formed as a combination of the 8 bits. The results are simulated below:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14567 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/24-1024x478.png\" alt=\"4-bit-comparator\u00a0\" width=\"1024\" height=\"478\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/24-1024x478.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/24-300x140.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/24-768x358.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/24.png 1346w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Here, the bold red line represents the A=B output terminal. At the point shown, the words A and B are equal; hence the v(equal) pulse is high. If you look at the bits\u2019 values carefully, you will see that A0=B0, A1=B1, A2=B2, and A3=B3.\u00a0<\/span><\/p>\n<h3><strong>3&#215;8 Decoder<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">Another complex circuit example which uses several logic gates in the same circuit is a 3&#215;8 decoder. It has three input lines (A, B, C) and eight output lines (Y0, Y1\u2026, Y7). An enable (EN) pin activates the output based on the input combination. Each output is activated via a 3-bit input code that is unique for each output.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Using a combination of AND &amp; NOT gates, we can build the circuit as follows:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14568 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/25-1024x583.png\" alt=\"3-8-decoder\" width=\"1024\" height=\"583\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/25-1024x583.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/25-300x171.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/25-768x437.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/25-1536x874.png 1536w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/25-382x216.png 382w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/25-591x335.png 591w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/25.png 1868w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Eight AND gates produce the outputs Y0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7, while the NOT gates are supplied with the inputs A, B, and C. The outputs vary according to the table below:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14570 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.56.47-PM-1024x377.png\" alt=\"3-8-decoder-truth-table\" width=\"1024\" height=\"377\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.56.47-PM-1024x377.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.56.47-PM-300x110.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.56.47-PM-768x283.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-14-at-12.56.47-PM.png 1500w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">This can be verified through the simulation results shown below:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-14569 size-large\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/26-1024x545.png\" alt=\"3-8-decoder-2\" width=\"1024\" height=\"545\" srcset=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/26-1024x545.png 1024w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/26-300x160.png 300w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/26-768x409.png 768w, https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/26.png 1186w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">The output waveforms vary according to the truth table shown above. For instance, when all three input signals v(a), v(b), and v(c) are high, the output Y7 is activated, as shown in the simulation results.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Logic gates are beneficial electronic components because they can perform many tasks, including mathematical operations and conditional programming. They are widely used in microcontrollers, microprocessors, and several other electronic devices present around you. All you need to know is how they work, and you can construct digital logic circuits all by yourself and check their results through <a href=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/edit-your-autodesk-eagle-electronic-design-files-with-fusion-360\/\">EAGLE simulations<\/a>.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Are you ready to test out these exercises yourself? Fusion 360 gives you access to comprehensive electronics and PCB design tools in <a href=\"https:\/\/www.autodesk.com\/products\/fusion-360\/electronics-engineer\">one product development platform<\/a>\u2014try it today!<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/www.autodesk.com\/products\/fusion-360\/free-trial\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-13104 size-full\" src=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/04\/Download.png\" alt=\"download-fusion-360\" width=\"280\" height=\"43\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When and how to use NOT, NAND, XOR, and XNOR logic gates.<\/p>\n","protected":false},"author":3911,"featured_media":14571,"menu_order":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[359],"tags":[209,207,206],"coauthors":[],"class_list":["post-14511","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-electronics-engineering","tag-electrical-engineer","tag-electronics","tag-pcb","dhig-theme--light"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Incorporating Logic Gates in Your Next Electronic Circuit - Part 2 - Fusion Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Incorporating Logic Gates in Your Next Electronic Circuit - Part 2 - Fusion Blog\" \/>\n<meta property=\"og:description\" content=\"When and how to use NOT, NAND, XOR, and XNOR logic gates.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/\" \/>\n<meta property=\"og:site_name\" content=\"Fusion Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-14T17:09:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-07T16:26:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Technology-Center-Toronto-2503.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2000\" \/>\n\t<meta property=\"og:image:height\" content=\"1333\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Edwin Robledo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Edwin Robledo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Incorporating Logic Gates in Your Next Electronic Circuit - Part 2 - Fusion Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/","og_locale":"en_US","og_type":"article","og_title":"Incorporating Logic Gates in Your Next Electronic Circuit - Part 2 - Fusion Blog","og_description":"When and how to use NOT, NAND, XOR, and XNOR logic gates.","og_url":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/","og_site_name":"Fusion Blog","article_published_time":"2020-10-14T17:09:06+00:00","article_modified_time":"2022-01-07T16:26:21+00:00","og_image":[{"width":2000,"height":1333,"url":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Technology-Center-Toronto-2503.jpg","type":"image\/jpeg"}],"author":"Edwin Robledo","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Edwin Robledo","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/#article","isPartOf":{"@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/"},"author":{"name":"Edwin Robledo","@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/#\/schema\/person\/81f7fc85212bfa6e804abcca6343e62a"},"headline":"Incorporating Logic Gates in Your Next Electronic Circuit &#8211; Part 2","datePublished":"2020-10-14T17:09:06+00:00","dateModified":"2022-01-07T16:26:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/"},"wordCount":2843,"commentCount":0,"image":{"@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/#primaryimage"},"thumbnailUrl":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Technology-Center-Toronto-2503.jpg","keywords":["Electrical Engineer","Electronics","PCB"],"articleSection":["Electronics Engineering"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/","url":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/","name":"Incorporating Logic Gates in Your Next Electronic Circuit - Part 2 - Fusion Blog","isPartOf":{"@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/#primaryimage"},"image":{"@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/#primaryimage"},"thumbnailUrl":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Technology-Center-Toronto-2503.jpg","datePublished":"2020-10-14T17:09:06+00:00","dateModified":"2022-01-07T16:26:21+00:00","author":{"@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/#\/schema\/person\/81f7fc85212bfa6e804abcca6343e62a"},"breadcrumb":{"@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/#primaryimage","url":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Technology-Center-Toronto-2503.jpg","contentUrl":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2020\/10\/Technology-Center-Toronto-2503.jpg","width":2000,"height":1333,"caption":"Autodesk Technology Centre in Toronto resident, Michael Schwanzer, of ZEITDice, is designing cameras that enable machines to see and understand our world in order to provide humans with new and valuable insights. With the push of one button, the camera is able to generate data for greenhouses all over the world to provide data crucial to increasing their productivity. The team is also developing a completely self-sustaining camera that can be deployed anywhere and recognize retrainable patterns and send the extracted data to the cloud."},{"@type":"BreadcrumbList","@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/incorporating-logic-gates-electronic-circuit\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/"},{"@type":"ListItem","position":2,"name":"Incorporating Logic Gates in Your Next Electronic Circuit &#8211; Part 2"}]},{"@type":"WebSite","@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/#website","url":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/","name":"Fusion Blog","description":"Product updates, tips, tutorials and community news.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/#\/schema\/person\/81f7fc85212bfa6e804abcca6343e62a","name":"Edwin Robledo","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2025\/01\/edwin-headshot-150x150.jpg99104a7458ebc06e35b3a1ab1af8476c","url":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2025\/01\/edwin-headshot-150x150.jpg","contentUrl":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-content\/uploads\/2025\/01\/edwin-headshot-150x150.jpg","caption":"Edwin Robledo"},"description":"I began my career in the communications industry, primarily with the implementation of fiber optics communications and data management. I joined the EAGLE team 25 years ago to satisfy my passion for being involved with circuit board designs. I\u2019m the Technical Marketing Engineer for Fusion 360 electronics and part of the Fusion 360 community team. I have published best practices articles, Blogs, hundreds of video tutorials, and hosted several electronic design bootcamps. My passion is anything related to the outdoors, especially outdoor photography and hiking.","url":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/author\/edwin-robledo\/"}]}},"_links":{"self":[{"href":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-json\/wp\/v2\/posts\/14511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-json\/wp\/v2\/users\/3911"}],"replies":[{"embeddable":true,"href":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-json\/wp\/v2\/comments?post=14511"}],"version-history":[{"count":0,"href":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-json\/wp\/v2\/posts\/14511\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-json\/wp\/v2\/media\/14571"}],"wp:attachment":[{"href":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-json\/wp\/v2\/media?parent=14511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-json\/wp\/v2\/categories?post=14511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-json\/wp\/v2\/tags?post=14511"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.autodesk.com\/products\/fusion-360\/blog\/wp-json\/wp\/v2\/coauthors?post=14511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}