{"id":4052,"date":"2024-09-21T12:21:03","date_gmt":"2024-09-21T12:21:03","guid":{"rendered":"https:\/\/workhouse.sweetdishy.com\/?p=4052"},"modified":"2024-09-21T12:21:03","modified_gmt":"2024-09-21T12:21:03","slug":"universal-gates","status":"publish","type":"post","link":"https:\/\/workhouse.sweetdishy.com\/index.php\/2024\/09\/21\/universal-gates\/","title":{"rendered":"Universal gates"},"content":{"rendered":"\n<p>It is well known that AND, NOT and OR form a universal set of gates.<\/p>\n\n\n\n<p>Consider for example the case n = 1. We have four distinct functions imple-<\/p>\n\n\n\n<p>mented as in Table 6.2.<\/p>\n\n\n\n<p>TABLE 6.2: The four 1-bit functions.<\/p>\n\n\n\n<p>Function Action Form Gate<\/p>\n\n\n\n<p>f<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>: 0 \u2192 0<\/p>\n\n\n\n<p>1 \u2192 0 f(x) = x \u2227 0 AND<\/p>\n\n\n\n<p>f<\/p>\n\n\n\n<p>2<\/p>\n\n\n\n<p>: 0 \u2192 0<\/p>\n\n\n\n<p>1 \u2192 1 f (x) = x Identity<\/p>\n\n\n\n<p>f<\/p>\n\n\n\n<p>3<\/p>\n\n\n\n<p>: 0 \u2192 1<\/p>\n\n\n\n<p>1 \u2192 0 f (x) = \u00afx NOT<\/p>\n\n\n\n<p>f<\/p>\n\n\n\n<p>4<\/p>\n\n\n\n<p>: 0 \u2192 1<\/p>\n\n\n\n<p>1 \u2192 1 f(x) = x \u2228 1 OR<\/p>\n\n\n\n<p>For n &gt; 1, the functions fall into two classes: those giving output 0 and<\/p>\n\n\n\n<p>those giving output 1. Suppose for a given function that the output is 1 for<\/p>\n\n\n\n<p>the set of inputs {x<\/p>\n\n\n\n<p>a<\/p>\n\n\n\n<p>}. The function can then be constructed in terms of what<\/p>\n\n\n\n<p>are called the minterms of f , de\ufb01ned as:<\/p>\n\n\n\n<p>f<\/p>\n\n\n\n<p>a<\/p>\n\n\n\n<p>(x) =<\/p>\n\n\n\n<p>(<\/p>\n\n\n\n<p>1, x \u2208 {x<\/p>\n\n\n\n<p>a<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>0 otherwise.<\/p>\n\n\n\n<p>(6.8)<\/p>\n\n\n\n<p>The minterms are easily constructed from the bits in the input by the product<\/p>\n\n\n\n<p>(AND) of the bits or their complements. For instance, say x<\/p>\n\n\n\n<p>k<\/p>\n\n\n\n<p>= 10110 \u2208 {x<\/p>\n\n\n\n<p>a<\/p>\n\n\n\n<p>}.<\/p>\n\n\n\n<p>Then<\/p>\n\n\n\n<p>f<\/p>\n\n\n\n<p>k<\/p>\n\n\n\n<p>(x) = x<\/p>\n\n\n\n<p>5<\/p>\n\n\n\n<p>\u2227 \u00afx<\/p>\n\n\n\n<p>4<\/p>\n\n\n\n<p>\u2227 x<\/p>\n\n\n\n<p>3<\/p>\n\n\n\n<p>\u2227 x<\/p>\n\n\n\n<p>2<\/p>\n\n\n\n<p>\u2227 \u00afx<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>. (6.9)<\/p>\n\n\n\n<p>We can then construct f (x) as the sum (OR), of the minterms. Then we have<\/p>\n\n\n\n<p>the so-called disjunctive normal form of f (x):<\/p>\n\n\n\n<p>f(x) = f<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>(x) \u2228 f<\/p>\n\n\n\n<p>2<\/p>\n\n\n\n<p>(x) \u2228 . . . (6.10)<\/p>\n\n\n\n<p>Thus we need OR, AND, and NOT operations to construct this function.<\/p>\n\n\n\n<p>Since we will need more than one copy of the bits in the input to construct<\/p>\n\n\n\n<p>the minterms, we require COPY as well.<\/p>\n\n\n\n<p>There is an alternative inductive proof for this. Assume that we have a<\/p>\n\n\n\n<p>circuit built only of AND, NOT, and OR gates to construct f (x) for some<\/p>\n\n\n\n<p>n. Then to construct an n + 1 \u2192 1 function, we de\ufb01ne two n \u2192 1 functions,<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"https:\/\/learning.oreilly.com\/api\/v2\/epubs\/urn:orm:book:9781482238129\/files\/bg86.png\" width=\"671\" height=\"358\"><\/p>\n\n\n\n<p>Computation Models and Computational Complexity 109<\/p>\n\n\n\n<p>whose values are given by the output of f(x), as the (n + 1)<\/p>\n\n\n\n<p>th<\/p>\n\n\n\n<p>bit is set to 0<\/p>\n\n\n\n<p>or 1:<\/p>\n\n\n\n<p>f<\/p>\n\n\n\n<p>0<\/p>\n\n\n\n<p>(x<\/p>\n\n\n\n<p>n<\/p>\n\n\n\n<p>x<\/p>\n\n\n\n<p>n\u22121<\/p>\n\n\n\n<p>. . . x<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>) = f<\/p>\n\n\n\n<p>n+1<\/p>\n\n\n\n<p>(0x<\/p>\n\n\n\n<p>n<\/p>\n\n\n\n<p>x<\/p>\n\n\n\n<p>n\u22121<\/p>\n\n\n\n<p>. . . x<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>), (6.11a)<\/p>\n\n\n\n<p>f<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>(x<\/p>\n\n\n\n<p>n<\/p>\n\n\n\n<p>x<\/p>\n\n\n\n<p>n\u22121<\/p>\n\n\n\n<p>. . . x<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>) = f<\/p>\n\n\n\n<p>n+1<\/p>\n\n\n\n<p>(1x<\/p>\n\n\n\n<p>n<\/p>\n\n\n\n<p>x<\/p>\n\n\n\n<p>n\u22121<\/p>\n\n\n\n<p>. . . x<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>). (6.11b)<\/p>\n\n\n\n<p>Then,<\/p>\n\n\n\n<p>f(x) = (f<\/p>\n\n\n\n<p>0<\/p>\n\n\n\n<p>\u2227 \u00afx<\/p>\n\n\n\n<p>n+1<\/p>\n\n\n\n<p>) \u2295 (f<\/p>\n\n\n\n<p>1<\/p>\n\n\n\n<p>\u2227 x<\/p>\n\n\n\n<p>n+1<\/p>\n\n\n\n<p>). (6.12)<\/p>\n\n\n\n<p>Thus f<\/p>\n\n\n\n<p>n+1<\/p>\n\n\n\n<p>can be implemented by the circuit of Figure 6.2.<\/p>\n\n\n\n<p>FIGURE 6.2: Classical circuit for function evaluation<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is well known that AND, NOT and OR form a universal set of gates. Consider for example the case n = 1. We have four distinct functions imple- mented as in Table 6.2. TABLE 6.2: The four 1-bit functions. Function Action Form Gate f 1 : 0 \u2192 0 1 \u2192 0 f(x) = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4040,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[495],"tags":[],"class_list":["post-4052","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computation-models-and-computational-complexity"],"jetpack_featured_media_url":"https:\/\/workhouse.sweetdishy.com\/wp-content\/uploads\/2024\/09\/download-1.png","_links":{"self":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/4052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/comments?post=4052"}],"version-history":[{"count":1,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/4052\/revisions"}],"predecessor-version":[{"id":4053,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/4052\/revisions\/4053"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/media\/4040"}],"wp:attachment":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/media?parent=4052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/categories?post=4052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/tags?post=4052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}