{"id":353,"date":"2015-11-04T10:57:51","date_gmt":"2015-11-04T10:57:51","guid":{"rendered":"https:\/\/einhugur.com\/blog\/?page_id=353"},"modified":"2015-11-04T11:13:22","modified_gmt":"2015-11-04T11:13:22","slug":"logic-gates","status":"publish","type":"page","link":"https:\/\/einhugur.net\/blog\/index.php\/logic-gates\/","title":{"rendered":"Logic gates"},"content":{"rendered":"<h1>The AND gate:<\/h1>\n<p><a href=\"https:\/\/i1.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/11\/AND-Gates.png?ssl=1\"><img data-attachment-id=\"357\" data-permalink=\"https:\/\/einhugur.net\/blog\/index.php\/logic-gates\/and-gates\/\" data-orig-file=\"https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/AND-Gates.png?fit=400%2C400&amp;ssl=1\" data-orig-size=\"400,400\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"AND Gates\" data-image-description=\"\" data-medium-file=\"https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/AND-Gates.png?fit=300%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/AND-Gates.png?fit=400%2C400&amp;ssl=1\" loading=\"lazy\" class=\"alignnone size-full wp-image-357\" src=\"https:\/\/i1.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/11\/AND-Gates.png?resize=400%2C400&#038;ssl=1\" alt=\"AND Gates\" width=\"400\" height=\"400\" srcset=\"https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/AND-Gates.png?w=400&amp;ssl=1 400w, https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/AND-Gates.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/AND-Gates.png?resize=300%2C300&amp;ssl=1 300w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>Result of AND gate is <strong>(a AND b)<\/strong> or if there are many inputs <strong>(a AND b AND c)<\/strong><\/p>\n<h1>The NAND gate:<\/h1>\n<p><a href=\"https:\/\/i0.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/11\/NAND-Gates.png?ssl=1\"><img data-attachment-id=\"354\" data-permalink=\"https:\/\/einhugur.net\/blog\/index.php\/logic-gates\/nand-gates\/\" data-orig-file=\"https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NAND-Gates.png?fit=400%2C400&amp;ssl=1\" data-orig-size=\"400,400\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"NAND Gates\" data-image-description=\"\" data-medium-file=\"https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NAND-Gates.png?fit=300%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NAND-Gates.png?fit=400%2C400&amp;ssl=1\" loading=\"lazy\" class=\"alignnone size-full wp-image-354\" src=\"https:\/\/i0.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/11\/NAND-Gates.png?resize=400%2C400&#038;ssl=1\" alt=\"NAND Gates\" width=\"400\" height=\"400\" srcset=\"https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NAND-Gates.png?w=400&amp;ssl=1 400w, https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NAND-Gates.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NAND-Gates.png?resize=300%2C300&amp;ssl=1 300w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>Result of NAND gate is <strong>NOT (a\u00a0AND\u00a0b)<\/strong> or if there are many inputs <strong>NOT (a AND b AND c)<\/strong><\/p>\n<h1>The OR\u00a0gate:<\/h1>\n<p><a href=\"https:\/\/i1.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/11\/OR-Gates.png?ssl=1\"><img data-attachment-id=\"358\" data-permalink=\"https:\/\/einhugur.net\/blog\/index.php\/logic-gates\/or-gates\/\" data-orig-file=\"https:\/\/i0.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/OR-Gates.png?fit=400%2C400&amp;ssl=1\" data-orig-size=\"400,400\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"OR Gates\" data-image-description=\"\" data-medium-file=\"https:\/\/i0.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/OR-Gates.png?fit=300%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/OR-Gates.png?fit=400%2C400&amp;ssl=1\" loading=\"lazy\" class=\"alignnone size-full wp-image-358\" src=\"https:\/\/i1.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/11\/OR-Gates.png?resize=400%2C400&#038;ssl=1\" alt=\"OR Gates\" width=\"400\" height=\"400\" srcset=\"https:\/\/i0.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/OR-Gates.png?w=400&amp;ssl=1 400w, https:\/\/i0.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/OR-Gates.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/OR-Gates.png?resize=300%2C300&amp;ssl=1 300w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>Result of OR\u00a0gate is\u00a0<strong>\u00a0(a OR\u00a0b)<\/strong>\u00a0or if there are many inputs\u00a0<strong>\u00a0(a OR\u00a0b AND c)<\/strong><\/p>\n<h1>The NOR\u00a0gate:<\/h1>\n<p><a href=\"https:\/\/i0.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/11\/NOR-Gates.png?ssl=1\"><img data-attachment-id=\"355\" data-permalink=\"https:\/\/einhugur.net\/blog\/index.php\/logic-gates\/nor-gates\/\" data-orig-file=\"https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NOR-Gates.png?fit=400%2C400&amp;ssl=1\" data-orig-size=\"400,400\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"NOR Gates\" data-image-description=\"\" data-medium-file=\"https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NOR-Gates.png?fit=300%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NOR-Gates.png?fit=400%2C400&amp;ssl=1\" loading=\"lazy\" class=\"alignnone size-full wp-image-355\" src=\"https:\/\/i0.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/11\/NOR-Gates.png?resize=400%2C400&#038;ssl=1\" alt=\"NOR Gates\" width=\"400\" height=\"400\" srcset=\"https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NOR-Gates.png?w=400&amp;ssl=1 400w, https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NOR-Gates.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i1.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NOR-Gates.png?resize=300%2C300&amp;ssl=1 300w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>Result of NOR\u00a0gate is\u00a0<strong>\u00a0NOT (a\u00a0OR\u00a0b)<\/strong>\u00a0or if there are many inputs\u00a0<strong>\u00a0NOT (a\u00a0OR\u00a0b AND c)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<h1>The NOT\u00a0gate:<\/h1>\n<p><a href=\"https:\/\/i2.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/11\/NOT-Gates.png?ssl=1\"><img data-attachment-id=\"356\" data-permalink=\"https:\/\/einhugur.net\/blog\/index.php\/logic-gates\/not-gates\/\" data-orig-file=\"https:\/\/i0.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NOT-Gates.png?fit=400%2C400&amp;ssl=1\" data-orig-size=\"400,400\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"NOT Gates\" data-image-description=\"\" data-medium-file=\"https:\/\/i0.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NOT-Gates.png?fit=300%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NOT-Gates.png?fit=400%2C400&amp;ssl=1\" loading=\"lazy\" class=\"alignnone size-full wp-image-356\" src=\"https:\/\/i2.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/11\/NOT-Gates.png?resize=400%2C400&#038;ssl=1\" alt=\"NOT Gates\" width=\"400\" height=\"400\" srcset=\"https:\/\/i0.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NOT-Gates.png?w=400&amp;ssl=1 400w, https:\/\/i0.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NOT-Gates.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/einhugur.net\/blog\/wp-content\/uploads\/2015\/11\/NOT-Gates.png?resize=300%2C300&amp;ssl=1 300w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>Result of NOT\u00a0gate is\u00a0<strong>\u00a0NOT a<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The AND gate: Result of AND gate is (a AND b) or if there are many inputs (a AND b AND c) The NAND gate: Result of NAND gate is NOT (a\u00a0AND\u00a0b) or if there are many inputs NOT (a AND b AND c) The OR\u00a0gate: Result of OR\u00a0gate is\u00a0\u00a0(a OR\u00a0b)\u00a0or if there are many &hellip; <a href=\"https:\/\/einhugur.net\/blog\/index.php\/logic-gates\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Logic gates<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"spay_email":""},"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/Pd75nk-5H","jetpack-related-posts":[{"id":345,"url":"https:\/\/einhugur.net\/blog\/index.php\/xojo-gpio\/using-logic-gates\/","url_meta":{"origin":353,"position":0},"title":"Using logic gates","date":"November 8, 2015","format":false,"excerpt":"In this guide we are going to learn how to use logic gates. \u00a0Even if you can usually do things by just taking more GPIO pins and do the logic in a code then there will be times you may want to do things in hardware. For example you might\u2026","rel":"","context":"Similar post","img":{"alt_text":"LogicCircuits","src":"https:\/\/i2.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/11\/LogicCircuits.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":674,"url":"https:\/\/einhugur.net\/blog\/index.php\/xojo-gpio\/i2c-logic-level-converter-building-our-own\/","url_meta":{"origin":353,"position":1},"title":"I2C logic level converter - Building our own","date":"May 29, 2016","format":false,"excerpt":"In this example we are going to create a I2C logic level converter. Disclaimer: We do not take any responsibility for possible errors in the guide or errors that you might do wiring it up. Incorrect wiring can result in damaged sensor or damaged Raspberry PI. The problem: Some I2C\u2026","rel":"","context":"Similar post","img":{"alt_text":"Be careful about which wires are actually connected and which are not. The SCL wires are crossing others but you see by the dots which they actually connect to.","src":"https:\/\/i0.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2016\/05\/I2CScheme.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":530,"url":"https:\/\/einhugur.net\/blog\/index.php\/xojo-gpio\/pcf8591-analog-to-digital\/","url_meta":{"origin":353,"position":2},"title":"PCF8591 Analog To Digital","date":"May 5, 2016","format":false,"excerpt":"In this example we are going to connect to PCF8591 AD\/DA Converter. Raspberry PI has no Analog inputs\u00a0or outputs, so to talk to analog devices we need to convert the signal. Updated 6. May 2016 - Added R6 and R7 to get the voltage to safe levels on the I2C\u2026","rel":"","context":"Similar post","img":{"alt_text":"PCF8591","src":"https:\/\/i0.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2016\/05\/PCF8591.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":450,"url":"https:\/\/einhugur.net\/blog\/index.php\/basic-electronics\/understanding-transistor-specification-sheets\/","url_meta":{"origin":353,"position":3},"title":"Understanding transistor specification sheets","date":"April 21, 2016","format":false,"excerpt":"It is good to know what to look for when reading transistor specification sheets. Some important things are: NPN vs PNP transistor. -\u00a0The NPN ones switch on the low side (-) while PNP transistors switch on the high side (+). This is important difference and for example this difference Material\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":551,"url":"https:\/\/einhugur.net\/blog\/index.php\/xojo-gpio\/pcf8591-analog-to-digital-braking-out-of-the-box\/","url_meta":{"origin":353,"position":4},"title":"PCF8591 Analog To Digital - Braking out of the box","date":"July 16, 2016","format":false,"excerpt":"\u00a0 Yes you heard me right we are braking out of the box! We will be doing some soldering and making our own PCF8591 breakout board. In this example we are going to connect to PCF8591 AD\/DA Converter without using a pre-made breakout board. When connecting to PCF8591 AD\/DA Converter\u2026","rel":"","context":"Similar post","img":{"alt_text":"PCF8591Part2SC","src":"https:\/\/i0.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2016\/07\/PCF8591Part2SC.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":128,"url":"https:\/\/einhugur.net\/blog\/index.php\/xojo-gpio\/dht11-and-dht22-humidity-temperature-sensors-3-pin-version\/","url_meta":{"origin":353,"position":5},"title":"DHT11 and DHT22 humidity & temperature sensors (3 pin version)","date":"September 20, 2015","format":false,"excerpt":"In this example we are going to connect\u00a0to DHT11 and or DHT22 humidity & temperature sensor. This sensor reads both the humidity and temperature. (This guide was updated on 24. Oct 2015, greatly improving the DHT11 device driver code and added DHT22 device driver code and wiring pictures for the\u2026","rel":"","context":"Similar post","img":{"alt_text":"DHT22 sensor","src":"https:\/\/i0.wp.com\/einhugur.com\/blog\/wp-content\/uploads\/2015\/09\/DHT22.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/pages\/353"}],"collection":[{"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=353"}],"version-history":[{"count":1,"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/pages\/353\/revisions"}],"predecessor-version":[{"id":359,"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/pages\/353\/revisions\/359"}],"wp:attachment":[{"href":"https:\/\/einhugur.net\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}