{"id":7038,"date":"2015-06-01T09:15:35","date_gmt":"2015-06-01T16:15:35","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=7038"},"modified":"2025-06-03T06:47:58","modified_gmt":"2025-06-03T13:47:58","slug":"logic-gates","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/logic-gates\/","title":{"rendered":"What Are Logic Gates? Basics and Functions"},"content":{"rendered":"<p>The very basis of computers is binary.\u00a0In electronics everything can be boiled down to 1s and 0s. Logic gates are digital circuits that take one or more binary inputs and produce a binary output. You can check out the basis of logic with <a href=\"http:\/\/en.wikipedia.org\/wiki\/Boolean_algebra\">Boolean Algebra<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>There are seven\u00a0basic logic gates that we are going to go over today.<\/p>\n<figure id=\"attachment_7119\" aria-describedby=\"caption-attachment-7119\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/en.wikipedia.org\/wiki\/Logic_gate\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7119 size-medium\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/logicgates-600x225.png\" alt=\"symbols credit to Wikipedia\" width=\"600\" height=\"225\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/logicgates-600x225.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/logicgates-225x84.png 225w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/logicgates.png 612w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><figcaption id=\"caption-attachment-7119\" class=\"wp-caption-text\">Image from\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Logic_gate\">Wikipedia<\/a>.<\/figcaption><\/figure>\n<p>For this blog post, you can see that most of the gates take two\u00a0inputs (X and Y). NOT is the only exception, taking 1 input. Each of these gates has a related <a href=\"http:\/\/en.wikipedia.org\/wiki\/Truth_table\">truth table<\/a> and <a href=\"http:\/\/en.wikipedia.org\/wiki\/List_of_logic_symbols\">logic symbol<\/a> (we will learn these later).<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/and2.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-7171 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/and2.png\" alt=\"and2\" width=\"406\" height=\"103\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/and2.png 406w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/and2-225x57.png 225w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><\/a><\/p>\n<p><strong>AND<\/strong> is a pretty simple.\u00a0Unless X and Y are 1, 0 will be outputted.<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/nandfix.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-7391 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/nandfix.png\" alt=\"nandfix\" width=\"406\" height=\"107\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/nandfix.png 406w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/nandfix-225x59.png 225w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>NAND<\/strong> is the negation of <strong>AND.<\/strong>\u00a0The output will always be 1 <em>unless<\/em> X and Y are 1, when the output will be 0.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/or.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-7197 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/or.png\" alt=\"or\" width=\"406\" height=\"110\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/or.png 406w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/or-225x61.png 225w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><\/a><\/p>\n<p><strong>OR<\/strong> is the inclusion of one or more inputs will create an output of 1. With <strong>OR<\/strong>, X and Y can be 1, and the output will be 1.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/norfix.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-7392 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/norfix.png\" alt=\"norfix\" width=\"406\" height=\"115\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/norfix.png 406w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/norfix-225x64.png 225w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><\/a><\/p>\n<p><strong>NOR<\/strong> is the negation of <strong>OR.<\/strong>\u00a0If X or Y are 1, or X and Y are 1, then the output will be 0.\u00a0In <strong>NOR<\/strong>, the only inputs to output 1 are when X and Y equal 0.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/xor.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-7201 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/xor.png\" alt=\"xor\" width=\"406\" height=\"115\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/xor.png 406w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/xor-225x64.png 225w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><\/a><br \/>\n<strong>XOR<\/strong> is what some people assumed <strong>OR<\/strong> would, an exclusive <strong>OR<\/strong>. <strong>XOR<\/strong> will only produce the output 1 if there is only 1 between X and Y.\u00a0Two 0s or two 1s will output 0.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/xnorfix.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-7393 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/xnorfix.png\" alt=\"xnorfix\" width=\"406\" height=\"115\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/xnorfix.png 406w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/xnorfix-225x64.png 225w\" sizes=\"auto, (max-width: 406px) 100vw, 406px\" \/><\/a><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/xnor.png\"><br \/>\n<\/a><br \/>\n<strong>XNOR<\/strong> is the inverse of <strong>XOR<\/strong>, meaning that only two 0s and two 1s will produce an output of 1. <strong>XNOR<\/strong> seems a lot closer to <strong>AND<\/strong>, but it is important to remember that it is the inverse of <strong>XOR<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/notdiff.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-7396 aligncenter\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/notdiff.png\" alt=\"notdiff\" width=\"348\" height=\"115\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/notdiff.png 348w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/06\/notdiff-225x74.png 225w\" sizes=\"auto, (max-width: 348px) 100vw, 348px\" \/><\/a><\/p>\n<p><strong>NOT<\/strong> is the simplest logic gate.\u00a0If a 1 is passed in, it becomes a 0.\u00a0If 0 is passed in, it becomes 1.<\/p>\n<p>&nbsp;<\/p>\n<p>These seven\u00a0logic gates are pretty simple, but when used in conjunction with each other, they can be used to build integrated circuits!<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-7038 jlk' data-task='like' data-post_id='7038' data-nonce='1c819b3974' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-7038 lc'>+4<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-7038 jlk' data-task='unlike' data-post_id='7038' data-nonce='1c819b3974' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-7038 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-7038 status align-left'><\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>The very basis of computers is binary. In electronics everything can be boiled down to 1s and 0s. Logic gates are digital circuits that take one or more binary inputs and produce a binary output. You can check out the basis of logic with Boolean Algebra.<\/p>\n","protected":false},"author":29,"featured_media":7205,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[35,1563],"tags":[],"ppma_author":[4478],"class_list":["post-7038","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fpga","category-guide"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2015\/05\/xnor.png","authors":[{"term_id":4478,"user_id":29,"is_guest":0,"slug":"josh-woldstad","display_name":"Josh","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/166ab2302d3f5f5f33ecab52f79a1ab44277f4ef8f5073fe66cf54070f6cd419?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/7038","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=7038"}],"version-history":[{"count":1,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/7038\/revisions"}],"predecessor-version":[{"id":31637,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/7038\/revisions\/31637"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/7205"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=7038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=7038"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=7038"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=7038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}