<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Programmable Devices: Programmable Logic</title><link>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Programmable Devices: Programmable Logic</title><link>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic</link><pubDate>Tue, 09 Jul 2024 14:20:34 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:722dc523-e66e-42a7-84b5-de3f2731c4d8</guid><dc:creator>vivekvelusamy</dc:creator><comments>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic#comments</comments><description>Current Revision posted to Documents by vivekvelusamy on 7/9/2024 2:20:34 PM&lt;br /&gt;
&lt;p&gt;&lt;a name="top" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt; &lt;img class="nolightbox essProfile xs-float-left xs-pr2 xs-pb2" alt="Profile image" height="115" src="/e14/assets/legacy/2018/PrgmLogic_profile.png" /&gt;&lt;/p&gt;
&lt;p&gt;The world and our interaction with it is analog. Our surrounding environment, colors in the electromagnetic spectrum, speech, and sound all are represented by continuously changing analog values. When it comes to processing these analog signals, however, digital systems offer several benefits to a traditional analog processing solution. For example, they have higher performance, ease of storage and transmission, and better noise immunity. As such, while the world is analog, it is mainly processed digitally using logic circuits. In this learning module, you will be introduced to the essentials of logic design, and how it can be implemented using programmable logic.&lt;br /&gt; &lt;a class="xbold" href="/w/documents/3803/related-components-dev-boards-for-element14-essentials-programmable-devices-i" data-icid="essentials-programdevice1-doc" data-e14adj="t"&gt;Related Components &amp;amp; Dev Boards&lt;/a&gt; | &lt;a class="xbold" href="#test" data-e14adj="t"&gt;Test Your Knowledge &lt;i class="text-orange xs-ml05 fas fa-caret-right"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="xs-clear"&gt;&lt;a name="object" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2 id="mcetoc_1i1b4hg5f0" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;2. Objectives&lt;/h2&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;&lt;em&gt;Upon completion of this module, you will be able to:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Perform some fundamental operations of Boolean algebra&lt;/li&gt;
&lt;li&gt;Explain the operation and truth tables of common logic gates&lt;/li&gt;
&lt;li&gt;Illustrate how combinatorial circuits are designed&lt;/li&gt;
&lt;li&gt;Discuss the differences between combinatorial and sequential circuits&lt;/li&gt;
&lt;li&gt;Understand how shift registers, counters, and state machines operate&lt;/li&gt;
&lt;li&gt;Explain the basic structures of PLDs&lt;/li&gt;
&lt;li&gt;Describe the role of HDLs&lt;a name="sec3" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1i1b4hg5f1" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;3. Boolean Algebra&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;The key foundation of digital logic is Boolean Algebra. Without understanding it we cannot produce effective logic designs or understand the outputs of higher level tools such as synthesis engines. Boolean algebra is named after its inventor, George Boole, who in 1854 published his work entitled, &amp;quot;An investigation of the laws of thought on which are founded the mathematical theories of logic and probabilities.&amp;quot; This work was later used by Claude Shannon in his 1937 master&amp;#39;s thesis at MIT entitled, &amp;quot;A Symbolic Analysis of Relay and Switching Circuits,&amp;quot; which demonstrated that switching circuits could solve all problems in the same manner as Boolean algebra. Thus, the relationship between switching circuits and Boolean algebra became the foundation of all digital applications.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5f2" class="xbold"&gt;- 3.1 Boolean Addition and Multiplication&lt;/h3&gt;
&lt;center&gt;
&lt;p&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1+0=1&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+1=1&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1+1=1&lt;/strong&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p&gt;As you can see, the result of the SUM is equal to one only when one or more of the literals is one.&lt;/p&gt;
&lt;p&gt;Boolean multiplication produces the PRODUCT of the literals:&lt;/p&gt;
&lt;center&gt;
&lt;p&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.1=0&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1.1=1&lt;/strong&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p&gt;In this case, you can see the PRODUCT is equal to one only when both literals are equal to one.&lt;/p&gt;
&lt;p&gt;Understanding the meaning of the SUM and PRODUCT terms will be important later when we examine logic gates and equations.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5f3" class="xbold"&gt;- 3.2 Boolean Algebra Laws&lt;/h3&gt;
&lt;p&gt;Just as in other areas of mathematics, Boolean algebra has several laws which we must understand, such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Commutative Law:&lt;/strong&gt; The order of literals in Boolean addition does not affect the result: A+B=B+A&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Associative Law:&lt;/strong&gt; When performing Boolean addition of more than two literals, the result is the same regardless of grouping:&amp;nbsp; A+(B+C)=(A+B)+C&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Distributive Law:&lt;/strong&gt; Performing a Boolean addition of two or more literals before performing a Boolean multiplication on the result is the same as performing the Boolean multiplication with each literal before performing the Boolean Addition A(B+C)=AB+AC&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These laws become very important when we design logic circuits and wish to optimize the number of logic gates we use in our solution.&lt;/p&gt;
&lt;p&gt;Along with these laws we also have twelve rules of Boolean Logic with which we must become familiar. They are:&lt;/p&gt;
&lt;center&gt;
&lt;table class="xs-border; xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" colspan="2"&gt;&lt;strong&gt;12 Boolean Logic Rules&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A + 0 = A&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;A . A = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A + 1 = 1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;A . &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A . 0 = 0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;a href="/e14/assets/legacy/2018/A2bars.png" data-e14adj="t"&gt;&lt;img loading="lazy" alt="a2 bars" src="/e14/assets/legacy/2018/A2bars.png" /&gt;&lt;/a&gt; = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A . 1 = A&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;A + A.B = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A + A = A&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B = A + B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;(A + B).(A+C) = A + B.C&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5f4" class="xbold"&gt;- 3.3 DeMorgan&amp;#39;s Theorem&lt;/h3&gt;
&lt;p&gt;The final remaining element we need to understand about Boolean Algebra is DeMorgan&amp;#39;s Theorem which states, &amp;quot;The complement of a product of sums is equal to the sum of the complements.&amp;quot;&lt;/p&gt;
&lt;p&gt;This is better shown represented as an equation: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A good mnemonic device to remember this is: &amp;quot;break the bar, change the sign.&amp;quot;&lt;/p&gt;
&lt;p&gt;Of course, now that we understand Boolean algebra, we want to be able to see how it maps to the logic gates we use to implement digital circuits.&lt;a name="sec4" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5f5" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;4. Logic Gates&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;The seven commonly used logic gates in digital design are NOT, AND, OR, XOR, NOR, NAND and XNOR gates. In our designs we use combinations of these logic gates to implement the logic function. In this section, we&amp;#39;ll review these logic gates.&lt;/p&gt;
&lt;p&gt;At the lowest level these logic gates are made from arrangements of transistors; however, each arrangement has its own symbol and truth table, which shows for a given input what its outputs will be. (Note: For simplicity&amp;#39;s sake, except for the NOT gate, all gates are demonstrated with two inputs).&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5f6" class="xbold"&gt;- 4.1 NOT Gate&lt;/h3&gt;
&lt;p&gt;The simplest of the logic gates is the NOT gate. This gate simply inverts the logic value presented on the input.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-pr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 1" src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:200px;"&gt;
&lt;p class="xbold"&gt;NOT symbol &amp;amp; truth table&lt;/p&gt;
&lt;table class="xs-border xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 1: NOT Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5g7" class="xbold"&gt;- 4.2 AND Gate&lt;/h3&gt;
&lt;p&gt;One of the most commonly used logic gates is the AND gate, which implements Boolean algebra multiplication and produces the PRODUCT of its inputs as we described earlier in this learning module.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-align-middle xs-mr2" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 2" src="/e14/assets/legacy/2018/diagram2_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p&gt;&lt;strong&gt;AND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table class="xs-border xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 2: AND Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5g8" class="xbold"&gt;- 4.3 OR Gate&lt;/h3&gt;
&lt;p&gt;To implement Boolean addition and generate the SUM of its inputs, we use the OR Gate which uses the symbol as shown in Figure 3.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 3" src="/e14/assets/legacy/2018/diagram3_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;OR Symbol &amp;amp; Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 3: OR Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;The remaining logic gates are derivatives of the AND, OR, and NOT functions. However, the NAND and NOR gates have proven to be very popular due to their universality, which allows any logic gate&amp;mdash;AND, OR, NOT&amp;mdash;to be implemented using these two gates. We will look at exactly how we can do this in an example further on in this learning module.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5g9" class="xbold"&gt;- 4.4 NAND Gate&lt;/h3&gt;
&lt;p&gt;The simplest of the gates is the NAND gate, which stands for Not AND. This can be represented by an AND gate followed by a NOT gate. However, it is normally shown as an AND gate with an inversion bubble on its output.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 4" src="/e14/assets/legacy/2018/diagram4_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;NAND Symbol &amp;amp; Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 xbold text-white" style="background-color:#007fac;"&gt;Input A&lt;/th&gt;
&lt;th class="xs-border xs-p1 xbold text-white" style="background-color:#007fac;"&gt;Input B&lt;/th&gt;
&lt;th class="xs-border xs-p1 xbold text-white" style="background-color:#007fac;"&gt;Output&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 4: NAND Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5ga" class="xbold"&gt;- 4.5 NOR Gate&lt;/h3&gt;
&lt;p&gt;A similar logic gate is the NOR gate, which is also a universal gate and represents the NOT OR function. We represent the NOR symbol as the OR gate with an inversion bubble.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 5" src="/e14/assets/legacy/2018/diagram5_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;NOR Symbol and Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 5: NOR Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5gb" class="xbold"&gt;- 4.6 XOR and XNOR Gates&lt;/h3&gt;
&lt;p&gt;The final two gates are the XOR and XNOR gates, which are constructed from logic gates already introduced. However, they provide very useful functions allowing us to determine if both inputs agree (XNOR) or both inputs differ (XOR).&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 6" src="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;XOR Symbol &amp;amp; Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 6a: XOR Gate&lt;/h5&gt;
&lt;/center&gt;&lt;center&gt;
&lt;div class="xs-align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 6b" src="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;XNOR Symbol &amp;amp; Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 6b: XNOR Gate&lt;/h5&gt;
&lt;a name="sec5" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/center&gt;
&lt;h2 id="mcetoc_1i1b4hg5gc" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;5. Transistor Implementation of a Gate&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;As mentioned earlier in this learning module, each of the logic gates consists of several transistors arranged to implement the desired logic gate.&lt;/p&gt;
&lt;div class="xs-mr2" style="float:left;width:280px;"&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 7" src="/e14/assets/legacy/2018/diagram7_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 7: Transistor Level implementation of a NOT Gate&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;The simplest of these is the NOT gate, which uses two complementary transistors to invert the input at its output. When the Input is high, transistor Q1 is turned off thanks to the inversion, while transistor Q2 is turned on pulling the output to ground, which is the opposite of the presented signal. Conversely, when the input is low, transistor Q2 is this time turned off, while Q1 is turned on, pulling the output to the power rail and outputting a logic high.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
&lt;div class="xs-mr2" style="float:left;width:280px;"&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 8" src="/e14/assets/legacy/2018/diagram8_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 8: Transistor level implementation of a AND Gate&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;This NOT structure is also used in more complex gates such as the AND gate. Looking at the transistor level of the AND gate you will first notice the Output stage Q5 and Q6 is the same as for the NOT gate function.&lt;/p&gt;
&lt;p&gt;When inputs A and B are both high, transistors Q1 and Q2 are turned on while Q3 and Q4 are turned off. This pulls the input to Q6 and Q5 low, which due to the inversion means Q5 turns on and Q6 turns off allowing the output to be set high. For all other combinations at least one of Q1, Q2, Q3 and Q4 is turned off ,which pulls the input to Q5 and Q6 high, as such turning on Q6 and off Q5 pulling the output low as would be expected for an AND logic gate.&lt;a name="sec6" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5gd" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;6. Propagation Delay&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;When we implement logic circuits, using logic gates, we call these combinatorial logic circuits as there is no storage or feedback. To ensure these circuits function as intended we also, need to understand what occurs when an input changes. As just demonstrated, logic gates are made up from arrangements of switching transistors, and as such it takes time for a change at an input to result in a change of the output.&amp;nbsp; We call this delay the PROPAGATION time and it will vary depending upon the logic family used.&lt;/p&gt;
&lt;p&gt;To ensure we are all on the same page, there are several different logic families, each implemented in different underlying technologies such as CMOS (Complementary Metal Oxide Semi-conductor) or TTL (Transistor to Transistor Logic). Each logic family will exhibit a different propagation delay, which will limit the switching frequency of the logic design. If we are testing in the lab, we measure the propagation delay between the mid-point (50%) of the rising and falling edges as shown below.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 9a" src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:255px;"&gt;&lt;img loading="lazy" alt="diagram 9b" src="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4" /&gt;&lt;/div&gt;
&lt;h5&gt;Figure 9: Timing Diagram of NOT gate&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;The propagation time is normally defined within the data sheet for the logic gate selected; however, it will often list two propagation times: one for the high to low transition and another for the low to high transition.&amp;nbsp; Of course, the propagation time will also be affected by the ambient temperature, changes in power supply conditions, resistance of the driver, and the capacitive load on the device output.&lt;/p&gt;
&lt;p&gt;We call the output driving several devices inputs the FANOUT. The higher the fanout, the larger the loading, and, therefore, the slower the output rise and fall times. Typical values of propagation time in logic datasheets range from 5 ns to 35 ns, depending upon the logic family, minimum/maximum behavior, and loading conditions (FANOUT).&lt;/p&gt;
&lt;p style="clear:both;"&gt;When we develop our combinatorial circuit, which will typically consist of several levels of logic gates, due to the layer on gates, we need to be careful of the differing propagation delays, as differing propagation delays can lead to glitches in the output value which are not correct. This is one of the reasons that in many applications, combinatorial circuits are used with storage elements like D type flip flops and an associated clock to ensure the output does not glitch and is stable when it is presented to the next processing/decision element.&lt;/p&gt;
&lt;p&gt;However, if we are working purely with combinatorial circuits, we can also take some steps to mitigate these glitches, which are often referred to as RACE Hazards.&lt;a name="sec7" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5ge" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;7. Combinatorial Circuit Example&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;The best way to demonstrate how we can pull together what we have learned so far about Boolean Algebra, Logic Gates, Propagation Delays, and Hazards is to outline a few simple examples.&lt;/p&gt;
&lt;p&gt;For the first example, we will create a system which monitors three motors. Each motor has a health indication output which is high when the motor has a fault. For the overall system to function correctly, at least two of the motors must be working correctly, therefore, we will create a system that outputs a logic high when two out of the three motors have asserted their fault outputs.&lt;/p&gt;
&lt;p&gt;The first stage in developing this solution is to create a truth table that shows the possible input combinations and the correct output for each of those input conditions. As we have 3 inputs, then there are 2&lt;sup&gt;3&lt;/sup&gt; or eight possible combinations of the input:&lt;/p&gt;
&lt;div class="xs-mr5 xs-align-middle" style="float:left;width:310px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" width="30%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 10: Truth Table for the motor monitoring system&amp;#39;s logic function&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;From this truth table we can generate the following logic equations: &lt;strong&gt;OP = (A.B) + (A.C) + (B.C)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We call the format of this equation a SUM of PRODUCTS (SOP) equation as the OP is the Boolean SUM (Logical OR) of the Boolean PRODUCTS (AND) equations.&lt;/p&gt;
&lt;p&gt;If we so desired, we could calculate a PRODUCT of SUMS (POS) output by following the approach.&lt;/p&gt;
&lt;p&gt;Firstly, we create the SOP logic equation for each entry on the truth table where the output is low: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;OP&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;A.C&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B.C&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Next, we apply DeMorgan&amp;#39;s theorem to convert from the SOP to the POS format. The first step is to invert the SOP equation: &lt;img loading="lazy" alt="equation 1" src="/e14/assets/legacy/2018/PrgmLogicEQ1.png" /&gt;&lt;/p&gt;
&lt;p&gt;We can then apply DeMorgan&amp;#39;s theorem and the ninth law of logic to create the final POS equation: &lt;strong&gt;OP=(A+B).(A+C).(B+C)&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;"&gt;For the remainder of this example, however, we will work with the SOP format as that is the most common method for implementing logic functions. As such, we can realize our SOP equation using a two-level logic circuit as below:&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" class="nolightbox" alt="diagrm 11" src="/e14/assets/legacy/2018/diagram11_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 11: Example Logic Circuit in SOP form&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;With this two-level network, we need to consider the propagation delay through the first AND gate level and the impact it might have on the output.&lt;/p&gt;
&lt;p&gt;Of course, this implementation uses two logic gate types (AND, OR). But it is possible to implement the same logical function using only NAND gates, as they are universal.&amp;nbsp; Thanks to DeMorgan&amp;#39;s Theorem, the NAND gate also implements the Negative OR function: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 12" src="/e14/assets/legacy/2018/diagram12_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 12: Example Logic Circuit in SOP form implemented using NAND Gates&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;As such, we can redraw the logic circuit above.&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s look at how we get the same functionality using NAND gates. The output equation can be represented as: &lt;img loading="lazy" style="vertical-align:middle;" alt="equation 2" src="/e14/assets/legacy/2018/PrgmLogicEQ2.png" /&gt;&lt;/p&gt;
&lt;p&gt;Using DeMorgan&amp;#39;s Theorem, we can iterate through the following steps, changing the sign as we break the bar and applying other rules of Boolean algebra:&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" alt="equation 3" src="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2" /&gt;&lt;/center&gt;
&lt;p&gt;If we are working with POS logic equations, we can use NOR gates to implement the logic equation and prove the functionality the same way using DeMorgan&amp;#39;s Theorem and Boolean Algebra rules.&lt;/p&gt;
&lt;p&gt;In the example above, we used a truth table to determine the logic equations and it works well for a simple application. However, if we have more complex applications we need a better way of determining the logic equations. This is where the Karnaugh-map (Kmap) comes into play. Kmaps are visual representations of the logic behavior which allow us to use our natural ability for pattern recognition to determine the logic equations.&lt;/p&gt;
&lt;div class="xs-mr5 xs-align-middle" style="float:left;width:250px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;00&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;01&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;11&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;10&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 13: Example Karnaugh-map used for four variables (A,B,C,D). Note the gray scale count.&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;Karnaugh-maps are used by grouping together adjacent 1&amp;#39;s for SOP and adjacent 0&amp;#39;s for POS. These groupings can then be used to determine the logic equation, using the rules of Boolean Algebra to implement the desired functionality.&lt;/p&gt;
&lt;div class="xs-mr5" style="clear:both;float:left;width:300px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" width="25%"&gt;&lt;img loading="lazy" alt="ABBC image" src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;00&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;01&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;11&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 14: Example of a Karnaugh-map: Grouping the 1s together.&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;Often, if we use a Karnaugh-map, we will obtain an equation which uses the minimum number of logic gates to implement. Using the example to the left we can group together the 1&amp;#39;s within the design where they are adjacent to each other.&lt;/p&gt;
&lt;p&gt;The example groups together four 1&amp;#39;s within the center of the Karnaugh-map (highlighted green), and from this we can see that the logic equation is D.B as the C and A cancel each other out due to being across not C and C or not A and A, respectively.&lt;/p&gt;
&lt;p&gt;The blue elements in the corner can also be grouped together as they are also judged to be adjacent, since the Karnaugh-map is judged to wrap around edge to edge and top to bottom. As such, the second equation to be extracted from the Karnaugh-map is C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;; therefore, the resulting logic equation for the Karnaugh-map is: &lt;strong&gt;OP = C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + D.B&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We can also use Karnaugh-maps to identify hazards which might result in glitches during operation and help us eliminate them. In the next example, we can extract the logical equation for the green and blue cells as: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D&lt;/strong&gt;&lt;/p&gt;
&lt;div style="clear:both;float:left;padding:12px 10px 5px 0px;width:250px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png" data-e14adj="t"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;00&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;01&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;11&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;border-left:2px solid #D23620;border-right:2px solid #D23620;border-top:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;border-bottom:2px solid #D23620;border-left:2px solid #D23620;border-right:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 15: Karnaugh-maps: Identifying Potential Hazards&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;However, this leaves the equation highlighted by the red circle as a potential hazard, which occurs when the input D changes from a 1 to a 0. The output is intended to stay high; however, there is not a specific term in the logic equation to address it. To remove the hazard, we should update the logic equation. See in the additional equation where the red text is: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D + &lt;span style="color:#d23620;"&gt;&lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B.C.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By this point now you should be familiar with Boolean Algebra, logic gates, how they relate to each other, and how they are used with truth tables and Karnaugh-maps to not only determine logic equations but also to identify race conditions. You should also understand how we can use universal gates for implementing logic equations.&lt;/p&gt;
&lt;p style="clear:both;"&gt;With the basics of Boolean Algebra and logic gates introduced, we can focus now on how to create logical structures which can be used in applications. As such, we are going to explore Half and Full Adders along with the basics of synchronous logic design, using flip flops and their application, to help us create counters, shift registers, and state machines.&lt;a name="sec8" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5gf" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;8. Arithmetic in Logic&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;There are times in logic design when we want to perform mathematical operations such as Addition, Subtraction, Multiplication, and Division. While how we do this and number systems we use can be a course on its own, the Half and Full Adder are the key logic circuits we use to achieve these and should be introduced here.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5gg" class="xbold"&gt;- 8.1 Half Adder&lt;/h3&gt;
&lt;p&gt;The Half Adder is so called as it adds two input variables, generating a sum and carry outputs; it has no ability to accept a carry-in from a previous adder.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 16" src="/e14/assets/legacy/2018/diagram16_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle" style="display:inline-block;width:300px;"&gt;
&lt;table class="xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Carry&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5 style="clear:both;"&gt;Figure 16: Half Adder logic diagram and truth table&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5gh" class="xbold"&gt;- 8.2 Full Adder&lt;/h3&gt;
&lt;p&gt;The Full Adder provides the ability to accept a carry-in and is therefore used more commonly when working with multi-bit buses in logic.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:380px;"&gt;&lt;img loading="lazy" alt="diagram 17" src="/e14/assets/legacy/2018/diagram17_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle" style="display:inline-block;width:400px;"&gt;
&lt;table class="xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Carry In&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Carry Out&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 17: Full Adder logic diagram and truth table&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;Of course, like any logic circuits, there are variations optimized for different applications, including Ripple Carry Adder, Carry Look Ahead, and Carry Save Adders.&lt;/p&gt;
&lt;p&gt;We can also use the same adders for subtraction, if we use the twos complement number system to represent signed numbers.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5gi" class="xbold"&gt;- 8.3 Signed and Unsigned Number Systems&lt;/h3&gt;
&lt;p&gt;For those not familiar with signed and unsigned binary numbers, we&amp;#39;ll very briefly discuss them now. Simply stated, there are several number systems which allow us to represent both signed and unsigned number systems.&lt;/p&gt;
&lt;p&gt;Unsigned numbers are the simplest and we can represent a range of 0 to 2&lt;sup&gt;n&lt;/sup&gt;&amp;ndash;1, where n is the width of the bus. Unsigned numbers always represent positive numbers.&amp;nbsp; To represent signed numbers, we have a choice of several number systems, the most common being the Sign and Magnitude, Ones Complement, or Twos Complement.&lt;/p&gt;
&lt;p&gt;Sign and Magnitude utilizes the left most bit (often called the most significant bit) to represent the sign of the number (0 = positive, 1 = negative), and the remainder of the bits represent the magnitude.&lt;/p&gt;
&lt;p&gt;In the Sign and Magnitude system, both positive and negative numbers have the same magnitude; however, the sign bit differs. Due to this it is possible to have both a positive and negative zero within the Sign and Magnitude system.&lt;/p&gt;
&lt;p&gt;Ones Complement uses the same unsigned representation for positive numbers as the Sign and Magnitude representation. However, for negative numbers, the inversion (ones complement) of the positive number is used.&lt;/p&gt;
&lt;p&gt;Twos Complement is the most widely used encoding scheme for representing signed numbers. Just like Sign and Magnitude and Ones Complement schemes, positive numbers are represented in the same manner as an unsigned number. While negative numbers are represented as the binary number, you add to a positive number of the same magnitude to get zero. A negative twos complement number is calculated by first taking the ones complement (inversion) of the positive number and then adding one to it. The twos complement number system allows subtraction of one number from another by performing an addition of the two numbers. The range a twos complement number can represent is given by: &lt;strong&gt;-(2&lt;sup&gt;n-1&lt;/sup&gt;) to + (2&lt;sup&gt;n-1&lt;/sup&gt;&amp;ndash;1)&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;One method we can use to convert a number to its twos complement format is to work right to left, leaving the number the same until the first one is encountered; after this each bit is inverted.&lt;a name="sec9" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5gj" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;9. Sequential Circuits&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;Combinatorial logic circuits are unable to implement functions that require knowledge of their previous inputs or decisions as they contain no memory/storage elements.&lt;/p&gt;
&lt;p&gt;In contrast, sequential circuits&amp;#39; outputs are based upon not only current inputs but also previous inputs and decisions. Sequential logic circuits achieve this by using storage elements called flip flops, the simplest of which is the D Type flip flop. The value stored in the flip flop is updated at a regular interval as indicated by the clock signal.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-mr5 align-middle" style="display:inline-block;width:180px;"&gt;&lt;img loading="lazy" alt="diagram 18" src="/e14/assets/legacy/2018/diagram18_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle" style="display:inline-block;width:200px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" colspan="2"&gt;&lt;strong&gt;Inputs&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" colspan="2"&gt;&lt;strong&gt;Outputs&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;CK&lt;/td&gt;
&lt;td class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;D&lt;/td&gt;
&lt;td class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;Q&lt;/td&gt;
&lt;td class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;span style="text-decoration:overline;"&gt;Q&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;X&lt;/td&gt;
&lt;td class="xs-border xs-p1" colspan="2"&gt;No Change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 18: D Flip-flop and truth table&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;This ability to store states within our logic design allows more complex logic structures to be implemented. It also aids timing as the output of the combinatorial logic circuit must be stable just before the clock is applied to the Flip Flop to store the next value, thereby eliminating glitches. But as we will see this introduces more issues as well, especially when there are multiple layers of logic between flip flops.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5gk" class="xbold"&gt;- 9.1 Half Adder in a Synchronous Design&lt;/h3&gt;
&lt;p&gt;In this example, you can see the two-clock cycle delay between the application of an input and the generation of the output. The first clock cycle stores the inputs A and B in the first flip flops. The output of these flip flops will then be passed through the combinatorial logic, in this case, the half adder. The output of the half adder is then stored into the second rank of flip flops and output on the second clock cycle.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:350px;"&gt;&lt;img loading="lazy" alt="diagram 19a" src="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3" /&gt;
&lt;h5&gt;Figure 19a: Example Half Adder in a synchronous design (clock is shown in orange).&lt;/h5&gt;
&lt;/div&gt;
&lt;div class="align-middle" style="display:inline-block;"&gt;&lt;img loading="lazy" alt="diagram 19b" src="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4" /&gt;
&lt;h5&gt;Figure 19b: Timing Diagram for the example Half Adder in a synchronous design above.&lt;/h5&gt;
&lt;/div&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5gl" class="xbold"&gt;- 9.2 Shift Registers and Counters&lt;/h3&gt;
&lt;p&gt;The three most commonly implemented sequential logic design structures are shift registers, counters, and state machines.&lt;/p&gt;
&lt;p&gt;Shift registers in their basic form are a collection of Flip Flops where the output of one flip flop feeds the input of the next flip flop. Signals are then progressed through the shift register on each clock. We can use shift registers for a range of things in our logic design from delays (although there are better ways to implement delays) to metastability synchronizers, as well as conversion between serial and parallel and the generation of random numbers using feedback correctly.&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" alt="diagram 20" src="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2" /&gt;
&lt;h5&gt;Figure 20: Shift Register and associated timing diagram.&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;In many designs, we need to time events or introduce delays between the generation or issuing of signals. We do this by using a counter. In this application, we use the flip flops to store the count and combinatorial logic to determine the next value of the count based upon the current value.&lt;/p&gt;
&lt;div class="xs-mr3" style="float:left;width:260px;"&gt;&lt;img loading="lazy" alt="diagram 21" src="/e14/assets/legacy/2018/diagram21_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 21: Four-bit counter state diagram&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;The first stage in the development of a counter is to create a simple state diagram which shows the counter behavior.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
&lt;div class="xs-mr3" style="float:left;width:320px;"&gt;
&lt;table class="xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Present A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Present B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Next A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Next B&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 22: Present State, Next State Table for the counter&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;Once the state diagram is created, we can then create a present state, next state table and extract from it the logic equations to implement the counter. Of course, while the example counts in sequential binary, if we desired, we could have the counter count in gray code, etc.&lt;/p&gt;
&lt;p&gt;With the present state, next state table (PS, NS) created, we can then create the logic equations needed to create in combinatorial logic. If necessary we can use Karnaugh-maps, etc. However, for this simple example we can work directly from the present state, next state table.&lt;/p&gt;
&lt;p&gt;With the PS, NS table, we create a logic equation for each of the next states, e.g. next A. As such the equations are: &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;Next A = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;Next B = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;From these equations we can generate the logic circuit which contains the D Type flip flops and logic gates.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:300px;"&gt;&lt;img loading="lazy" alt="diagram 23a" src="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:300px;"&gt;&lt;img loading="lazy" alt="23b" src="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;h5&gt;Figure 23: Logic Design for a two-bit counter.&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;Along with counters, logic designs are often called upon to perform sequence and control-based actions. These actions and sequences are best addressed using a state machine.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5gm" class="xbold"&gt;- 9.3 State Machines&lt;/h3&gt;
&lt;p&gt;State machines are logical constructs that transition between a finite number of states, like a counter; however, the path through the states is not sequential. A state machine will only be in one state at a point in time. It will transition between states depending upon several triggers, e.g. inputs or counter values, etc.&lt;/p&gt;
&lt;p&gt;Theoretically, state machines are divided into two basic classes: Moore and Mealy. They differ only in how the state machine&amp;#39;s outputs are generated.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Moore:&lt;/strong&gt; State Machine outputs are a function of the present state only. A classic example is a counter.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mealy:&lt;/strong&gt; State Machine outputs are a function of the present state and inputs. A classic example is the &lt;a class="jive-link-external-small" href="http://en.wikipedia.org/wiki/Richards_controller" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;Richards Controller&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When we are faced with the task of defining a state machine, we will develop a state diagram as we would do for a counter. The state diagram shows the states, inputs, and the transitions between the states and the outputs from the state machine. Figure 24 demonstrates the two types of state diagrams: one for a Moore State Machine (left), the other a Mealy State Machine (right).&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:200px;"&gt;&lt;img loading="lazy" alt="diagram 24a" src="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:200px;"&gt;&lt;img loading="lazy" alt="diagram 24b" src="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;h5&gt;Figure 24: State Diagrams for a Moore (left) and Mealy (right) State Machine.&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;If we were to implement these in logic gates and flip flops we would generate a present state, next state table, as we did for the previous counter example, and then create the logic equations for each of the state variables. The only difference is that, along with the current state, the present state, next state table will also have to consider the inputs and outputs for the state machine.&lt;a name="sec10" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5gn" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;10. Programmable Logic with FPGAs&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;So far, we have looked at how we create logic designs and implement them with discrete logic gates and flip flops. However, the most common way of implementing a logic design is using a programmable logic device (PLD) such as a Complex Programmable Logic Device (CPLD) or a Field Programmable Gate Array (FPGA). These devices enable the implementation of large logic designs and, depending upon the technology of the device used, they can be reprogrammed in the field.&lt;/p&gt;
&lt;p&gt;Programmable logic devices are available in three different technologies:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SRAM:&lt;/strong&gt; The FPGA program is stored in an external memory and loaded into the FPGA each time it is powered.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;FLASH:&lt;/strong&gt; The FLASH architecture of the FPGA also contains the program; no external memory device is needed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One Time Programmable (OTP):&lt;/strong&gt; The FPGA is applied by blowing fuses in the device. Once programmed, it cannot be modified.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Typically, SRAM-based programmable logic is used where high performance is required, while Flash-based devices are used in middle-to-low performance applications. While one time programmable devices are very limited in application, they still remain popular in space applications.&lt;/p&gt;
&lt;p&gt;The key to programmable logic is how logic equations are implemented in the device. It is of course very difficult for the device designers to include a range of AND, OR gates, etc. as the number of each gate type will vary with each application. This will result in either many unused gates or a shortage of a needed gate type. Either way it would not be an efficient method for the implementation of a programmable logic device.&lt;/p&gt;
&lt;p&gt;Device manufacturers addressed this challenge in a very smart manner. In place of discrete gates, they use a several input look up table (LUT) which is programmed to implement the combinatorial logic equations. In many respects, this LUT is very similar to a multiplexer. Let&amp;#39;s take a quick look at how we can use a LUT to implement logic equations.&lt;/p&gt;
&lt;p&gt;Using the same truth table as for the previous example, we can set the LUT inputs to either ground or VCC depending upon the truth table&amp;#39;s needs. We can then use the logic equation inputs (A,B,C) to drive the LUT selection inputs to output the correct value for that particular input combination implementing the desired logic equation.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 25" src="/e14/assets/legacy/2018/diagram25_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:320px;"&gt;
&lt;table class="xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" width="25%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 25: Setting the LUT&amp;#39;s Inputs to the Truth Table&lt;/h5&gt;
&lt;/center&gt;
&lt;p style="clear:both;"&gt;Using a LUT inside our programmable device therefore provides the best flexibility to implement a wide range of logic equations.&lt;/p&gt;
&lt;p&gt;Of course, we do not want to just implement the combinatorial logic circuits. We also want to implement sequential structures. This means that following the LUT there needs to be a flip flop to act as storage for the combinatorial output such that we can implement sequential structures.&lt;/p&gt;
&lt;p&gt;This combination of a LUT and Flip Flop is often called a Configurable Logic Block (CLB). A programmable logic device will consist of many thousands of CLBs. To provide the most flexibility, additional multiplexers will be used to support a wide range of CLB configurations.&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 26" src="/e14/assets/legacy/2018/diagram26_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 26: Very Basic Logic Slice&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;Obviously, modern devices have very complex CLB structures, which include local memory, fast carry inputs, arithmetic functions, and shift registers.&lt;/p&gt;
&lt;p&gt;Of course, these CLB&amp;#39;s need to be interconnected, which is where the device interconnect comes in, which allows the output of one CLB to be connected to the input of another CLB and eventually to the Input/Output of the device.&lt;/p&gt;
&lt;p&gt;This routing can be considered at two elements. First, there is global routing, which distributes global signals such as clocks. These are global specialist routing networks designed to be low skew and support high fan outs. This dedicated clocking network might be further split between truly global routes across the device and several additional regional limited routes to a specific area of the device. For all other signals, the programmable interconnect is used, which connects the CLBs to each other and other specialist functions within the device. To connect CLBs together it uses a switch matrix, which is configured to provide the internal routing between CLBs.&lt;/p&gt;
&lt;p&gt;One of the key drivers of programmable logic technology development was the reduction in the cost of transistors.&amp;nbsp; However, interconnect wires also played a role in enabling much larger devices at reduced cost.&amp;nbsp; When we develop programmable logic applications we spend a lot of time and effort optimizing the performance of the design with regards to its routing to ensure we can operate at the desired clock frequency.&lt;/p&gt;
&lt;div class="xs-mr3" style="float:left;width:300px;"&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 27" src="/e14/assets/legacy/2018/diagram27_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 27: CLB and Routing matrix&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;To get signals on and off the chip, programmable logic devices also provide IO cells, which are configurable. These enable the device to support a range of single-ended logic standards, e.g. LVCMOS2v4, LVCOM 1V5, etc., Stub Series Terminated Logic (SSTL) as used for High Speed DDR interfaces, and a range of differential standards, including Low Swing Differential Voltage Signaling (LVDS).&lt;/p&gt;
&lt;p&gt;Many devices also include complex structures in the IO cells to allow for double data rate signals, source synchronous designs, bus skew correction, and conversion to/from serial. Electrically, the IO can control slew rates, drive strengths and even match the impedance with the transmission line, all of which are controlled by the developer. This means that given the right PHY on the board, using programmable logic, we can achieve any-to-any interconnectivity.&lt;a name="sec11" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5go" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;11. Hardware Description Languages&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;Thanks to the sheer scale of resources offered by programmable logic we cannot any longer design at the gate level like we have done previously. It would simply take too long to develop applications which can leverage the resources provided by the programmable device at the gate level. In the place of developing by using logic equations, we use Hardware Description languages (HDL) such as Verilog or VHDL.&lt;/p&gt;
&lt;p&gt;When we work with these languages, we do not describe the logic equations, but rather the desired behavior at the register transfer level (RTL). This allows us to define the functionality of the programmable logic device.&lt;/p&gt;
&lt;p&gt;How our description gets translated from our HDL file into the logic equations and implemented in the programmable logic device requires several stages.&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5 xs-mb5" style="clear:both;"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Synthesis&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;The conversion of the HDL file into logic equations often targeted at the specific resources of the programmable logic device.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="xs-border xs-p1 xs-text-5 xs-mb5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="text-white xs-border xs-p1" style="background-color:#f17c0e;"&gt;&lt;strong&gt;Placing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;Placing of the identified logic cells (LUT, Flip Flops, etc.) into the programmable logic CLBs.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="xs-border xs-p1 xs-text-5 xs-mb5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="text-white xs-border xs-p1" style="background-color:#003082;"&gt;&lt;strong&gt;Routing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;Connecting together the placed CLBs to achieve the required performance.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 28: Stages to Convert HDL File into Logic Equations&lt;/h5&gt;
&lt;p&gt;Each stage often requires addition constraints to ensure the desired timing is achieved or the correct IO standards are used.&lt;/p&gt;
&lt;p&gt;What developers who are used to using VHDL and Verilog will be familiar with is that not all constructs / commands within a language can be synthesized. Therefore, there is only a subset of language commands and coding structures which can be synthesized into a programmable logic device successfully. The remaining elements of the HDL language which are not synthesizable are used in the verification of the design before we implement it in the device.&lt;/p&gt;
&lt;p&gt;This verification is called the development of a test bench which ensures the Unit Under Test (UUT) meets its specification and is suitable for its intended purpose. When it comes to test benching, we have a couple of choices as to how we perform it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Functional Simulation only:&lt;/strong&gt; This checks if the design is functionally correct.&amp;nbsp; It does not include internal device timing delays such as propagation delays, which may affect performance when implemented in the device.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Gate Level Simulation:&lt;/strong&gt; This verifies the functionality of the design when back annotated with timing information from the final implemented design. This can take considerable time to perform.&lt;/li&gt;
&lt;/ul&gt;
&lt;center&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 29" src="/e14/assets/legacy/2018/diagram29_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 29: Example Test Bench architecture&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;Let&amp;#39;s look at how we would implement a state machine using the VHDL Language. Learning VHDL itself is a short course; however, we can briefly introduce the basics here.&lt;/p&gt;
&lt;p&gt;A VHDL file is split into two distinct elements, the entity and the architecture. The entity defines the input and outputs of the VHDL module and if it is at the top level of the design. It represents the inputs and outputs of the programmable logic device itself.&lt;/p&gt;
&lt;p&gt;The architecture defines the functionality and consists of either sequential statements, which are all executed in parallel or processes.&lt;/p&gt;
&lt;p&gt;Processes execute sequentially from top to bottom, more like in a traditional programming application. However, there are rules around when signals update during the process. Additionally, each process in the architecture runs in parallel as you are describing logic functions.&lt;/p&gt;
&lt;table style="clear:both;" width="100%"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="padding-right:15px;"&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;; &lt;br /&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state only&lt;/span&gt; &lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;; &lt;br /&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state and inputs&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;center&gt;
&lt;h5&gt;Figure 30: VHDL Architecture which shows the implementation of the state machines in the above example&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;In the above example, the process runs each time the clock or reset is changed. This is defined in the sensitivity list of the process declaration.&lt;/p&gt;
&lt;p&gt;In these examples, the reset is asynchronous and used to reset the current state and the output, while the next actions only occur following the rising edge of the clock. Where the state machine progresses through each state depends upon its inputs and current state, moving if necessary to the next state.&lt;/p&gt;
&lt;p&gt;What this demonstrates is that, using programmable logic and HDL, we can directly code the state machine or counter from the state diagram and without the need to create the logic equations. Indeed, we let the synthesis tool do that for us.&lt;/p&gt;
&lt;center&gt;
&lt;h5 style="clear:both;"&gt;*Trademark. &lt;strong&gt;Xilinx is a trademark of AMD Corp.&lt;/strong&gt; Other logos, product and/or company names may be trademarks of their respective owners.&lt;/h5&gt;
&lt;/center&gt;&lt;center&gt;
&lt;p class="xs-border-bottom xs-pb2"&gt;Shop our wide range of &lt;strong&gt;FPGAs, SoCs, EVMs, application specific kits, embedded development boards, and more.&amp;nbsp;&lt;span &gt;&lt;a class="e14-button e14-button--primary e14-button--large" href="https://referral.element14.com/OrderCodeView?url=%2Fsearch%3Fst%3Damd%2520programmable%2520logic&amp;COM=e14c-essentials-prgmdevice1-doc&amp;CMP=e14c-essentials-prgmdevice1-doc&amp;osetc=e14c-essentials-prgmdevice1-doc" title="Shop Now" title="Shop Now" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;h2 id="mcetoc_1i1b4hg5gp" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;&lt;a name="test" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;Test Your Knowledge&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;div class="xs-float-left xs-mr2 xs-b2"&gt;            
&lt;style&gt;
   .e14-achievement-name{font-size:14px;font-weight:700;text-align:center;height:40px;margin:0;padding:5px}.e14-avatar{width:50% !important;margin:auto;border-radius:500px}.e14-avatar img{border-radius:543px}.e14-progress-bar{height:12px;border-radius:6px;background-clip:padding-box;background:#3575c2}.e14-achievement-thumb{height:200px}.e14-achievement-criteria{font-size:10px !important;overflow:hidden;margin-bottom:10px;line-height:1.5;height:60px}.e14-achievement-criteria p{font-size:10px !important;overflow:hidden;margin-bottom:10px;line-height:1.5;height:60px}.e14-achievement-criteria.complete{height:38px}.e14-achievement-criteria.complete p{height:38px}.e14-greyout{-webkit-filter:grayscale(90%);-moz-filter:grayscale(90%);-o-filter:grayscale(90%);-ms-filter:grayscale(90%);filter:grayscale(90%)}.e14-complete{float:right;margin-top:-20px;padding-right:5px;margin-bottom:12px;font-weight:700;color:dimgray}.e14-achievement-status{margin:5px}.shimmer{position:relative;overflow:hidden;background:#f6f7f8;background:linear-gradient(-45deg,#eee 40%,#fafafa 50%,#eee 60%);background-size:300%;background-position-x:100%;animation:shimmer 8s infinite linear}@keyframes shimmer{0%{background-position:-1000px 0}
100%{background-position:1000px 0}}
@media only screen and (max-width:480px){.e14-achievement-criteria{display:none}.e14-complete{font-size:9px}.e14-user-achievement{width:100px !important;height:150px !important}.e14-achievement-status{margin-top:15px}.e14-achievement-thumb{height:130px}.e14-achievement-name{font-size:10px}} 
&lt;/style&gt;

    &lt;div id="embed-f00e71d57f6b42ba9564a085c0480d7a_thumbnails" data-columnclass="thumbnail-column"&gt;
        &lt;div class="content thumbnail e14-user-achievement" data-href="/achievements/241fc2d8-ae75-4111-8616-7ed062a852fa" style="border: 3px solid #8d8d8d;cursor: pointer;"&gt;
        	       &lt;h2 class="name e14-achievement-name"&gt;
    		            Programmable Device 1&lt;br&gt;
    		       &lt;/h2&gt;
    			&lt;div class="e14-avatar e14-greyout"&gt;
    				&lt;img loading="lazy" src="https://community-storage.element14.com/communityserver-components-imagefileviewer/achievements/241fc2d8ae75411186167ed062a852fa/Programmable%20Device%201.png-140x140x2.png?_=9b9y946HOQq0GkkO1wsnuA==" style="width: 140px;max-height:140px;overflow:hidden;background:url(&amp;#39;https://community-storage.element14.com/communityserver-components-imagefileviewer/achievements/241fc2d8ae75411186167ed062a852fa/Programmable%20Device%201.png-140x140x2.png?_=9b9y946HOQq0GkkO1wsnuA==&amp;#39;) center center no-repeat;background-size:cover;aspect-ratio:140/140" alt="Programmable Device 1" border="0" /&gt;
    		    &lt;/div&gt;
    		    &lt;div style="padding:5px;"&gt;
    		        &lt;div title="Complete our Essentials: Programmable Device 1 course, earn 100% on the quiz and give the page a star rating to earn this badge!" class="e14-achievement-criteria"&gt;Complete our Essentials: Programmable Device 1 course, earn 100% on the quiz and give the page...&lt;/div&gt;
    		        
    		    &lt;/div&gt;
    		&lt;/div&gt;
    &lt;/div&gt;   
&lt;/script&gt;&lt;/div&gt;
&lt;p&gt;Are you ready to demonstrate your Essentials of Programmable Logic knowledge? &lt;strong&gt;Then take a quick 15-question, multiple-choice quiz to see how much you&amp;#39;ve learned from this Programmable Devices module.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To earn the Programmable Devices I Badge&lt;/strong&gt;, read through the module to learn all about Programmable Logic, attain 100% in the quiz at the bottom, and leave us some feedback in the comments section.&lt;/p&gt;
&lt;p&gt;&lt;div class="voltquiz" data-formid="0fcd3450-c4f3-4322-8af1-4b03e66c0ed0" data-formtype="quiz" data-success-message="" data-fail-message="" data-pass-mark="OTk=" &gt;&lt;/div&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="e14-quiz-document-metadata e14-init-hidden"&gt;&lt;/div&gt;
&lt;h5&gt;&lt;a href="/learn/learning-center/online-learning/essentials/" data-icid="essentials-programdevice1-doc" data-e14adj="t"&gt;&lt;img loading="lazy" class="xs-align-middle xs-mr5" alt="essentials logo" src="/e14/assets/legacy/2017/learningess.png" width="175px" /&gt;&lt;/a&gt; Sponsored by &lt;a href="/products/manufacturers/amd" data-icid="essentials-programdevice1-doc" data-e14adj="t"&gt;&lt;img loading="lazy" class="essSponsor xs-align-middle xs-ml2 xs-mr5" title="AMD" alt="amd Logo" src="/e14/assets/main/mfg-group-assets/xilinxLogo.png" width="100px" /&gt;&lt;/a&gt;&lt;/h5&gt;
&lt;p&gt;&lt;div class="e14-navigation-buttons"&gt;&lt;a href="/learn/learning-center/essentials?ICID=essentials-programdevice1-doc"&gt;
                    &lt;button class="e14-nav-button-prev"&gt;Previous&lt;/button&gt;
                &lt;/a&gt;&lt;a href="/learn/learning-center/essentials/w/documents/4109/programmable-socs?ICID=essentials-programdevice1-doc"&gt;
                    &lt;button class="e14-nav-button-next"&gt;Next&lt;/button&gt;
                &lt;/a&gt;&lt;/div&gt;&lt;script&gt;e14.func.queueScripts.add(function(){ e14.func.repositionNavButtons(); })&lt;/script&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: fpga_essentials, programmable_devices, xilinx_essentials, xilinx, fpga, programmable_device, programmable_logic, ess_module&lt;/div&gt;
</description></item><item><title>Programmable Devices: Programmable Logic</title><link>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic/revision/8</link><pubDate>Wed, 26 Jun 2024 21:27:17 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:722dc523-e66e-42a7-84b5-de3f2731c4d8</guid><dc:creator>pchan</dc:creator><comments>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic#comments</comments><description>Revision 8 posted to Documents by pchan on 6/26/2024 9:27:17 PM&lt;br /&gt;
&lt;p&gt;&lt;a name="top" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt; &lt;img class="nolightbox essProfile xs-float-left xs-pr2 xs-pb2" alt="Profile image" height="115" src="/e14/assets/legacy/2018/PrgmLogic_profile.png" /&gt;&lt;/p&gt;
&lt;p&gt;The world and our interaction with it is analog. Our surrounding environment, colors in the electromagnetic spectrum, speech, and sound all are represented by continuously changing analog values. When it comes to processing these analog signals, however, digital systems offer several benefits to a traditional analog processing solution. For example, they have higher performance, ease of storage and transmission, and better noise immunity. As such, while the world is analog, it is mainly processed digitally using logic circuits. In this learning module, you will be introduced to the essentials of logic design, and how it can be implemented using programmable logic.&lt;br /&gt; &lt;a class="xbold" href="/w/documents/3803/related-components-dev-boards-for-element14-essentials-programmable-devices-i" data-icid="essentials-programdevice1-doc" data-e14adj="t"&gt;Related Components &amp;amp; Dev Boards&lt;/a&gt; | &lt;a class="xbold" href="#test" data-e14adj="t"&gt;Test Your Knowledge &lt;i class="text-orange xs-ml05 fas fa-caret-right"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="xs-clear"&gt;&lt;a name="object" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2 id="mcetoc_1i1b4hg5f0" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;2. Objectives&lt;/h2&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;&lt;em&gt;Upon completion of this module, you will be able to:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Perform some fundamental operations of Boolean algebra&lt;/li&gt;
&lt;li&gt;Explain the operation and truth tables of common logic gates&lt;/li&gt;
&lt;li&gt;Illustrate how combinatorial circuits are designed&lt;/li&gt;
&lt;li&gt;Discuss the differences between combinatorial and sequential circuits&lt;/li&gt;
&lt;li&gt;Understand how shift registers, counters, and state machines operate&lt;/li&gt;
&lt;li&gt;Explain the basic structures of PLDs&lt;/li&gt;
&lt;li&gt;Describe the role of HDLs&lt;a name="sec3" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1i1b4hg5f1" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;3. Boolean Algebra&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;The key foundation of digital logic is Boolean Algebra. Without understanding it we cannot produce effective logic designs or understand the outputs of higher level tools such as synthesis engines.&lt;/p&gt;
&lt;p&gt;Boolean algebra is named after its inventor, George Boole, who in 1854 published his work entitled, &amp;quot;An investigation of the laws of thought on which are founded the mathematical theories of logic and probabilities.&amp;quot; This work was later used by Claude Shannon in his 1937 master&amp;#39;s thesis at MIT entitled, &amp;quot;A Symbolic Analysis of Relay and Switching Circuits,&amp;quot; which demonstrated that switching circuits could solve all problems in the same manner as Boolean algebra. Thus, the relationship between switching circuits and Boolean algebra became the foundation of all digital applications.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5f2" class="xbold"&gt;- 3.1 Boolean Addition and Multiplication&lt;/h3&gt;
&lt;center&gt;
&lt;p&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1+0=1&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+1=1&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1+1=1&lt;/strong&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p&gt;As you can see, the result of the SUM is equal to one only when one or more of the literals is one.&lt;/p&gt;
&lt;p&gt;Boolean multiplication produces the PRODUCT of the literals:&lt;/p&gt;
&lt;center&gt;
&lt;p&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.1=0&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1.1=1&lt;/strong&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p&gt;In this case, you can see the PRODUCT is equal to one only when both literals are equal to one.&lt;/p&gt;
&lt;p&gt;Understanding the meaning of the SUM and PRODUCT terms will be important later when we examine logic gates and equations.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5f3" class="xbold"&gt;- 3.2 Boolean Algebra Laws&lt;/h3&gt;
&lt;p&gt;Just as in other areas of mathematics, Boolean algebra has several laws which we must understand, such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Commutative Law:&lt;/strong&gt; The order of literals in Boolean addition does not affect the result: A+B=B+A&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Associative Law:&lt;/strong&gt; When performing Boolean addition of more than two literals, the result is the same regardless of grouping:&amp;nbsp; A+(B+C)=(A+B)+C&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Distributive Law:&lt;/strong&gt; Performing a Boolean addition of two or more literals before performing a Boolean multiplication on the result is the same as performing the Boolean multiplication with each literal before performing the Boolean Addition A(B+C)=AB+AC&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These laws become very important when we design logic circuits and wish to optimize the number of logic gates we use in our solution.&lt;/p&gt;
&lt;p&gt;Along with these laws we also have twelve rules of Boolean Logic with which we must become familiar. They are:&lt;/p&gt;
&lt;center&gt;
&lt;table class="xs-border; xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" colspan="2"&gt;&lt;strong&gt;12 Boolean Logic Rules&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A + 0 = A&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;A . A = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A + 1 = 1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;A . &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A . 0 = 0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;a href="/e14/assets/legacy/2018/A2bars.png" data-e14adj="t"&gt;&lt;img loading="lazy" alt="a2 bars" src="/e14/assets/legacy/2018/A2bars.png" /&gt;&lt;/a&gt; = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A . 1 = A&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;A + A.B = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A + A = A&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B = A + B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;(A + B).(A+C) = A + B.C&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5f4" class="xbold"&gt;- 3.3 DeMorgan&amp;#39;s Theorem&lt;/h3&gt;
&lt;p&gt;The final remaining element we need to understand about Boolean Algebra is DeMorgan&amp;#39;s Theorem which states, &amp;quot;The complement of a product of sums is equal to the sum of the complements.&amp;quot;&lt;/p&gt;
&lt;p&gt;This is better shown represented as an equation: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A good mnemonic device to remember this is: &amp;quot;break the bar, change the sign.&amp;quot;&lt;/p&gt;
&lt;p&gt;Of course, now that we understand Boolean algebra, we want to be able to see how it maps to the logic gates we use to implement digital circuits.&lt;a name="sec4" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5f5" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;4. Logic Gates&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;The seven commonly used logic gates in digital design are NOT, AND, OR, XOR, NOR, NAND and XNOR gates. In our designs we use combinations of these logic gates to implement the logic function. In this section, we&amp;#39;ll review these logic gates.&lt;/p&gt;
&lt;p&gt;At the lowest level these logic gates are made from arrangements of transistors; however, each arrangement has its own symbol and truth table, which shows for a given input what its outputs will be. (Note: For simplicity&amp;#39;s sake, except for the NOT gate, all gates are demonstrated with two inputs).&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5f6" class="xbold"&gt;- 4.1 NOT Gate&lt;/h3&gt;
&lt;p&gt;The simplest of the logic gates is the NOT gate. This gate simply inverts the logic value presented on the input.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-pr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 1" src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:200px;"&gt;
&lt;p class="xbold"&gt;NOT symbol &amp;amp; truth table&lt;/p&gt;
&lt;table class="xs-border xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 1: NOT Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5g7" class="xbold"&gt;- 4.2 AND Gate&lt;/h3&gt;
&lt;p&gt;One of the most commonly used logic gates is the AND gate, which implements Boolean algebra multiplication and produces the PRODUCT of its inputs as we described earlier in this learning module.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-align-middle xs-mr2" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 2" src="/e14/assets/legacy/2018/diagram2_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p&gt;&lt;strong&gt;AND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table class="xs-border xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 2: AND Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5g8" class="xbold"&gt;- 4.3 OR Gate&lt;/h3&gt;
&lt;p&gt;To implement Boolean addition and generate the SUM of its inputs, we use the OR Gate which uses the symbol as shown in Figure 3.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 3" src="/e14/assets/legacy/2018/diagram3_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;OR Symbol &amp;amp; Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 3: OR Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;The remaining logic gates are derivatives of the AND, OR, and NOT functions. However, the NAND and NOR gates have proven to be very popular due to their universality, which allows any logic gate&amp;mdash;AND, OR, NOT&amp;mdash;to be implemented using these two gates. We will look at exactly how we can do this in an example further on in this learning module.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5g9" class="xbold"&gt;- 4.4 NAND Gate&lt;/h3&gt;
&lt;p&gt;The simplest of the gates is the NAND gate, which stands for Not AND. This can be represented by an AND gate followed by a NOT gate. However, it is normally shown as an AND gate with an inversion bubble on its output.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 4" src="/e14/assets/legacy/2018/diagram4_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;NAND Symbol &amp;amp; Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 xbold text-white" style="background-color:#007fac;"&gt;Input A&lt;/th&gt;
&lt;th class="xs-border xs-p1 xbold text-white" style="background-color:#007fac;"&gt;Input B&lt;/th&gt;
&lt;th class="xs-border xs-p1 xbold text-white" style="background-color:#007fac;"&gt;Output&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 4: NAND Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5ga" class="xbold"&gt;- 4.5 NOR Gate&lt;/h3&gt;
&lt;p&gt;A similar logic gate is the NOR gate, which is also a universal gate and represents the NOT OR function. We represent the NOR symbol as the OR gate with an inversion bubble.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 5" src="/e14/assets/legacy/2018/diagram5_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;NOR Symbol and Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 5: NOR Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5gb" class="xbold"&gt;- 4.6 XOR and XNOR Gates&lt;/h3&gt;
&lt;p&gt;The final two gates are the XOR and XNOR gates, which are constructed from logic gates already introduced. However, they provide very useful functions allowing us to determine if both inputs agree (XNOR) or both inputs differ (XOR).&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 6" src="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;XOR Symbol &amp;amp; Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 6a: XOR Gate&lt;/h5&gt;
&lt;/center&gt;&lt;center&gt;
&lt;div class="xs-align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 6b" src="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;XNOR Symbol &amp;amp; Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 6b: XNOR Gate&lt;/h5&gt;
&lt;a name="sec5" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/center&gt;
&lt;h2 id="mcetoc_1i1b4hg5gc" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;5. Transistor Implementation of a Gate&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;As mentioned earlier in this learning module, each of the logic gates consists of several transistors arranged to implement the desired logic gate.&lt;/p&gt;
&lt;div class="xs-mr2" style="float:left;width:280px;"&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 7" src="/e14/assets/legacy/2018/diagram7_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 7: Transistor Level implementation of a NOT Gate&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;The simplest of these is the NOT gate, which uses two complementary transistors to invert the input at its output. When the Input is high, transistor Q1 is turned off thanks to the inversion, while transistor Q2 is turned on pulling the output to ground, which is the opposite of the presented signal. Conversely, when the input is low, transistor Q2 is this time turned off, while Q1 is turned on, pulling the output to the power rail and outputting a logic high.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
&lt;div class="xs-mr2" style="float:left;width:280px;"&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 8" src="/e14/assets/legacy/2018/diagram8_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 8: Transistor level implementation of a AND Gate&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;This NOT structure is also used in more complex gates such as the AND gate. Looking at the transistor level of the AND gate you will first notice the Output stage Q5 and Q6 is the same as for the NOT gate function.&lt;/p&gt;
&lt;p&gt;When inputs A and B are both high, transistors Q1 and Q2 are turned on while Q3 and Q4 are turned off. This pulls the input to Q6 and Q5 low, which due to the inversion means Q5 turns on and Q6 turns off allowing the output to be set high. For all other combinations at least one of Q1, Q2, Q3 and Q4 is turned off ,which pulls the input to Q5 and Q6 high, as such turning on Q6 and off Q5 pulling the output low as would be expected for an AND logic gate.&lt;a name="sec6" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5gd" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;6. Propagation Delay&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;When we implement logic circuits, using logic gates, we call these combinatorial logic circuits as there is no storage or feedback. To ensure these circuits function as intended we also, need to understand what occurs when an input changes. As just demonstrated, logic gates are made up from arrangements of switching transistors, and as such it takes time for a change at an input to result in a change of the output.&amp;nbsp; We call this delay the PROPAGATION time and it will vary depending upon the logic family used.&lt;/p&gt;
&lt;p&gt;To ensure we are all on the same page, there are several different logic families, each implemented in different underlying technologies such as CMOS (Complementary Metal Oxide Semi-conductor) or TTL (Transistor to Transistor Logic). Each logic family will exhibit a different propagation delay, which will limit the switching frequency of the logic design. If we are testing in the lab, we measure the propagation delay between the mid-point (50%) of the rising and falling edges as shown below.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 9a" src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:255px;"&gt;&lt;img loading="lazy" alt="diagram 9b" src="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4" /&gt;&lt;/div&gt;
&lt;h5&gt;Figure 9: Timing Diagram of NOT gate&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;The propagation time is normally defined within the data sheet for the logic gate selected; however, it will often list two propagation times: one for the high to low transition and another for the low to high transition.&amp;nbsp; Of course, the propagation time will also be affected by the ambient temperature, changes in power supply conditions, resistance of the driver, and the capacitive load on the device output.&lt;/p&gt;
&lt;p&gt;We call the output driving several devices inputs the FANOUT. The higher the fanout, the larger the loading, and, therefore, the slower the output rise and fall times. Typical values of propagation time in logic datasheets range from 5 ns to 35 ns, depending upon the logic family, minimum/maximum behavior, and loading conditions (FANOUT).&lt;/p&gt;
&lt;p style="clear:both;"&gt;When we develop our combinatorial circuit, which will typically consist of several levels of logic gates, due to the layer on gates, we need to be careful of the differing propagation delays, as differing propagation delays can lead to glitches in the output value which are not correct. This is one of the reasons that in many applications, combinatorial circuits are used with storage elements like D type flip flops and an associated clock to ensure the output does not glitch and is stable when it is presented to the next processing/decision element.&lt;/p&gt;
&lt;p&gt;However, if we are working purely with combinatorial circuits, we can also take some steps to mitigate these glitches, which are often referred to as RACE Hazards.&lt;a name="sec7" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5ge" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;7. Combinatorial Circuit Example&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;The best way to demonstrate how we can pull together what we have learned so far about Boolean Algebra, Logic Gates, Propagation Delays, and Hazards is to outline a few simple examples.&lt;/p&gt;
&lt;p&gt;For the first example, we will create a system which monitors three motors. Each motor has a health indication output which is high when the motor has a fault. For the overall system to function correctly, at least two of the motors must be working correctly, therefore, we will create a system that outputs a logic high when two out of the three motors have asserted their fault outputs.&lt;/p&gt;
&lt;p&gt;The first stage in developing this solution is to create a truth table that shows the possible input combinations and the correct output for each of those input conditions. As we have 3 inputs, then there are 2&lt;sup&gt;3&lt;/sup&gt; or eight possible combinations of the input:&lt;/p&gt;
&lt;div class="xs-mr5 xs-align-middle" style="float:left;width:310px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" width="30%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 10: Truth Table for the motor monitoring system&amp;#39;s logic function&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;From this truth table we can generate the following logic equations: &lt;strong&gt;OP = (A.B) + (A.C) + (B.C)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We call the format of this equation a SUM of PRODUCTS (SOP) equation as the OP is the Boolean SUM (Logical OR) of the Boolean PRODUCTS (AND) equations.&lt;/p&gt;
&lt;p&gt;If we so desired, we could calculate a PRODUCT of SUMS (POS) output by following the approach.&lt;/p&gt;
&lt;p&gt;Firstly, we create the SOP logic equation for each entry on the truth table where the output is low: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;OP&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;A.C&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B.C&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Next, we apply DeMorgan&amp;#39;s theorem to convert from the SOP to the POS format. The first step is to invert the SOP equation: &lt;img loading="lazy" alt="equation 1" src="/e14/assets/legacy/2018/PrgmLogicEQ1.png" /&gt;&lt;/p&gt;
&lt;p&gt;We can then apply DeMorgan&amp;#39;s theorem and the ninth law of logic to create the final POS equation: &lt;strong&gt;OP=(A+B).(A+C).(B+C)&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;"&gt;For the remainder of this example, however, we will work with the SOP format as that is the most common method for implementing logic functions. As such, we can realize our SOP equation using a two-level logic circuit as below:&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" class="nolightbox" alt="diagrm 11" src="/e14/assets/legacy/2018/diagram11_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 11: Example Logic Circuit in SOP form&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;With this two-level network, we need to consider the propagation delay through the first AND gate level and the impact it might have on the output.&lt;/p&gt;
&lt;p&gt;Of course, this implementation uses two logic gate types (AND, OR). But it is possible to implement the same logical function using only NAND gates, as they are universal.&amp;nbsp; Thanks to DeMorgan&amp;#39;s Theorem, the NAND gate also implements the Negative OR function: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 12" src="/e14/assets/legacy/2018/diagram12_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 12: Example Logic Circuit in SOP form implemented using NAND Gates&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;As such, we can redraw the logic circuit above.&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s look at how we get the same functionality using NAND gates. The output equation can be represented as: &lt;img loading="lazy" style="vertical-align:middle;" alt="equation 2" src="/e14/assets/legacy/2018/PrgmLogicEQ2.png" /&gt;&lt;/p&gt;
&lt;p&gt;Using DeMorgan&amp;#39;s Theorem, we can iterate through the following steps, changing the sign as we break the bar and applying other rules of Boolean algebra:&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" alt="equation 3" src="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2" /&gt;&lt;/center&gt;
&lt;p&gt;If we are working with POS logic equations, we can use NOR gates to implement the logic equation and prove the functionality the same way using DeMorgan&amp;#39;s Theorem and Boolean Algebra rules.&lt;/p&gt;
&lt;p&gt;In the example above, we used a truth table to determine the logic equations and it works well for a simple application. However, if we have more complex applications we need a better way of determining the logic equations. This is where the Karnaugh-map (Kmap) comes into play. Kmaps are visual representations of the logic behavior which allow us to use our natural ability for pattern recognition to determine the logic equations.&lt;/p&gt;
&lt;div class="xs-mr5 xs-align-middle" style="float:left;width:250px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;00&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;01&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;11&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;10&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 13: Example Karnaugh-map used for four variables (A,B,C,D). Note the gray scale count.&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;Karnaugh-maps are used by grouping together adjacent 1&amp;#39;s for SOP and adjacent 0&amp;#39;s for POS. These groupings can then be used to determine the logic equation, using the rules of Boolean Algebra to implement the desired functionality.&lt;/p&gt;
&lt;div class="xs-mr5" style="clear:both;float:left;width:300px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" width="25%"&gt;&lt;img loading="lazy" alt="ABBC image" src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;00&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;01&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;11&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 14: Example of a Karnaugh-map: Grouping the 1s together.&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;Often, if we use a Karnaugh-map, we will obtain an equation which uses the minimum number of logic gates to implement. Using the example to the left we can group together the 1&amp;#39;s within the design where they are adjacent to each other.&lt;/p&gt;
&lt;p&gt;The example groups together four 1&amp;#39;s within the center of the Karnaugh-map (highlighted green), and from this we can see that the logic equation is D.B as the C and A cancel each other out due to being across not C and C or not A and A, respectively.&lt;/p&gt;
&lt;p&gt;The blue elements in the corner can also be grouped together as they are also judged to be adjacent, since the Karnaugh-map is judged to wrap around edge to edge and top to bottom. As such, the second equation to be extracted from the Karnaugh-map is C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;; therefore, the resulting logic equation for the Karnaugh-map is: &lt;strong&gt;OP = C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + D.B&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We can also use Karnaugh-maps to identify hazards which might result in glitches during operation and help us eliminate them. In the next example, we can extract the logical equation for the green and blue cells as: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D&lt;/strong&gt;&lt;/p&gt;
&lt;div style="clear:both;float:left;padding:12px 10px 5px 0px;width:250px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png" data-e14adj="t"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;00&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;01&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;11&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;border-left:2px solid #D23620;border-right:2px solid #D23620;border-top:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;border-bottom:2px solid #D23620;border-left:2px solid #D23620;border-right:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 15: Karnaugh-maps: Identifying Potential Hazards&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;However, this leaves the equation highlighted by the red circle as a potential hazard, which occurs when the input D changes from a 1 to a 0. The output is intended to stay high; however, there is not a specific term in the logic equation to address it. To remove the hazard, we should update the logic equation. See in the additional equation where the red text is: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D + &lt;span style="color:#d23620;"&gt;&lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B.C.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By this point now you should be familiar with Boolean Algebra, logic gates, how they relate to each other, and how they are used with truth tables and Karnaugh-maps to not only determine logic equations but also to identify race conditions. You should also understand how we can use universal gates for implementing logic equations.&lt;/p&gt;
&lt;p style="clear:both;"&gt;With the basics of Boolean Algebra and logic gates introduced, we can focus now on how to create logical structures which can be used in applications. As such, we are going to explore Half and Full Adders along with the basics of synchronous logic design, using flip flops and their application, to help us create counters, shift registers, and state machines.&lt;a name="sec8" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5gf" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;8. Arithmetic in Logic&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;There are times in logic design when we want to perform mathematical operations such as Addition, Subtraction, Multiplication, and Division. While how we do this and number systems we use can be a course on its own, the Half and Full Adder are the key logic circuits we use to achieve these and should be introduced here.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5gg" class="xbold"&gt;- 8.1 Half Adder&lt;/h3&gt;
&lt;p&gt;The Half Adder is so called as it adds two input variables, generating a sum and carry outputs; it has no ability to accept a carry-in from a previous adder.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 16" src="/e14/assets/legacy/2018/diagram16_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle" style="display:inline-block;width:300px;"&gt;
&lt;table class="xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Carry&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5 style="clear:both;"&gt;Figure 16: Half Adder logic diagram and truth table&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5gh" class="xbold"&gt;- 8.2 Full Adder&lt;/h3&gt;
&lt;p&gt;The Full Adder provides the ability to accept a carry-in and is therefore used more commonly when working with multi-bit buses in logic.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:380px;"&gt;&lt;img loading="lazy" alt="diagram 17" src="/e14/assets/legacy/2018/diagram17_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle" style="display:inline-block;width:400px;"&gt;
&lt;table class="xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Carry In&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Carry Out&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 17: Full Adder logic diagram and truth table&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;Of course, like any logic circuits, there are variations optimized for different applications, including Ripple Carry Adder, Carry Look Ahead, and Carry Save Adders.&lt;/p&gt;
&lt;p&gt;We can also use the same adders for subtraction, if we use the twos complement number system to represent signed numbers.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5gi" class="xbold"&gt;- 8.3 Signed and Unsigned Number Systems&lt;/h3&gt;
&lt;p&gt;For those not familiar with signed and unsigned binary numbers, we&amp;#39;ll very briefly discuss them now. Simply stated, there are several number systems which allow us to represent both signed and unsigned number systems.&lt;/p&gt;
&lt;p&gt;Unsigned numbers are the simplest and we can represent a range of 0 to 2&lt;sup&gt;n&lt;/sup&gt;&amp;ndash;1, where n is the width of the bus. Unsigned numbers always represent positive numbers.&amp;nbsp; To represent signed numbers, we have a choice of several number systems, the most common being the Sign and Magnitude, Ones Complement, or Twos Complement.&lt;/p&gt;
&lt;p&gt;Sign and Magnitude utilizes the left most bit (often called the most significant bit) to represent the sign of the number (0 = positive, 1 = negative), and the remainder of the bits represent the magnitude.&lt;/p&gt;
&lt;p&gt;In the Sign and Magnitude system, both positive and negative numbers have the same magnitude; however, the sign bit differs. Due to this it is possible to have both a positive and negative zero within the Sign and Magnitude system.&lt;/p&gt;
&lt;p&gt;Ones Complement uses the same unsigned representation for positive numbers as the Sign and Magnitude representation. However, for negative numbers, the inversion (ones complement) of the positive number is used.&lt;/p&gt;
&lt;p&gt;Twos Complement is the most widely used encoding scheme for representing signed numbers. Just like Sign and Magnitude and Ones Complement schemes, positive numbers are represented in the same manner as an unsigned number. While negative numbers are represented as the binary number, you add to a positive number of the same magnitude to get zero. A negative twos complement number is calculated by first taking the ones complement (inversion) of the positive number and then adding one to it. The twos complement number system allows subtraction of one number from another by performing an addition of the two numbers. The range a twos complement number can represent is given by: &lt;strong&gt;-(2&lt;sup&gt;n-1&lt;/sup&gt;) to + (2&lt;sup&gt;n-1&lt;/sup&gt;&amp;ndash;1)&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;One method we can use to convert a number to its twos complement format is to work right to left, leaving the number the same until the first one is encountered; after this each bit is inverted.&lt;a name="sec9" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5gj" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;9. Sequential Circuits&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;Combinatorial logic circuits are unable to implement functions that require knowledge of their previous inputs or decisions as they contain no memory/storage elements.&lt;/p&gt;
&lt;p&gt;In contrast, sequential circuits&amp;#39; outputs are based upon not only current inputs but also previous inputs and decisions. Sequential logic circuits achieve this by using storage elements called flip flops, the simplest of which is the D Type flip flop. The value stored in the flip flop is updated at a regular interval as indicated by the clock signal.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-mr5 align-middle" style="display:inline-block;width:180px;"&gt;&lt;img loading="lazy" alt="diagram 18" src="/e14/assets/legacy/2018/diagram18_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle" style="display:inline-block;width:200px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" colspan="2"&gt;&lt;strong&gt;Inputs&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" colspan="2"&gt;&lt;strong&gt;Outputs&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;CK&lt;/td&gt;
&lt;td class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;D&lt;/td&gt;
&lt;td class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;Q&lt;/td&gt;
&lt;td class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;span style="text-decoration:overline;"&gt;Q&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;X&lt;/td&gt;
&lt;td class="xs-border xs-p1" colspan="2"&gt;No Change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 18: D Flip-flop and truth table&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;This ability to store states within our logic design allows more complex logic structures to be implemented. It also aids timing as the output of the combinatorial logic circuit must be stable just before the clock is applied to the Flip Flop to store the next value, thereby eliminating glitches. But as we will see this introduces more issues as well, especially when there are multiple layers of logic between flip flops.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5gk" class="xbold"&gt;- 9.1 Half Adder in a Synchronous Design&lt;/h3&gt;
&lt;p&gt;In this example, you can see the two-clock cycle delay between the application of an input and the generation of the output. The first clock cycle stores the inputs A and B in the first flip flops. The output of these flip flops will then be passed through the combinatorial logic, in this case, the half adder. The output of the half adder is then stored into the second rank of flip flops and output on the second clock cycle.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:350px;"&gt;&lt;img loading="lazy" alt="diagram 19a" src="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3" /&gt;
&lt;h5&gt;Figure 19a: Example Half Adder in a synchronous design (clock is shown in orange).&lt;/h5&gt;
&lt;/div&gt;
&lt;div class="align-middle" style="display:inline-block;"&gt;&lt;img loading="lazy" alt="diagram 19b" src="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4" /&gt;
&lt;h5&gt;Figure 19b: Timing Diagram for the example Half Adder in a synchronous design above.&lt;/h5&gt;
&lt;/div&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5gl" class="xbold"&gt;- 9.2 Shift Registers and Counters&lt;/h3&gt;
&lt;p&gt;The three most commonly implemented sequential logic design structures are shift registers, counters, and state machines.&lt;/p&gt;
&lt;p&gt;Shift registers in their basic form are a collection of Flip Flops where the output of one flip flop feeds the input of the next flip flop. Signals are then progressed through the shift register on each clock. We can use shift registers for a range of things in our logic design from delays (although there are better ways to implement delays) to metastability synchronizers, as well as conversion between serial and parallel and the generation of random numbers using feedback correctly.&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" alt="diagram 20" src="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2" /&gt;
&lt;h5&gt;Figure 20: Shift Register and associated timing diagram.&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;In many designs, we need to time events or introduce delays between the generation or issuing of signals. We do this by using a counter. In this application, we use the flip flops to store the count and combinatorial logic to determine the next value of the count based upon the current value.&lt;/p&gt;
&lt;div class="xs-mr3" style="float:left;width:260px;"&gt;&lt;img loading="lazy" alt="diagram 21" src="/e14/assets/legacy/2018/diagram21_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 21: Four-bit counter state diagram&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;The first stage in the development of a counter is to create a simple state diagram which shows the counter behavior.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
&lt;div class="xs-mr3" style="float:left;width:320px;"&gt;
&lt;table class="xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Present A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Present B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Next A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Next B&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 22: Present State, Next State Table for the counter&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;Once the state diagram is created, we can then create a present state, next state table and extract from it the logic equations to implement the counter. Of course, while the example counts in sequential binary, if we desired, we could have the counter count in gray code, etc.&lt;/p&gt;
&lt;p&gt;With the present state, next state table (PS, NS) created, we can then create the logic equations needed to create in combinatorial logic. If necessary we can use Karnaugh-maps, etc. However, for this simple example we can work directly from the present state, next state table.&lt;/p&gt;
&lt;p&gt;With the PS, NS table, we create a logic equation for each of the next states, e.g. next A. As such the equations are: &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;Next A = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;Next B = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;From these equations we can generate the logic circuit which contains the D Type flip flops and logic gates.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:300px;"&gt;&lt;img loading="lazy" alt="diagram 23a" src="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:300px;"&gt;&lt;img loading="lazy" alt="23b" src="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;h5&gt;Figure 23: Logic Design for a two-bit counter.&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;Along with counters, logic designs are often called upon to perform sequence and control-based actions. These actions and sequences are best addressed using a state machine.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5gm" class="xbold"&gt;- 9.3 State Machines&lt;/h3&gt;
&lt;p&gt;State machines are logical constructs that transition between a finite number of states, like a counter; however, the path through the states is not sequential. A state machine will only be in one state at a point in time. It will transition between states depending upon several triggers, e.g. inputs or counter values, etc.&lt;/p&gt;
&lt;p&gt;Theoretically, state machines are divided into two basic classes: Moore and Mealy. They differ only in how the state machine&amp;#39;s outputs are generated.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Moore:&lt;/strong&gt; State Machine outputs are a function of the present state only. A classic example is a counter.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mealy:&lt;/strong&gt; State Machine outputs are a function of the present state and inputs. A classic example is the &lt;a class="jive-link-external-small" href="http://en.wikipedia.org/wiki/Richards_controller" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;Richards Controller&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When we are faced with the task of defining a state machine, we will develop a state diagram as we would do for a counter. The state diagram shows the states, inputs, and the transitions between the states and the outputs from the state machine. Figure 24 demonstrates the two types of state diagrams: one for a Moore State Machine (left), the other a Mealy State Machine (right).&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:200px;"&gt;&lt;img loading="lazy" alt="diagram 24a" src="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:200px;"&gt;&lt;img loading="lazy" alt="diagram 24b" src="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;h5&gt;Figure 24: State Diagrams for a Moore (left) and Mealy (right) State Machine.&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;If we were to implement these in logic gates and flip flops we would generate a present state, next state table, as we did for the previous counter example, and then create the logic equations for each of the state variables. The only difference is that, along with the current state, the present state, next state table will also have to consider the inputs and outputs for the state machine.&lt;a name="sec10" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5gn" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;10. Programmable Logic with FPGAs&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;So far, we have looked at how we create logic designs and implement them with discrete logic gates and flip flops. However, the most common way of implementing a logic design is using a programmable logic device (PLD) such as a Complex Programmable Logic Device (CPLD) or a Field Programmable Gate Array (FPGA). These devices enable the implementation of large logic designs and, depending upon the technology of the device used, they can be reprogrammed in the field.&lt;/p&gt;
&lt;p&gt;Programmable logic devices are available in three different technologies:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SRAM:&lt;/strong&gt; The FPGA program is stored in an external memory and loaded into the FPGA each time it is powered.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;FLASH:&lt;/strong&gt; The FLASH architecture of the FPGA also contains the program; no external memory device is needed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One Time Programmable (OTP):&lt;/strong&gt; The FPGA is applied by blowing fuses in the device. Once programmed, it cannot be modified.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Typically, SRAM-based programmable logic is used where high performance is required, while Flash-based devices are used in middle-to-low performance applications. While one time programmable devices are very limited in application, they still remain popular in space applications.&lt;/p&gt;
&lt;p&gt;The key to programmable logic is how logic equations are implemented in the device. It is of course very difficult for the device designers to include a range of AND, OR gates, etc. as the number of each gate type will vary with each application. This will result in either many unused gates or a shortage of a needed gate type. Either way it would not be an efficient method for the implementation of a programmable logic device.&lt;/p&gt;
&lt;p&gt;Device manufacturers addressed this challenge in a very smart manner. In place of discrete gates, they use a several input look up table (LUT) which is programmed to implement the combinatorial logic equations. In many respects, this LUT is very similar to a multiplexer. Let&amp;#39;s take a quick look at how we can use a LUT to implement logic equations.&lt;/p&gt;
&lt;p&gt;Using the same truth table as for the previous example, we can set the LUT inputs to either ground or VCC depending upon the truth table&amp;#39;s needs. We can then use the logic equation inputs (A,B,C) to drive the LUT selection inputs to output the correct value for that particular input combination implementing the desired logic equation.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 25" src="/e14/assets/legacy/2018/diagram25_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:320px;"&gt;
&lt;table class="xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" width="25%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 25: Setting the LUT&amp;#39;s Inputs to the Truth Table&lt;/h5&gt;
&lt;/center&gt;
&lt;p style="clear:both;"&gt;Using a LUT inside our programmable device therefore provides the best flexibility to implement a wide range of logic equations.&lt;/p&gt;
&lt;p&gt;Of course, we do not want to just implement the combinatorial logic circuits. We also want to implement sequential structures. This means that following the LUT there needs to be a flip flop to act as storage for the combinatorial output such that we can implement sequential structures.&lt;/p&gt;
&lt;p&gt;This combination of a LUT and Flip Flop is often called a Configurable Logic Block (CLB). A programmable logic device will consist of many thousands of CLBs. To provide the most flexibility, additional multiplexers will be used to support a wide range of CLB configurations.&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 26" src="/e14/assets/legacy/2018/diagram26_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 26: Very Basic Logic Slice&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;Obviously, modern devices have very complex CLB structures, which include local memory, fast carry inputs, arithmetic functions, and shift registers.&lt;/p&gt;
&lt;p&gt;Of course, these CLB&amp;#39;s need to be interconnected, which is where the device interconnect comes in, which allows the output of one CLB to be connected to the input of another CLB and eventually to the Input/Output of the device.&lt;/p&gt;
&lt;p&gt;This routing can be considered at two elements. First, there is global routing, which distributes global signals such as clocks. These are global specialist routing networks designed to be low skew and support high fan outs. This dedicated clocking network might be further split between truly global routes across the device and several additional regional limited routes to a specific area of the device. For all other signals, the programmable interconnect is used, which connects the CLBs to each other and other specialist functions within the device. To connect CLBs together it uses a switch matrix, which is configured to provide the internal routing between CLBs.&lt;/p&gt;
&lt;p&gt;One of the key drivers of programmable logic technology development was the reduction in the cost of transistors.&amp;nbsp; However, interconnect wires also played a role in enabling much larger devices at reduced cost.&amp;nbsp; When we develop programmable logic applications we spend a lot of time and effort optimizing the performance of the design with regards to its routing to ensure we can operate at the desired clock frequency.&lt;/p&gt;
&lt;div class="xs-mr3" style="float:left;width:300px;"&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 27" src="/e14/assets/legacy/2018/diagram27_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 27: CLB and Routing matrix&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;To get signals on and off the chip, programmable logic devices also provide IO cells, which are configurable. These enable the device to support a range of single-ended logic standards, e.g. LVCMOS2v4, LVCOM 1V5, etc., Stub Series Terminated Logic (SSTL) as used for High Speed DDR interfaces, and a range of differential standards, including Low Swing Differential Voltage Signaling (LVDS).&lt;/p&gt;
&lt;p&gt;Many devices also include complex structures in the IO cells to allow for double data rate signals, source synchronous designs, bus skew correction, and conversion to/from serial. Electrically, the IO can control slew rates, drive strengths and even match the impedance with the transmission line, all of which are controlled by the developer. This means that given the right PHY on the board, using programmable logic, we can achieve any-to-any interconnectivity.&lt;a name="sec11" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5go" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;11. Hardware Description Languages&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;Thanks to the sheer scale of resources offered by programmable logic we cannot any longer design at the gate level like we have done previously. It would simply take too long to develop applications which can leverage the resources provided by the programmable device at the gate level. In the place of developing by using logic equations, we use Hardware Description languages (HDL) such as Verilog or VHDL.&lt;/p&gt;
&lt;p&gt;When we work with these languages, we do not describe the logic equations, but rather the desired behavior at the register transfer level (RTL). This allows us to define the functionality of the programmable logic device.&lt;/p&gt;
&lt;p&gt;How our description gets translated from our HDL file into the logic equations and implemented in the programmable logic device requires several stages.&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5 xs-mb5" style="clear:both;"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Synthesis&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;The conversion of the HDL file into logic equations often targeted at the specific resources of the programmable logic device.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="xs-border xs-p1 xs-text-5 xs-mb5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="text-white xs-border xs-p1" style="background-color:#f17c0e;"&gt;&lt;strong&gt;Placing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;Placing of the identified logic cells (LUT, Flip Flops, etc.) into the programmable logic CLBs.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="xs-border xs-p1 xs-text-5 xs-mb5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="text-white xs-border xs-p1" style="background-color:#003082;"&gt;&lt;strong&gt;Routing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;Connecting together the placed CLBs to achieve the required performance.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 28: Stages to Convert HDL File into Logic Equations&lt;/h5&gt;
&lt;p&gt;Each stage often requires addition constraints to ensure the desired timing is achieved or the correct IO standards are used.&lt;/p&gt;
&lt;p&gt;What developers who are used to using VHDL and Verilog will be familiar with is that not all constructs / commands within a language can be synthesized. Therefore, there is only a subset of language commands and coding structures which can be synthesized into a programmable logic device successfully. The remaining elements of the HDL language which are not synthesizable are used in the verification of the design before we implement it in the device.&lt;/p&gt;
&lt;p&gt;This verification is called the development of a test bench which ensures the Unit Under Test (UUT) meets its specification and is suitable for its intended purpose. When it comes to test benching, we have a couple of choices as to how we perform it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Functional Simulation only:&lt;/strong&gt; This checks if the design is functionally correct.&amp;nbsp; It does not include internal device timing delays such as propagation delays, which may affect performance when implemented in the device.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Gate Level Simulation:&lt;/strong&gt; This verifies the functionality of the design when back annotated with timing information from the final implemented design. This can take considerable time to perform.&lt;/li&gt;
&lt;/ul&gt;
&lt;center&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 29" src="/e14/assets/legacy/2018/diagram29_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 29: Example Test Bench architecture&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;Let&amp;#39;s look at how we would implement a state machine using the VHDL Language. Learning VHDL itself is a short course; however, we can briefly introduce the basics here.&lt;/p&gt;
&lt;p&gt;A VHDL file is split into two distinct elements, the entity and the architecture. The entity defines the input and outputs of the VHDL module and if it is at the top level of the design. It represents the inputs and outputs of the programmable logic device itself.&lt;/p&gt;
&lt;p&gt;The architecture defines the functionality and consists of either sequential statements, which are all executed in parallel or processes.&lt;/p&gt;
&lt;p&gt;Processes execute sequentially from top to bottom, more like in a traditional programming application. However, there are rules around when signals update during the process. Additionally, each process in the architecture runs in parallel as you are describing logic functions.&lt;/p&gt;
&lt;table style="clear:both;" width="100%"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="padding-right:15px;"&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;; &lt;br /&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state only&lt;/span&gt; &lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;; &lt;br /&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state and inputs&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;center&gt;
&lt;h5&gt;Figure 30: VHDL Architecture which shows the implementation of the state machines in the above example&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;In the above example, the process runs each time the clock or reset is changed. This is defined in the sensitivity list of the process declaration.&lt;/p&gt;
&lt;p&gt;In these examples, the reset is asynchronous and used to reset the current state and the output, while the next actions only occur following the rising edge of the clock. Where the state machine progresses through each state depends upon its inputs and current state, moving if necessary to the next state.&lt;/p&gt;
&lt;p&gt;What this demonstrates is that, using programmable logic and HDL, we can directly code the state machine or counter from the state diagram and without the need to create the logic equations. Indeed, we let the synthesis tool do that for us.&lt;/p&gt;
&lt;center&gt;
&lt;h5 style="clear:both;"&gt;*Trademark. &lt;strong&gt;Xilinx is a trademark of AMD Corp.&lt;/strong&gt; Other logos, product and/or company names may be trademarks of their respective owners.&lt;/h5&gt;
&lt;/center&gt;&lt;center&gt;
&lt;p class="xs-border-bottom xs-pb2"&gt;Shop our wide range of &lt;strong&gt;FPGAs, SoCs, EVMs, application specific kits, embedded development boards, and more.&amp;nbsp;&lt;span &gt;&lt;a class="e14-button e14-button--primary e14-button--large" href="https://referral.element14.com/OrderCodeView?url=%2Fsearch%3Fst%3Damd%2520programmable%2520logic&amp;COM=e14c-essentials-prgmdevice1-doc&amp;CMP=e14c-essentials-prgmdevice1-doc&amp;osetc=e14c-essentials-prgmdevice1-doc" title="Shop Now" title="Shop Now" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;h2 id="mcetoc_1i1b4hg5gp" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;&lt;a name="test" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;Test Your Knowledge&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;div class="xs-float-left xs-mr2 xs-b2"&gt;            
&lt;style&gt;
   .e14-achievement-name{font-size:14px;font-weight:700;text-align:center;height:40px;margin:0;padding:5px}.e14-avatar{width:50% !important;margin:auto;border-radius:500px}.e14-avatar img{border-radius:543px}.e14-progress-bar{height:12px;border-radius:6px;background-clip:padding-box;background:#3575c2}.e14-achievement-thumb{height:200px}.e14-achievement-criteria{font-size:10px !important;overflow:hidden;margin-bottom:10px;line-height:1.5;height:60px}.e14-achievement-criteria p{font-size:10px !important;overflow:hidden;margin-bottom:10px;line-height:1.5;height:60px}.e14-achievement-criteria.complete{height:38px}.e14-achievement-criteria.complete p{height:38px}.e14-greyout{-webkit-filter:grayscale(90%);-moz-filter:grayscale(90%);-o-filter:grayscale(90%);-ms-filter:grayscale(90%);filter:grayscale(90%)}.e14-complete{float:right;margin-top:-20px;padding-right:5px;margin-bottom:12px;font-weight:700;color:dimgray}.e14-achievement-status{margin:5px}.shimmer{position:relative;overflow:hidden;background:#f6f7f8;background:linear-gradient(-45deg,#eee 40%,#fafafa 50%,#eee 60%);background-size:300%;background-position-x:100%;animation:shimmer 8s infinite linear}@keyframes shimmer{0%{background-position:-1000px 0}
100%{background-position:1000px 0}}
@media only screen and (max-width:480px){.e14-achievement-criteria{display:none}.e14-complete{font-size:9px}.e14-user-achievement{width:100px !important;height:150px !important}.e14-achievement-status{margin-top:15px}.e14-achievement-thumb{height:130px}.e14-achievement-name{font-size:10px}} 
&lt;/style&gt;

    &lt;div id="embed-f00e71d57f6b42ba9564a085c0480d7a_thumbnails" data-columnclass="thumbnail-column"&gt;
        &lt;div class="content thumbnail e14-user-achievement" data-href="/achievements/241fc2d8-ae75-4111-8616-7ed062a852fa" style="border: 3px solid #8d8d8d;cursor: pointer;"&gt;
        	       &lt;h2 class="name e14-achievement-name"&gt;
    		            Programmable Device 1&lt;br&gt;
    		       &lt;/h2&gt;
    			&lt;div class="e14-avatar e14-greyout"&gt;
    				&lt;img loading="lazy" src="https://community-storage.element14.com/communityserver-components-imagefileviewer/achievements/241fc2d8ae75411186167ed062a852fa/Programmable%20Device%201.png-140x140x2.png?_=9b9y946HOQq0GkkO1wsnuA==" style="width: 140px;max-height:140px;overflow:hidden;background:url(&amp;#39;https://community-storage.element14.com/communityserver-components-imagefileviewer/achievements/241fc2d8ae75411186167ed062a852fa/Programmable%20Device%201.png-140x140x2.png?_=9b9y946HOQq0GkkO1wsnuA==&amp;#39;) center center no-repeat;background-size:cover;aspect-ratio:140/140" alt="Programmable Device 1" border="0" /&gt;
    		    &lt;/div&gt;
    		    &lt;div style="padding:5px;"&gt;
    		        &lt;div title="Complete our Essentials: Programmable Device 1 course, earn 100% on the quiz and give the page a star rating to earn this badge!" class="e14-achievement-criteria"&gt;Complete our Essentials: Programmable Device 1 course, earn 100% on the quiz and give the page...&lt;/div&gt;
    		        
    		    &lt;/div&gt;
    		&lt;/div&gt;
    &lt;/div&gt;   
&lt;/script&gt;&lt;/div&gt;
&lt;p&gt;Are you ready to demonstrate your Essentials of Programmable Logic knowledge? &lt;strong&gt;Then take a quick 15-question, multiple-choice quiz to see how much you&amp;#39;ve learned from this Programmable Devices module.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To earn the Programmable Devices I Badge&lt;/strong&gt;, read through the module to learn all about Programmable Logic, attain 100% in the quiz at the bottom, and leave us some feedback in the comments section.&lt;/p&gt;
&lt;p&gt;&lt;div class="voltquiz" data-formid="0fcd3450-c4f3-4322-8af1-4b03e66c0ed0" data-formtype="quiz" data-success-message="" data-fail-message="" data-pass-mark="OTk=" &gt;&lt;/div&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="e14-quiz-document-metadata e14-init-hidden"&gt;&lt;/div&gt;
&lt;h5&gt;&lt;a href="/learn/learning-center/online-learning/essentials/" data-icid="essentials-programdevice1-doc" data-e14adj="t"&gt;&lt;img loading="lazy" class="xs-align-middle xs-mr5" alt="essentials logo" src="/e14/assets/legacy/2017/learningess.png" width="175px" /&gt;&lt;/a&gt; Sponsored by &lt;a href="/products/manufacturers/amd" data-icid="essentials-programdevice1-doc" data-e14adj="t"&gt;&lt;img loading="lazy" class="essSponsor xs-align-middle xs-ml2 xs-mr5" title="AMD" alt="amd Logo" src="/e14/assets/main/mfg-group-assets/xilinxLogo.png" width="100px" /&gt;&lt;/a&gt;&lt;/h5&gt;
&lt;p&gt;&lt;div class="e14-navigation-buttons"&gt;&lt;a href="/learn/learning-center/essentials?ICID=essentials-programdevice1-doc"&gt;
                    &lt;button class="e14-nav-button-prev"&gt;Previous&lt;/button&gt;
                &lt;/a&gt;&lt;a href="/learn/learning-center/essentials/w/documents/4109/programmable-socs?ICID=essentials-programdevice1-doc"&gt;
                    &lt;button class="e14-nav-button-next"&gt;Next&lt;/button&gt;
                &lt;/a&gt;&lt;/div&gt;&lt;script&gt;e14.func.queueScripts.add(function(){ e14.func.repositionNavButtons(); })&lt;/script&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: fpga_essentials, programmable_devices, xilinx_essentials, xilinx, fpga, programmable_device, programmable_logic, ess_module&lt;/div&gt;
</description></item><item><title>Programmable Devices: Programmable Logic</title><link>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic/revision/7</link><pubDate>Wed, 26 Jun 2024 21:24:33 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:722dc523-e66e-42a7-84b5-de3f2731c4d8</guid><dc:creator>pchan</dc:creator><comments>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic#comments</comments><description>Revision 7 posted to Documents by pchan on 6/26/2024 9:24:33 PM&lt;br /&gt;
&lt;p&gt;&lt;a name="top" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt; &lt;img class="nolightbox essProfile xs-float-left xs-pr2 xs-pb2" alt="Profile image" height="115" src="/e14/assets/legacy/2018/PrgmLogic_profile.png" /&gt;&lt;/p&gt;
&lt;p&gt;The world and our interaction with it is analog. Our surrounding environment, colors in the electromagnetic spectrum, speech, and sound all are represented by continuously changing analog values. When it comes to processing these analog signals, however, digital systems offer several benefits to a traditional analog processing solution. For example, they have higher performance, ease of storage and transmission, and better noise immunity. As such, while the world is analog, it is mainly processed digitally using logic circuits. In this learning module, you will be introduced to the essentials of logic design, and how it can be implemented using programmable logic.&lt;br /&gt; &lt;a class="xbold" href="/w/documents/3803/related-components-dev-boards-for-element14-essentials-programmable-devices-i" data-icid="essentials-programdevice1-doc" data-e14adj="t"&gt;Related Components &amp;amp; Dev Boards&lt;/a&gt; | &lt;a class="xbold" href="#test" data-e14adj="t"&gt;Test Your Knowledge &lt;i class="text-orange xs-ml05 fas fa-caret-right"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="xs-clear"&gt;&lt;a name="object" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2 id="mcetoc_1i1b4hg5f0" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;2. Objectives&lt;/h2&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;&lt;em&gt;Upon completion of this module, you will be able to:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Perform some fundamental operations of Boolean algebra&lt;/li&gt;
&lt;li&gt;Explain the operation and truth tables of common logic gates&lt;/li&gt;
&lt;li&gt;Illustrate how combinatorial circuits are designed&lt;/li&gt;
&lt;li&gt;Discuss the differences between combinatorial and sequential circuits&lt;/li&gt;
&lt;li&gt;Understand how shift registers, counters, and state machines operate&lt;/li&gt;
&lt;li&gt;Explain the basic structures of PLDs&lt;/li&gt;
&lt;li&gt;Describe the role of HDLs&lt;a name="sec3" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mcetoc_1i1b4hg5f1" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;3. Boolean Algebra&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;The key foundation of digital logic is Boolean Algebra. Without understanding it we cannot produce effective logic designs or understand the outputs of higher level tools such as synthesis engines.&lt;/p&gt;
&lt;p&gt;Boolean algebra is named after its inventor, George Boole, who in 1854 published his work entitled, &amp;quot;An investigation of the laws of thought on which are founded the mathematical theories of logic and probabilities.&amp;quot; This work was later used by Claude Shannon in his 1937 master&amp;#39;s thesis at MIT entitled, &amp;quot;A Symbolic Analysis of Relay and Switching Circuits,&amp;quot; which demonstrated that switching circuits could solve all problems in the same manner as Boolean algebra. Thus, the relationship between switching circuits and Boolean algebra became the foundation of all digital applications.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5f2" class="xbold"&gt;- 3.1 Boolean Addition and Multiplication&lt;/h3&gt;
&lt;center&gt;
&lt;p&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1+0=1&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+1=1&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1+1=1&lt;/strong&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p&gt;As you can see, the result of the SUM is equal to one only when one or more of the literals is one.&lt;/p&gt;
&lt;p&gt;Boolean multiplication produces the PRODUCT of the literals:&lt;/p&gt;
&lt;center&gt;
&lt;p&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.1=0&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1.1=1&lt;/strong&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p&gt;In this case, you can see the PRODUCT is equal to one only when both literals are equal to one.&lt;/p&gt;
&lt;p&gt;Understanding the meaning of the SUM and PRODUCT terms will be important later when we examine logic gates and equations.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5f3" class="xbold"&gt;- 3.2 Boolean Algebra Laws&lt;/h3&gt;
&lt;p&gt;Just as in other areas of mathematics, Boolean algebra has several laws which we must understand, such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Commutative Law:&lt;/strong&gt; The order of literals in Boolean addition does not affect the result: A+B=B+A&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Associative Law:&lt;/strong&gt; When performing Boolean addition of more than two literals, the result is the same regardless of grouping:&amp;nbsp; A+(B+C)=(A+B)+C&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Distributive Law:&lt;/strong&gt; Performing a Boolean addition of two or more literals before performing a Boolean multiplication on the result is the same as performing the Boolean multiplication with each literal before performing the Boolean Addition A(B+C)=AB+AC&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These laws become very important when we design logic circuits and wish to optimize the number of logic gates we use in our solution.&lt;/p&gt;
&lt;p&gt;Along with these laws we also have twelve rules of Boolean Logic with which we must become familiar. They are:&lt;/p&gt;
&lt;center&gt;
&lt;table class="xs-border; xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" colspan="2"&gt;&lt;strong&gt;12 Boolean Logic Rules&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A + 0 = A&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;A . A = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A + 1 = 1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;A . &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A . 0 = 0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;a href="/e14/assets/legacy/2018/A2bars.png" data-e14adj="t"&gt;&lt;img loading="lazy" alt="a2 bars" src="/e14/assets/legacy/2018/A2bars.png" /&gt;&lt;/a&gt; = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A . 1 = A&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;A + A.B = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A + A = A&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B = A + B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;(A + B).(A+C) = A + B.C&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5f4" class="xbold"&gt;- 3.3 DeMorgan&amp;#39;s Theorem&lt;/h3&gt;
&lt;p&gt;The final remaining element we need to understand about Boolean Algebra is DeMorgan&amp;#39;s Theorem which states, &amp;quot;The complement of a product of sums is equal to the sum of the complements.&amp;quot;&lt;/p&gt;
&lt;p&gt;This is better shown represented as an equation: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A good mnemonic device to remember this is: &amp;quot;break the bar, change the sign.&amp;quot;&lt;/p&gt;
&lt;p&gt;Of course, now that we understand Boolean algebra, we want to be able to see how it maps to the logic gates we use to implement digital circuits.&lt;a name="sec4" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5f5" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;4. Logic Gates&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;The seven commonly used logic gates in digital design are NOT, AND, OR, XOR, NOR, NAND and XNOR gates. In our designs we use combinations of these logic gates to implement the logic function. In this section, we&amp;#39;ll review these logic gates.&lt;/p&gt;
&lt;p&gt;At the lowest level these logic gates are made from arrangements of transistors; however, each arrangement has its own symbol and truth table, which shows for a given input what its outputs will be. (Note: For simplicity&amp;#39;s sake, except for the NOT gate, all gates are demonstrated with two inputs).&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5f6" class="xbold"&gt;- 4.1 NOT Gate&lt;/h3&gt;
&lt;p&gt;The simplest of the logic gates is the NOT gate. This gate simply inverts the logic value presented on the input.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-pr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 1" src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:200px;"&gt;
&lt;p class="xbold"&gt;NOT symbol &amp;amp; truth table&lt;/p&gt;
&lt;table class="xs-border xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 1: NOT Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5g7" class="xbold"&gt;- 4.2 AND Gate&lt;/h3&gt;
&lt;p&gt;One of the most commonly used logic gates is the AND gate, which implements Boolean algebra multiplication and produces the PRODUCT of its inputs as we described earlier in this learning module.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-align-middle xs-mr2" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 2" src="/e14/assets/legacy/2018/diagram2_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p&gt;&lt;strong&gt;AND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table class="xs-border xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 2: AND Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5g8" class="xbold"&gt;- 4.3 OR Gate&lt;/h3&gt;
&lt;p&gt;To implement Boolean addition and generate the SUM of its inputs, we use the OR Gate which uses the symbol as shown in Figure 3.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 3" src="/e14/assets/legacy/2018/diagram3_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;OR Symbol &amp;amp; Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 3: OR Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;The remaining logic gates are derivatives of the AND, OR, and NOT functions. However, the NAND and NOR gates have proven to be very popular due to their universality, which allows any logic gate&amp;mdash;AND, OR, NOT&amp;mdash;to be implemented using these two gates. We will look at exactly how we can do this in an example further on in this learning module.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5g9" class="xbold"&gt;- 4.4 NAND Gate&lt;/h3&gt;
&lt;p&gt;The simplest of the gates is the NAND gate, which stands for Not AND. This can be represented by an AND gate followed by a NOT gate. However, it is normally shown as an AND gate with an inversion bubble on its output.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 4" src="/e14/assets/legacy/2018/diagram4_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;NAND Symbol &amp;amp; Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 xbold text-white" style="background-color:#007fac;"&gt;Input A&lt;/th&gt;
&lt;th class="xs-border xs-p1 xbold text-white" style="background-color:#007fac;"&gt;Input B&lt;/th&gt;
&lt;th class="xs-border xs-p1 xbold text-white" style="background-color:#007fac;"&gt;Output&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 4: NAND Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5ga" class="xbold"&gt;- 4.5 NOR Gate&lt;/h3&gt;
&lt;p&gt;A similar logic gate is the NOR gate, which is also a universal gate and represents the NOT OR function. We represent the NOR symbol as the OR gate with an inversion bubble.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 5" src="/e14/assets/legacy/2018/diagram5_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;NOR Symbol and Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 5: NOR Gate&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5gb" class="xbold"&gt;- 4.6 XOR and XNOR Gates&lt;/h3&gt;
&lt;p&gt;The final two gates are the XOR and XNOR gates, which are constructed from logic gates already introduced. However, they provide very useful functions allowing us to determine if both inputs agree (XNOR) or both inputs differ (XOR).&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 6" src="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;XOR Symbol &amp;amp; Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 6a: XOR Gate&lt;/h5&gt;
&lt;/center&gt;&lt;center&gt;
&lt;div class="xs-align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 6b" src="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:250px;"&gt;
&lt;p class="xbold"&gt;XNOR Symbol &amp;amp; Truth Table&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 6b: XNOR Gate&lt;/h5&gt;
&lt;a name="sec5" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/center&gt;
&lt;h2 id="mcetoc_1i1b4hg5gc" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;5. Transistor Implementation of a Gate&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;As mentioned earlier in this learning module, each of the logic gates consists of several transistors arranged to implement the desired logic gate.&lt;/p&gt;
&lt;div class="xs-mr2" style="float:left;width:280px;"&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 7" src="/e14/assets/legacy/2018/diagram7_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 7: Transistor Level implementation of a NOT Gate&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;The simplest of these is the NOT gate, which uses two complementary transistors to invert the input at its output. When the Input is high, transistor Q1 is turned off thanks to the inversion, while transistor Q2 is turned on pulling the output to ground, which is the opposite of the presented signal. Conversely, when the input is low, transistor Q2 is this time turned off, while Q1 is turned on, pulling the output to the power rail and outputting a logic high.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
&lt;div class="xs-mr2" style="float:left;width:280px;"&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 8" src="/e14/assets/legacy/2018/diagram8_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 8: Transistor level implementation of a AND Gate&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;This NOT structure is also used in more complex gates such as the AND gate. Looking at the transistor level of the AND gate you will first notice the Output stage Q5 and Q6 is the same as for the NOT gate function.&lt;/p&gt;
&lt;p&gt;When inputs A and B are both high, transistors Q1 and Q2 are turned on while Q3 and Q4 are turned off. This pulls the input to Q6 and Q5 low, which due to the inversion means Q5 turns on and Q6 turns off allowing the output to be set high. For all other combinations at least one of Q1, Q2, Q3 and Q4 is turned off ,which pulls the input to Q5 and Q6 high, as such turning on Q6 and off Q5 pulling the output low as would be expected for an AND logic gate.&lt;a name="sec6" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5gd" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;6. Propagation Delay&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;When we implement logic circuits, using logic gates, we call these combinatorial logic circuits as there is no storage or feedback. To ensure these circuits function as intended we also, need to understand what occurs when an input changes. As just demonstrated, logic gates are made up from arrangements of switching transistors, and as such it takes time for a change at an input to result in a change of the output.&amp;nbsp; We call this delay the PROPAGATION time and it will vary depending upon the logic family used.&lt;/p&gt;
&lt;p&gt;To ensure we are all on the same page, there are several different logic families, each implemented in different underlying technologies such as CMOS (Complementary Metal Oxide Semi-conductor) or TTL (Transistor to Transistor Logic). Each logic family will exhibit a different propagation delay, which will limit the switching frequency of the logic design. If we are testing in the lab, we measure the propagation delay between the mid-point (50%) of the rising and falling edges as shown below.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-mr5 xs-align-middle" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 9a" src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="xs-align-middle" style="display:inline-block;width:255px;"&gt;&lt;img loading="lazy" alt="diagram 9b" src="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4" /&gt;&lt;/div&gt;
&lt;h5&gt;Figure 9: Timing Diagram of NOT gate&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;The propagation time is normally defined within the data sheet for the logic gate selected; however, it will often list two propagation times: one for the high to low transition and another for the low to high transition.&amp;nbsp; Of course, the propagation time will also be affected by the ambient temperature, changes in power supply conditions, resistance of the driver, and the capacitive load on the device output.&lt;/p&gt;
&lt;p&gt;We call the output driving several devices inputs the FANOUT. The higher the fanout, the larger the loading, and, therefore, the slower the output rise and fall times. Typical values of propagation time in logic datasheets range from 5 ns to 35 ns, depending upon the logic family, minimum/maximum behavior, and loading conditions (FANOUT).&lt;/p&gt;
&lt;p style="clear:both;"&gt;When we develop our combinatorial circuit, which will typically consist of several levels of logic gates, due to the layer on gates, we need to be careful of the differing propagation delays, as differing propagation delays can lead to glitches in the output value which are not correct. This is one of the reasons that in many applications, combinatorial circuits are used with storage elements like D type flip flops and an associated clock to ensure the output does not glitch and is stable when it is presented to the next processing/decision element.&lt;/p&gt;
&lt;p&gt;However, if we are working purely with combinatorial circuits, we can also take some steps to mitigate these glitches, which are often referred to as RACE Hazards.&lt;a name="sec7" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5ge" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;7. Combinatorial Circuit Example&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;The best way to demonstrate how we can pull together what we have learned so far about Boolean Algebra, Logic Gates, Propagation Delays, and Hazards is to outline a few simple examples.&lt;/p&gt;
&lt;p&gt;For the first example, we will create a system which monitors three motors. Each motor has a health indication output which is high when the motor has a fault. For the overall system to function correctly, at least two of the motors must be working correctly, therefore, we will create a system that outputs a logic high when two out of the three motors have asserted their fault outputs.&lt;/p&gt;
&lt;p&gt;The first stage in developing this solution is to create a truth table that shows the possible input combinations and the correct output for each of those input conditions. As we have 3 inputs, then there are 2&lt;sup&gt;3&lt;/sup&gt; or eight possible combinations of the input:&lt;/p&gt;
&lt;div class="xs-mr5 xs-align-middle" style="float:left;width:310px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" width="30%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 10: Truth Table for the motor monitoring system&amp;#39;s logic function&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;From this truth table we can generate the following logic equations: &lt;strong&gt;OP = (A.B) + (A.C) + (B.C)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We call the format of this equation a SUM of PRODUCTS (SOP) equation as the OP is the Boolean SUM (Logical OR) of the Boolean PRODUCTS (AND) equations.&lt;/p&gt;
&lt;p&gt;If we so desired, we could calculate a PRODUCT of SUMS (POS) output by following the approach.&lt;/p&gt;
&lt;p&gt;Firstly, we create the SOP logic equation for each entry on the truth table where the output is low: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;OP&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;A.C&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B.C&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Next, we apply DeMorgan&amp;#39;s theorem to convert from the SOP to the POS format. The first step is to invert the SOP equation: &lt;img loading="lazy" alt="equation 1" src="/e14/assets/legacy/2018/PrgmLogicEQ1.png" /&gt;&lt;/p&gt;
&lt;p&gt;We can then apply DeMorgan&amp;#39;s theorem and the ninth law of logic to create the final POS equation: &lt;strong&gt;OP=(A+B).(A+C).(B+C)&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;"&gt;For the remainder of this example, however, we will work with the SOP format as that is the most common method for implementing logic functions. As such, we can realize our SOP equation using a two-level logic circuit as below:&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" class="nolightbox" alt="diagrm 11" src="/e14/assets/legacy/2018/diagram11_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 11: Example Logic Circuit in SOP form&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;With this two-level network, we need to consider the propagation delay through the first AND gate level and the impact it might have on the output.&lt;/p&gt;
&lt;p&gt;Of course, this implementation uses two logic gate types (AND, OR). But it is possible to implement the same logical function using only NAND gates, as they are universal.&amp;nbsp; Thanks to DeMorgan&amp;#39;s Theorem, the NAND gate also implements the Negative OR function: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 12" src="/e14/assets/legacy/2018/diagram12_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 12: Example Logic Circuit in SOP form implemented using NAND Gates&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;As such, we can redraw the logic circuit above.&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s look at how we get the same functionality using NAND gates. The output equation can be represented as: &lt;img loading="lazy" style="vertical-align:middle;" alt="equation 2" src="/e14/assets/legacy/2018/PrgmLogicEQ2.png" /&gt;&lt;/p&gt;
&lt;p&gt;Using DeMorgan&amp;#39;s Theorem, we can iterate through the following steps, changing the sign as we break the bar and applying other rules of Boolean algebra:&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" alt="equation 3" src="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2" /&gt;&lt;/center&gt;
&lt;p&gt;If we are working with POS logic equations, we can use NOR gates to implement the logic equation and prove the functionality the same way using DeMorgan&amp;#39;s Theorem and Boolean Algebra rules.&lt;/p&gt;
&lt;p&gt;In the example above, we used a truth table to determine the logic equations and it works well for a simple application. However, if we have more complex applications we need a better way of determining the logic equations. This is where the Karnaugh-map (Kmap) comes into play. Kmaps are visual representations of the logic behavior which allow us to use our natural ability for pattern recognition to determine the logic equations.&lt;/p&gt;
&lt;div class="xs-mr5 xs-align-middle" style="float:left;width:250px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;00&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;01&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;11&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;10&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 13: Example Karnaugh-map used for four variables (A,B,C,D). Note the gray scale count.&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;Karnaugh-maps are used by grouping together adjacent 1&amp;#39;s for SOP and adjacent 0&amp;#39;s for POS. These groupings can then be used to determine the logic equation, using the rules of Boolean Algebra to implement the desired functionality.&lt;/p&gt;
&lt;div class="xs-mr5" style="clear:both;float:left;width:300px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" width="25%"&gt;&lt;img loading="lazy" alt="ABBC image" src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;00&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;01&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;11&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 14: Example of a Karnaugh-map: Grouping the 1s together.&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;Often, if we use a Karnaugh-map, we will obtain an equation which uses the minimum number of logic gates to implement. Using the example to the left we can group together the 1&amp;#39;s within the design where they are adjacent to each other.&lt;/p&gt;
&lt;p&gt;The example groups together four 1&amp;#39;s within the center of the Karnaugh-map (highlighted green), and from this we can see that the logic equation is D.B as the C and A cancel each other out due to being across not C and C or not A and A, respectively.&lt;/p&gt;
&lt;p&gt;The blue elements in the corner can also be grouped together as they are also judged to be adjacent, since the Karnaugh-map is judged to wrap around edge to edge and top to bottom. As such, the second equation to be extracted from the Karnaugh-map is C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;; therefore, the resulting logic equation for the Karnaugh-map is: &lt;strong&gt;OP = C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + D.B&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We can also use Karnaugh-maps to identify hazards which might result in glitches during operation and help us eliminate them. In the next example, we can extract the logical equation for the green and blue cells as: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D&lt;/strong&gt;&lt;/p&gt;
&lt;div style="clear:both;float:left;padding:12px 10px 5px 0px;width:250px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png" data-e14adj="t"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;00&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;01&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;11&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;border-left:2px solid #D23620;border-right:2px solid #D23620;border-top:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;border-bottom:2px solid #D23620;border-left:2px solid #D23620;border-right:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 15: Karnaugh-maps: Identifying Potential Hazards&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;However, this leaves the equation highlighted by the red circle as a potential hazard, which occurs when the input D changes from a 1 to a 0. The output is intended to stay high; however, there is not a specific term in the logic equation to address it. To remove the hazard, we should update the logic equation. See in the additional equation where the red text is: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D + &lt;span style="color:#d23620;"&gt;&lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B.C.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By this point now you should be familiar with Boolean Algebra, logic gates, how they relate to each other, and how they are used with truth tables and Karnaugh-maps to not only determine logic equations but also to identify race conditions. You should also understand how we can use universal gates for implementing logic equations.&lt;/p&gt;
&lt;p style="clear:both;"&gt;With the basics of Boolean Algebra and logic gates introduced, we can focus now on how to create logical structures which can be used in applications. As such, we are going to explore Half and Full Adders along with the basics of synchronous logic design, using flip flops and their application, to help us create counters, shift registers, and state machines.&lt;a name="sec8" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5gf" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;8. Arithmetic in Logic&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;There are times in logic design when we want to perform mathematical operations such as Addition, Subtraction, Multiplication, and Division. While how we do this and number systems we use can be a course on its own, the Half and Full Adder are the key logic circuits we use to achieve these and should be introduced here.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5gg" class="xbold"&gt;- 8.1 Half Adder&lt;/h3&gt;
&lt;p&gt;The Half Adder is so called as it adds two input variables, generating a sum and carry outputs; it has no ability to accept a carry-in from a previous adder.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 16" src="/e14/assets/legacy/2018/diagram16_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle" style="display:inline-block;width:300px;"&gt;
&lt;table class="xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Carry&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5 style="clear:both;"&gt;Figure 16: Half Adder logic diagram and truth table&lt;/h5&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5gh" class="xbold"&gt;- 8.2 Full Adder&lt;/h3&gt;
&lt;p&gt;The Full Adder provides the ability to accept a carry-in and is therefore used more commonly when working with multi-bit buses in logic.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:380px;"&gt;&lt;img loading="lazy" alt="diagram 17" src="/e14/assets/legacy/2018/diagram17_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle" style="display:inline-block;width:400px;"&gt;
&lt;table class="xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Carry In&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Carry Out&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 17: Full Adder logic diagram and truth table&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;Of course, like any logic circuits, there are variations optimized for different applications, including Ripple Carry Adder, Carry Look Ahead, and Carry Save Adders.&lt;/p&gt;
&lt;p&gt;We can also use the same adders for subtraction, if we use the twos complement number system to represent signed numbers.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5gi" class="xbold"&gt;- 8.3 Signed and Unsigned Number Systems&lt;/h3&gt;
&lt;p&gt;For those not familiar with signed and unsigned binary numbers, we&amp;#39;ll very briefly discuss them now. Simply stated, there are several number systems which allow us to represent both signed and unsigned number systems.&lt;/p&gt;
&lt;p&gt;Unsigned numbers are the simplest and we can represent a range of 0 to 2&lt;sup&gt;n&lt;/sup&gt;&amp;ndash;1, where n is the width of the bus. Unsigned numbers always represent positive numbers.&amp;nbsp; To represent signed numbers, we have a choice of several number systems, the most common being the Sign and Magnitude, Ones Complement, or Twos Complement.&lt;/p&gt;
&lt;p&gt;Sign and Magnitude utilizes the left most bit (often called the most significant bit) to represent the sign of the number (0 = positive, 1 = negative), and the remainder of the bits represent the magnitude.&lt;/p&gt;
&lt;p&gt;In the Sign and Magnitude system, both positive and negative numbers have the same magnitude; however, the sign bit differs. Due to this it is possible to have both a positive and negative zero within the Sign and Magnitude system.&lt;/p&gt;
&lt;p&gt;Ones Complement uses the same unsigned representation for positive numbers as the Sign and Magnitude representation. However, for negative numbers, the inversion (ones complement) of the positive number is used.&lt;/p&gt;
&lt;p&gt;Twos Complement is the most widely used encoding scheme for representing signed numbers. Just like Sign and Magnitude and Ones Complement schemes, positive numbers are represented in the same manner as an unsigned number. While negative numbers are represented as the binary number, you add to a positive number of the same magnitude to get zero. A negative twos complement number is calculated by first taking the ones complement (inversion) of the positive number and then adding one to it. The twos complement number system allows subtraction of one number from another by performing an addition of the two numbers. The range a twos complement number can represent is given by: &lt;strong&gt;-(2&lt;sup&gt;n-1&lt;/sup&gt;) to + (2&lt;sup&gt;n-1&lt;/sup&gt;&amp;ndash;1)&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;One method we can use to convert a number to its twos complement format is to work right to left, leaving the number the same until the first one is encountered; after this each bit is inverted.&lt;a name="sec9" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5gj" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;9. Sequential Circuits&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;Combinatorial logic circuits are unable to implement functions that require knowledge of their previous inputs or decisions as they contain no memory/storage elements.&lt;/p&gt;
&lt;p&gt;In contrast, sequential circuits&amp;#39; outputs are based upon not only current inputs but also previous inputs and decisions. Sequential logic circuits achieve this by using storage elements called flip flops, the simplest of which is the D Type flip flop. The value stored in the flip flop is updated at a regular interval as indicated by the clock signal.&lt;/p&gt;
&lt;center&gt;
&lt;div class="xs-mr5 align-middle" style="display:inline-block;width:180px;"&gt;&lt;img loading="lazy" alt="diagram 18" src="/e14/assets/legacy/2018/diagram18_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle" style="display:inline-block;width:200px;"&gt;
&lt;table class="xs-border xs-p1 xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" colspan="2"&gt;&lt;strong&gt;Inputs&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" colspan="2"&gt;&lt;strong&gt;Outputs&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;CK&lt;/td&gt;
&lt;td class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;D&lt;/td&gt;
&lt;td class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;Q&lt;/td&gt;
&lt;td class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;span style="text-decoration:overline;"&gt;Q&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;X&lt;/td&gt;
&lt;td class="xs-border xs-p1" colspan="2"&gt;No Change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 18: D Flip-flop and truth table&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;This ability to store states within our logic design allows more complex logic structures to be implemented. It also aids timing as the output of the combinatorial logic circuit must be stable just before the clock is applied to the Flip Flop to store the next value, thereby eliminating glitches. But as we will see this introduces more issues as well, especially when there are multiple layers of logic between flip flops.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5gk" class="xbold"&gt;- 9.1 Half Adder in a Synchronous Design&lt;/h3&gt;
&lt;p&gt;In this example, you can see the two-clock cycle delay between the application of an input and the generation of the output. The first clock cycle stores the inputs A and B in the first flip flops. The output of these flip flops will then be passed through the combinatorial logic, in this case, the half adder. The output of the half adder is then stored into the second rank of flip flops and output on the second clock cycle.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:350px;"&gt;&lt;img loading="lazy" alt="diagram 19a" src="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3" /&gt;
&lt;h5&gt;Figure 19a: Example Half Adder in a synchronous design (clock is shown in orange).&lt;/h5&gt;
&lt;/div&gt;
&lt;div class="align-middle" style="display:inline-block;"&gt;&lt;img loading="lazy" alt="diagram 19b" src="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4" /&gt;
&lt;h5&gt;Figure 19b: Timing Diagram for the example Half Adder in a synchronous design above.&lt;/h5&gt;
&lt;/div&gt;
&lt;/center&gt;
&lt;h3 id="mcetoc_1i1b4hg5gl" class="xbold"&gt;- 9.2 Shift Registers and Counters&lt;/h3&gt;
&lt;p&gt;The three most commonly implemented sequential logic design structures are shift registers, counters, and state machines.&lt;/p&gt;
&lt;p&gt;Shift registers in their basic form are a collection of Flip Flops where the output of one flip flop feeds the input of the next flip flop. Signals are then progressed through the shift register on each clock. We can use shift registers for a range of things in our logic design from delays (although there are better ways to implement delays) to metastability synchronizers, as well as conversion between serial and parallel and the generation of random numbers using feedback correctly.&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" alt="diagram 20" src="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2" /&gt;
&lt;h5&gt;Figure 20: Shift Register and associated timing diagram.&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;In many designs, we need to time events or introduce delays between the generation or issuing of signals. We do this by using a counter. In this application, we use the flip flops to store the count and combinatorial logic to determine the next value of the count based upon the current value.&lt;/p&gt;
&lt;div class="xs-mr3" style="float:left;width:260px;"&gt;&lt;img loading="lazy" alt="diagram 21" src="/e14/assets/legacy/2018/diagram21_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 21: Four-bit counter state diagram&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;The first stage in the development of a counter is to create a simple state diagram which shows the counter behavior.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;
&lt;div class="xs-mr3" style="float:left;width:320px;"&gt;
&lt;table class="xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Present A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Present B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Next A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Next B&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 22: Present State, Next State Table for the counter&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;Once the state diagram is created, we can then create a present state, next state table and extract from it the logic equations to implement the counter. Of course, while the example counts in sequential binary, if we desired, we could have the counter count in gray code, etc.&lt;/p&gt;
&lt;p&gt;With the present state, next state table (PS, NS) created, we can then create the logic equations needed to create in combinatorial logic. If necessary we can use Karnaugh-maps, etc. However, for this simple example we can work directly from the present state, next state table.&lt;/p&gt;
&lt;p&gt;With the PS, NS table, we create a logic equation for each of the next states, e.g. next A. As such the equations are: &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;Next A = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;Next B = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;From these equations we can generate the logic circuit which contains the D Type flip flops and logic gates.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:300px;"&gt;&lt;img loading="lazy" alt="diagram 23a" src="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:300px;"&gt;&lt;img loading="lazy" alt="23b" src="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;h5&gt;Figure 23: Logic Design for a two-bit counter.&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;Along with counters, logic designs are often called upon to perform sequence and control-based actions. These actions and sequences are best addressed using a state machine.&lt;/p&gt;
&lt;h3 id="mcetoc_1i1b4hg5gm" class="xbold"&gt;- 9.3 State Machines&lt;/h3&gt;
&lt;p&gt;State machines are logical constructs that transition between a finite number of states, like a counter; however, the path through the states is not sequential. A state machine will only be in one state at a point in time. It will transition between states depending upon several triggers, e.g. inputs or counter values, etc.&lt;/p&gt;
&lt;p&gt;Theoretically, state machines are divided into two basic classes: Moore and Mealy. They differ only in how the state machine&amp;#39;s outputs are generated.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Moore:&lt;/strong&gt; State Machine outputs are a function of the present state only. A classic example is a counter.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mealy:&lt;/strong&gt; State Machine outputs are a function of the present state and inputs. A classic example is the &lt;a class="jive-link-external-small" href="http://en.wikipedia.org/wiki/Richards_controller" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;Richards Controller&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When we are faced with the task of defining a state machine, we will develop a state diagram as we would do for a counter. The state diagram shows the states, inputs, and the transitions between the states and the outputs from the state machine. Figure 24 demonstrates the two types of state diagrams: one for a Moore State Machine (left), the other a Mealy State Machine (right).&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:200px;"&gt;&lt;img loading="lazy" alt="diagram 24a" src="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:200px;"&gt;&lt;img loading="lazy" alt="diagram 24b" src="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;h5&gt;Figure 24: State Diagrams for a Moore (left) and Mealy (right) State Machine.&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;If we were to implement these in logic gates and flip flops we would generate a present state, next state table, as we did for the previous counter example, and then create the logic equations for each of the state variables. The only difference is that, along with the current state, the present state, next state table will also have to consider the inputs and outputs for the state machine.&lt;a name="sec10" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5gn" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;10. Programmable Logic with FPGAs&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;So far, we have looked at how we create logic designs and implement them with discrete logic gates and flip flops. However, the most common way of implementing a logic design is using a programmable logic device (PLD) such as a Complex Programmable Logic Device (CPLD) or a Field Programmable Gate Array (FPGA). These devices enable the implementation of large logic designs and, depending upon the technology of the device used, they can be reprogrammed in the field.&lt;/p&gt;
&lt;p&gt;Programmable logic devices are available in three different technologies:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;SRAM:&lt;/strong&gt; The FPGA program is stored in an external memory and loaded into the FPGA each time it is powered.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;FLASH:&lt;/strong&gt; The FLASH architecture of the FPGA also contains the program; no external memory device is needed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One Time Programmable (OTP):&lt;/strong&gt; The FPGA is applied by blowing fuses in the device. Once programmed, it cannot be modified.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Typically, SRAM-based programmable logic is used where high performance is required, while Flash-based devices are used in middle-to-low performance applications. While one time programmable devices are very limited in application, they still remain popular in space applications.&lt;/p&gt;
&lt;p&gt;The key to programmable logic is how logic equations are implemented in the device. It is of course very difficult for the device designers to include a range of AND, OR gates, etc. as the number of each gate type will vary with each application. This will result in either many unused gates or a shortage of a needed gate type. Either way it would not be an efficient method for the implementation of a programmable logic device.&lt;/p&gt;
&lt;p&gt;Device manufacturers addressed this challenge in a very smart manner. In place of discrete gates, they use a several input look up table (LUT) which is programmed to implement the combinatorial logic equations. In many respects, this LUT is very similar to a multiplexer. Let&amp;#39;s take a quick look at how we can use a LUT to implement logic equations.&lt;/p&gt;
&lt;p&gt;Using the same truth table as for the previous example, we can set the LUT inputs to either ground or VCC depending upon the truth table&amp;#39;s needs. We can then use the logic equation inputs (A,B,C) to drive the LUT selection inputs to output the correct value for that particular input combination implementing the desired logic equation.&lt;/p&gt;
&lt;center&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:250px;"&gt;&lt;img loading="lazy" alt="diagram 25" src="/e14/assets/legacy/2018/diagram25_PrgLogic1.png" /&gt;&lt;/div&gt;
&lt;div class="align-middle xs-mr5" style="display:inline-block;width:320px;"&gt;
&lt;table class="xs-text-5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;" width="25%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;0&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;td class="xs-border xs-p1"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h5&gt;Figure 25: Setting the LUT&amp;#39;s Inputs to the Truth Table&lt;/h5&gt;
&lt;/center&gt;
&lt;p style="clear:both;"&gt;Using a LUT inside our programmable device therefore provides the best flexibility to implement a wide range of logic equations.&lt;/p&gt;
&lt;p&gt;Of course, we do not want to just implement the combinatorial logic circuits. We also want to implement sequential structures. This means that following the LUT there needs to be a flip flop to act as storage for the combinatorial output such that we can implement sequential structures.&lt;/p&gt;
&lt;p&gt;This combination of a LUT and Flip Flop is often called a Configurable Logic Block (CLB). A programmable logic device will consist of many thousands of CLBs. To provide the most flexibility, additional multiplexers will be used to support a wide range of CLB configurations.&lt;/p&gt;
&lt;center&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 26" src="/e14/assets/legacy/2018/diagram26_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 26: Very Basic Logic Slice&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;Obviously, modern devices have very complex CLB structures, which include local memory, fast carry inputs, arithmetic functions, and shift registers.&lt;/p&gt;
&lt;p&gt;Of course, these CLB&amp;#39;s need to be interconnected, which is where the device interconnect comes in, which allows the output of one CLB to be connected to the input of another CLB and eventually to the Input/Output of the device.&lt;/p&gt;
&lt;p&gt;This routing can be considered at two elements. First, there is global routing, which distributes global signals such as clocks. These are global specialist routing networks designed to be low skew and support high fan outs. This dedicated clocking network might be further split between truly global routes across the device and several additional regional limited routes to a specific area of the device. For all other signals, the programmable interconnect is used, which connects the CLBs to each other and other specialist functions within the device. To connect CLBs together it uses a switch matrix, which is configured to provide the internal routing between CLBs.&lt;/p&gt;
&lt;p&gt;One of the key drivers of programmable logic technology development was the reduction in the cost of transistors.&amp;nbsp; However, interconnect wires also played a role in enabling much larger devices at reduced cost.&amp;nbsp; When we develop programmable logic applications we spend a lot of time and effort optimizing the performance of the design with regards to its routing to ensure we can operate at the desired clock frequency.&lt;/p&gt;
&lt;div class="xs-mr3" style="float:left;width:300px;"&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 27" src="/e14/assets/legacy/2018/diagram27_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 27: CLB and Routing matrix&lt;/h5&gt;
&lt;/div&gt;
&lt;p&gt;To get signals on and off the chip, programmable logic devices also provide IO cells, which are configurable. These enable the device to support a range of single-ended logic standards, e.g. LVCMOS2v4, LVCOM 1V5, etc., Stub Series Terminated Logic (SSTL) as used for High Speed DDR interfaces, and a range of differential standards, including Low Swing Differential Voltage Signaling (LVDS).&lt;/p&gt;
&lt;p&gt;Many devices also include complex structures in the IO cells to allow for double data rate signals, source synchronous designs, bus skew correction, and conversion to/from serial. Electrically, the IO can control slew rates, drive strengths and even match the impedance with the transmission line, all of which are controlled by the developer. This means that given the right PHY on the board, using programmable logic, we can achieve any-to-any interconnectivity.&lt;a name="sec11" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="mcetoc_1i1b4hg5go" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;11. Hardware Description Languages&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;hr style="margin:0;" /&gt;
&lt;p&gt;Thanks to the sheer scale of resources offered by programmable logic we cannot any longer design at the gate level like we have done previously. It would simply take too long to develop applications which can leverage the resources provided by the programmable device at the gate level. In the place of developing by using logic equations, we use Hardware Description languages (HDL) such as Verilog or VHDL.&lt;/p&gt;
&lt;p&gt;When we work with these languages, we do not describe the logic equations, but rather the desired behavior at the register transfer level (RTL). This allows us to define the functionality of the programmable logic device.&lt;/p&gt;
&lt;p&gt;How our description gets translated from our HDL file into the logic equations and implemented in the programmable logic device requires several stages.&lt;/p&gt;
&lt;table class="xs-border xs-p1 xs-text-5 xs-mb5" style="clear:both;"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="xs-border xs-p1 text-white" style="background-color:#007fac;"&gt;&lt;strong&gt;Synthesis&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;The conversion of the HDL file into logic equations often targeted at the specific resources of the programmable logic device.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="xs-border xs-p1 xs-text-5 xs-mb5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="text-white xs-border xs-p1" style="background-color:#f17c0e;"&gt;&lt;strong&gt;Placing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;Placing of the identified logic cells (LUT, Flip Flops, etc.) into the programmable logic CLBs.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="xs-border xs-p1 xs-text-5 xs-mb5"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class="text-white xs-border xs-p1" style="background-color:#003082;"&gt;&lt;strong&gt;Routing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="xs-border xs-p1"&gt;Connecting together the placed CLBs to achieve the required performance.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h5&gt;Figure 28: Stages to Convert HDL File into Logic Equations&lt;/h5&gt;
&lt;p&gt;Each stage often requires addition constraints to ensure the desired timing is achieved or the correct IO standards are used.&lt;/p&gt;
&lt;p&gt;What developers who are used to using VHDL and Verilog will be familiar with is that not all constructs / commands within a language can be synthesized. Therefore, there is only a subset of language commands and coding structures which can be synthesized into a programmable logic device successfully. The remaining elements of the HDL language which are not synthesizable are used in the verification of the design before we implement it in the device.&lt;/p&gt;
&lt;p&gt;This verification is called the development of a test bench which ensures the Unit Under Test (UUT) meets its specification and is suitable for its intended purpose. When it comes to test benching, we have a couple of choices as to how we perform it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Functional Simulation only:&lt;/strong&gt; This checks if the design is functionally correct.&amp;nbsp; It does not include internal device timing delays such as propagation delays, which may affect performance when implemented in the device.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Gate Level Simulation:&lt;/strong&gt; This verifies the functionality of the design when back annotated with timing information from the final implemented design. This can take considerable time to perform.&lt;/li&gt;
&lt;/ul&gt;
&lt;center&gt;&lt;img loading="lazy" class="nolightbox" alt="diagram 29" src="/e14/assets/legacy/2018/diagram29_PrgLogic1.png" /&gt;
&lt;h5&gt;Figure 29: Example Test Bench architecture&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;Let&amp;#39;s look at how we would implement a state machine using the VHDL Language. Learning VHDL itself is a short course; however, we can briefly introduce the basics here.&lt;/p&gt;
&lt;p&gt;A VHDL file is split into two distinct elements, the entity and the architecture. The entity defines the input and outputs of the VHDL module and if it is at the top level of the design. It represents the inputs and outputs of the programmable logic device itself.&lt;/p&gt;
&lt;p&gt;The architecture defines the functionality and consists of either sequential statements, which are all executed in parallel or processes.&lt;/p&gt;
&lt;p&gt;Processes execute sequentially from top to bottom, more like in a traditional programming application. However, there are rules around when signals update during the process. Additionally, each process in the architecture runs in parallel as you are describing logic functions.&lt;/p&gt;
&lt;table style="clear:both;" width="100%"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="padding-right:15px;"&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;; &lt;br /&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state only&lt;/span&gt; &lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;; &lt;br /&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state and inputs&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;center&gt;
&lt;h5&gt;Figure 30: VHDL Architecture which shows the implementation of the state machines in the above example&lt;/h5&gt;
&lt;/center&gt;
&lt;p&gt;In the above example, the process runs each time the clock or reset is changed. This is defined in the sensitivity list of the process declaration.&lt;/p&gt;
&lt;p&gt;In these examples, the reset is asynchronous and used to reset the current state and the output, while the next actions only occur following the rising edge of the clock. Where the state machine progresses through each state depends upon its inputs and current state, moving if necessary to the next state.&lt;/p&gt;
&lt;p&gt;What this demonstrates is that, using programmable logic and HDL, we can directly code the state machine or counter from the state diagram and without the need to create the logic equations. Indeed, we let the synthesis tool do that for us.&lt;/p&gt;
&lt;center&gt;
&lt;h5 style="clear:both;"&gt;*Trademark. &lt;strong&gt;Xilinx is a trademark of AMD Corp.&lt;/strong&gt; Other logos, product and/or company names may be trademarks of their respective owners.&lt;/h5&gt;
&lt;/center&gt;&lt;center&gt;
&lt;p class="xs-border-bottom xs-pb2"&gt;Shop our wide range of &lt;strong&gt;FPGAs, SoCs, EVMs, application specific kits, embedded development boards, and more.&amp;nbsp;&lt;span &gt;&lt;a class="e14-button e14-button--primary e14-button--large" href="https://referral.element14.com/OrderCodeView?url=%2Fsearch%3Fst%3Damd%2520programmable%2520logic&amp;COM=e14c-essentials-prgmdevice1-doc&amp;CMP=e14c-essentials-prgmdevice1-doc&amp;osetc=e14c-essentials-prgmdevice1-doc" title="Shop Now" title="Shop Now" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;h2 id="mcetoc_1i1b4hg5gp" class="xbold" style="color:#007fac;display:inline-block;vertical-align:middle;width:75%;"&gt;&lt;a name="test" rel="noopener noreferrer nofollow" target="_blank" data-e14adj="t"&gt;&lt;/a&gt;Test Your Knowledge&lt;/h2&gt;
&lt;div class="xbold" style="display:inline-block;font-size:11px;text-align:right;vertical-align:middle;width:24%;"&gt;&lt;a href="#top" data-e14adj="t"&gt;Back to Top&lt;/a&gt;&lt;/div&gt;
&lt;div class="xs-float-left xs-mr2 xs-b2"&gt;            
&lt;style&gt;
   .e14-achievement-name{font-size:14px;font-weight:700;text-align:center;height:40px;margin:0;padding:5px}.e14-avatar{width:50% !important;margin:auto;border-radius:500px}.e14-avatar img{border-radius:543px}.e14-progress-bar{height:12px;border-radius:6px;background-clip:padding-box;background:#3575c2}.e14-achievement-thumb{height:200px}.e14-achievement-criteria{font-size:10px !important;overflow:hidden;margin-bottom:10px;line-height:1.5;height:60px}.e14-achievement-criteria p{font-size:10px !important;overflow:hidden;margin-bottom:10px;line-height:1.5;height:60px}.e14-achievement-criteria.complete{height:38px}.e14-achievement-criteria.complete p{height:38px}.e14-greyout{-webkit-filter:grayscale(90%);-moz-filter:grayscale(90%);-o-filter:grayscale(90%);-ms-filter:grayscale(90%);filter:grayscale(90%)}.e14-complete{float:right;margin-top:-20px;padding-right:5px;margin-bottom:12px;font-weight:700;color:dimgray}.e14-achievement-status{margin:5px}.shimmer{position:relative;overflow:hidden;background:#f6f7f8;background:linear-gradient(-45deg,#eee 40%,#fafafa 50%,#eee 60%);background-size:300%;background-position-x:100%;animation:shimmer 8s infinite linear}@keyframes shimmer{0%{background-position:-1000px 0}
100%{background-position:1000px 0}}
@media only screen and (max-width:480px){.e14-achievement-criteria{display:none}.e14-complete{font-size:9px}.e14-user-achievement{width:100px !important;height:150px !important}.e14-achievement-status{margin-top:15px}.e14-achievement-thumb{height:130px}.e14-achievement-name{font-size:10px}} 
&lt;/style&gt;

    &lt;div id="embed-f00e71d57f6b42ba9564a085c0480d7a_thumbnails" data-columnclass="thumbnail-column"&gt;
        &lt;div class="content thumbnail e14-user-achievement" data-href="/achievements/241fc2d8-ae75-4111-8616-7ed062a852fa" style="border: 3px solid #8d8d8d;cursor: pointer;"&gt;
        	       &lt;h2 class="name e14-achievement-name"&gt;
    		            Programmable Device 1&lt;br&gt;
    		       &lt;/h2&gt;
    			&lt;div class="e14-avatar e14-greyout"&gt;
    				&lt;img loading="lazy" src="https://community-storage.element14.com/communityserver-components-imagefileviewer/achievements/241fc2d8ae75411186167ed062a852fa/Programmable%20Device%201.png-140x140x2.png?_=9b9y946HOQq0GkkO1wsnuA==" style="width: 140px;max-height:140px;overflow:hidden;background:url(&amp;#39;https://community-storage.element14.com/communityserver-components-imagefileviewer/achievements/241fc2d8ae75411186167ed062a852fa/Programmable%20Device%201.png-140x140x2.png?_=9b9y946HOQq0GkkO1wsnuA==&amp;#39;) center center no-repeat;background-size:cover;aspect-ratio:140/140" alt="Programmable Device 1" border="0" /&gt;
    		    &lt;/div&gt;
    		    &lt;div style="padding:5px;"&gt;
    		        &lt;div title="Complete our Essentials: Programmable Device 1 course, earn 100% on the quiz and give the page a star rating to earn this badge!" class="e14-achievement-criteria"&gt;Complete our Essentials: Programmable Device 1 course, earn 100% on the quiz and give the page...&lt;/div&gt;
    		        
    		    &lt;/div&gt;
    		&lt;/div&gt;
    &lt;/div&gt;   
&lt;/script&gt;&lt;/div&gt;
&lt;p&gt;Are you ready to demonstrate your Essentials of Programmable Logic knowledge? &lt;strong&gt;Then take a quick 15-question, multiple-choice quiz to see how much you&amp;#39;ve learned from this Programmable Devices module.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To earn the Programmable Devices I Badge&lt;/strong&gt;, read through the module to learn all about Programmable Logic, attain 100% in the quiz at the bottom, and leave us some feedback in the comments section.&lt;/p&gt;
&lt;p&gt;&lt;div class="voltquiz" data-formid="0fcd3450-c4f3-4322-8af1-4b03e66c0ed0" data-formtype="quiz" data-success-message="" data-fail-message="" data-pass-mark="OTk=" &gt;&lt;/div&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="e14-quiz-document-metadata e14-init-hidden"&gt;&lt;/div&gt;
&lt;h5&gt;&lt;a href="/learn/learning-center/online-learning/essentials/" data-icid="essentials-programdevice1-doc" data-e14adj="t"&gt;&lt;img loading="lazy" class="xs-align-middle" alt="essentials logo" src="/e14/assets/legacy/2017/learningess.png" width="175px" /&gt;&lt;/a&gt; Sponsored by &lt;a href="/products/manufacturers/amd" data-icid="essentials-programdevice1-doc" data-e14adj="t"&gt;&lt;img loading="lazy" class="essSponsor xs-align-middle xs-ml2" title="AMD" alt="amd Logo" src="/e14/assets/main/mfg-group-assets/xilinxLogo.png" width="100px" /&gt;&lt;/a&gt;&lt;/h5&gt;
&lt;p&gt;&lt;div class="e14-navigation-buttons"&gt;&lt;a href="/learn/learning-center/essentials?ICID=essentials-programdevice1-doc"&gt;
                    &lt;button class="e14-nav-button-prev"&gt;Previous&lt;/button&gt;
                &lt;/a&gt;&lt;a href="/learn/learning-center/essentials/w/documents/4109/programmable-socs?ICID=essentials-programdevice1-doc"&gt;
                    &lt;button class="e14-nav-button-next"&gt;Next&lt;/button&gt;
                &lt;/a&gt;&lt;/div&gt;&lt;script&gt;e14.func.queueScripts.add(function(){ e14.func.repositionNavButtons(); })&lt;/script&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: fpga_essentials, programmable_devices, xilinx_essentials, xilinx, fpga, programmable_device, programmable_logic, ess_module&lt;/div&gt;
</description></item><item><title>Programmable Devices: Programmable Logic</title><link>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic/revision/6</link><pubDate>Sun, 27 Feb 2022 19:48:49 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:722dc523-e66e-42a7-84b5-de3f2731c4d8</guid><dc:creator>pchan</dc:creator><comments>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic#comments</comments><description>Revision 6 posted to Documents by pchan on 2/27/2022 7:48:49 PM&lt;br /&gt;
&lt;p&gt;&lt;span&gt;&lt;div class="e14-navigation-buttons"&gt;&lt;a href="/learn/learning-center/essentials?ICID=essentials-programdevice1-doc"&gt;
                    &lt;button class="e14-nav-button-prev"&gt;Previous&lt;/button&gt;
                &lt;/a&gt;&lt;a href="/learn/learning-center/essentials/w/documents/4109/programmable-socs?ICID=essentials-programdevice1-doc"&gt;
                    &lt;button class="e14-nav-button-next"&gt;Next&lt;/button&gt;
                &lt;/a&gt;&lt;/div&gt;&lt;script&gt;e14.func.queueScripts.add(function(){ e14.func.repositionNavButtons(); })&lt;/script&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style="background-color:#f9f9f9;border:1px solid #c6c6c6;display:block;float:right;padding:6px 8px;width:212px;"&gt;&lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/learn/learning-center/?ICID=essentials-programdevice1-doc"&gt;element14 Learning Center&lt;/a&gt;&lt;/div&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="border:1px solid #c6c6c6;clear:both;padding:8px;"&gt;
&lt;div style="display:inline-block;padding-right:16px;vertical-align:top;"&gt;&lt;a href="/learn/learning-center/online-learning/essentials/?ICID=essentials-programdevice1-doc"&gt;&lt;img alt="image"  src="/e14/assets/legacy/2017/learningess.png" width="175px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;"&gt;
&lt;p class="essTitle" style="font-size:18px;font-weight:bold;margin:0;" title="Programmable Logic"&gt;&lt;span style="color:#007fac;"&gt;Programmable Devices I: &lt;/span&gt; Programmable Logic&lt;/p&gt;
&lt;p style="margin:0;padding:8px;"&gt;&lt;span style="font-size:11px;padding-right:10px;"&gt;&lt;em&gt;Sponsored by&lt;/em&gt;&lt;/span&gt;&lt;a href="http://www.xilinx.com/" rel="nofollow ugc noopener noreferrer" target="_blank"&gt;&lt;img loading="lazy" alt="image" class="essSponsor" style="vertical-align:top;" title="Xilinx"  height="25px" src="/e14/assets/main/mfg-group-assets/xilinxLogo.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;div style="clear:both;line-height:1.5;"&gt;&lt;span style="padding-right:6px;"&gt;&lt;a class="jive-link-anchor-small" href="#intro"&gt;1. Introduction&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#object"&gt;2. Objectives&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec3"&gt;3. Boolean Algebra&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec4"&gt;4. Logic Gates&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec5"&gt;5. Transistor Implementation of a Gate&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec6"&gt;6. Propagation Delay&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec7"&gt;7. Combinatorial Circuit Example&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec8"&gt;8. Arithmetic in Logic&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec9"&gt;9. Sequential Circuits&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec10"&gt;10. Programmable Logic with FPGAs&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec11"&gt;11. Hardware Description Languages&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-wiki-small" href="/learn/learning-center/online-learning/essentials/w/documents/3803/related-components-dev-boards-for-element14-essentials-programmable-devices-i"&gt;Related Components &amp;amp; Dev Boards&lt;/a&gt;&lt;/span&gt; | &lt;span style="font-weight:bold;padding:0px 6px;"&gt;&lt;a href="#test"&gt;Test Your Knowledge &lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/LinkArrow.gif" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="color:#007fac;font-size:15px;margin:0;padding:8px 0px;"&gt;&lt;a name="intro"&gt;&lt;/a&gt;&lt;strong&gt;1. Introduction&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;The world and our interaction with it is analog. Our surrounding environment, colors in the electromagnetic spectrum, speech, and sound all are represented by continuously changing analog values. When it comes to processing these analog signals, however, digital systems offer several benefits to a traditional analog processing solution. For example, they have higher performance, ease of storage and transmission, and better noise immunity. As such, while the world is analog, it is mainly processed digitally using logic circuits. In this learning module, you will be introduced to the essentials of logic design, and how it can be implemented using programmable logic.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="object"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin:0;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;&lt;strong&gt;2. Objectives&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 8px 35px;"&gt;&lt;em&gt;Upon completion of this module, you will be able to:&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Perform some fundamental operations of Boolean algebra&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Explain the operation and truth tables of common logic gates&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Illustrate how combinatorial circuits are designed&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Discuss the differences between combinatorial and sequential circuits&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Understand how shift registers, counters, and state machines operate&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Explain the basic structures of PLDs&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Describe the role of HDLs&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec3"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;3. Boolean Algebra&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The key foundation of digital logic is Boolean Algebra. Without understanding it we cannot produce effective logic designs or understand the outputs of higher level tools such as synthesis engines.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Boolean algebra is named after its inventor, George Boole, who in 1854 published his work entitled, &amp;quot;An investigation of the laws of thought on which are founded the mathematical theories of logic and probabilities.&amp;quot; This work was later used by Claude Shannon in his 1937 master&amp;#39;s thesis at MIT entitled, &amp;quot;A Symbolic Analysis of Relay and Switching Circuits,&amp;quot; which demonstrated that switching circuits could solve all problems in the same manner as Boolean algebra. Thus, the relationship between switching circuits and Boolean algebra became the foundation of all digital applications.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.1 Boolean Addition and Multiplication&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1+0=1&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+1=1&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1+1=1&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As you can see, the result of the SUM is equal to one only when one or more of the literals is one.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Boolean multiplication produces the PRODUCT of the literals:&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.1=0&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1.1=1&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In this case, you can see the PRODUCT is equal to one only when both literals are equal to one.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Understanding the meaning of the SUM and PRODUCT terms will be important later when we examine logic gates and equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.2 Boolean Algebra Laws&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Just as in other areas of mathematics, Boolean algebra has several laws which we must understand, such as:&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Commutative Law:&lt;/strong&gt; The order of literals in Boolean addition does not affect the result: A+B=B+A&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Associative Law:&lt;/strong&gt; When performing Boolean addition of more than two literals, the result is the same regardless of grouping:&amp;nbsp; A+(B+C)=(A+B)+C&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Distributive Law:&lt;/strong&gt; Performing a Boolean addition of two or more literals before performing a Boolean multiplication on the result is the same as performing the Boolean multiplication with each literal before performing the Boolean Addition A(B+C)=AB+AC&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;These laws become very important when we design logic circuits and wish to optimize the number of logic gates we use in our solution.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Along with these laws we also have twelve rules of Boolean Logic with which we must become familiar. They are:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:white;padding:6px;" colspan="2"&gt;&lt;strong&gt;12 Boolean Logic Rules&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + 0 = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . A = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + 1 = 1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . 0 = 0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;a href="/e14/assets/legacy/2018/A2bars.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/A2bars.png" /&gt;&lt;/a&gt; = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . 1 = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + A.B = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + A = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B = A + B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;(A + B).(A+C) = A + B.C&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.3 DeMorgan&amp;#39;s Theorem&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The final remaining element we need to understand about Boolean Algebra is DeMorgan&amp;#39;s Theorem which states, &amp;quot;The complement of a product of sums is equal to the sum of the complements.&amp;quot;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This is better shown represented as an equation: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A good mnemonic device to remember this is: &amp;quot;break the bar, change the sign.&amp;quot;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, now that we understand Boolean algebra, we want to be able to see how it maps to the logic gates we use to implement digital circuits.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec4"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;4. Logic Gates&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The seven commonly used logic gates in digital design are NOT, AND, OR, XOR, NOR, NAND and XNOR gates. In our designs we use combinations of these logic gates to implement the logic function. In this section, we&amp;#39;ll review these logic gates.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;At the lowest level these logic gates are made from arrangements of transistors; however, each arrangement has its own symbol and truth table, which shows for a given input what its outputs will be. (Note: For simplicity&amp;#39;s sake, except for the NOT gate, all gates are demonstrated with two inputs).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.1 NOT Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of the logic gates is the NOT gate. This gate simply inverts the logic value presented on the input.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram1_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:150px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NOT symbol &amp;amp; truth table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 1: NOT Gate&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.2 AND Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One of the most commonly used logic gates is the AND gate, which implements Boolean algebra multiplication and produces the PRODUCT of its inputs as we described earlier in this learning module.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram2_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram2_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;AND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 2: AND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.3 OR Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To implement Boolean addition and generate the SUM of its inputs, we use the OR Gate which uses the symbol as shown in Figure 3.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram3_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram3_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;OR Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 3: OR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The remaining logic gates are derivatives of the AND, OR, and NOT functions. However, the NAND and NOR gates have proven to be very popular due to their universality, which allows any logic gate&amp;mdash;AND, OR, NOT&amp;mdash;to be implemented using these two gates. We will look at exactly how we can do this in an example further on in this learning module.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.4 NAND Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of the gates is the NAND gate, which stands for Not AND. This can be represented by an AND gate followed by a NOT gate. However, it is normally shown as an AND gate with an inversion bubble on its output.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram4_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram4_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NAND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 4: NAND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.5 NOR Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A similar logic gate is the NOR gate, which is also a universal gate and represents the NOT OR function. We represent the NOR symbol as the OR gate with an inversion bubble.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram5_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram5_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NOR Symbol and Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 5: NOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.6 XOR and XNOR Gates&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The final two gates are the XOR and XNOR gates, which are constructed from logic gates already introduced. However, they provide very useful functions allowing us to determine if both inputs agree (XNOR) or both inputs differ (XOR).&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;XOR Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 6a: XOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;XNOR Symbol &amp;amp; Truth Table &lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 6b: XNOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec5"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;5. Transistor Implementation of a Gate&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As mentioned earlier in this learning module, each of the logic gates consists of several transistors arranged to implement the desired logic gate.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:280px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram7_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram7_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 7: Transistor Level implementation of a NOT Gate&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of these is the NOT gate, which uses two complementary transistors to invert the input at its output. When the Input is high, transistor Q1 is turned off thanks to the inversion, while transistor Q2 is turned on pulling the output to ground, which is the opposite of the presented signal. Conversely, when the input is low, transistor Q2 is this time turned off, while Q1 is turned on, pulling the output to the power rail and outputting a logic high.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:280px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram8_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram8_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 8: Transistor level implementation of a AND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This NOT structure is also used in more complex gates such as the AND gate. Looking at the transistor level of the AND gate you will first notice the Output stage Q5 and Q6 is the same as for the NOT gate function.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When inputs A and B are both high, transistors Q1 and Q2 are turned on while Q3 and Q4 are turned off. This pulls the input to Q6 and Q5 low, which due to the inversion means Q5 turns on and Q6 turns off allowing the output to be set high. For all other combinations at least one of Q1, Q2, Q3 and Q4 is turned off ,which pulls the input to Q5 and Q6 high, as such turning on Q6 and off Q5 pulling the output low as would be expected for an AND logic gate.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec6"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;6. Propagation Delay&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we implement logic circuits, using logic gates, we call these combinatorial logic circuits as there is no storage or feedback. To ensure these circuits function as intended we also, need to understand what occurs when an input changes. As just demonstrated, logic gates are made up from arrangements of switching transistors, and as such it takes time for a change at an input to result in a change of the output.&amp;nbsp; We call this delay the PROPAGATION time and it will vary depending upon the logic family used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To ensure we are all on the same page, there are several different logic families, each implemented in different underlying technologies such as CMOS (Complementary Metal Oxide Semi-conductor) or TTL (Transistor to Transistor Logic). Each logic family will exhibit a different propagation delay, which will limit the switching frequency of the logic design. If we are testing in the lab, we measure the propagation delay between the mid-point (50%) of the rising and falling edges as shown below.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram1_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:255px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 9: Timing Diagram of NOT gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The propagation time is normally defined within the data sheet for the logic gate selected; however, it will often list two propagation times: one for the high to low transition and another for the low to high transition.&amp;nbsp; Of course, the propagation time will also be affected by the ambient temperature, changes in power supply conditions, resistance of the driver, and the capacitive load on the device output.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We call the output driving several devices inputs the FANOUT. The higher the fanout, the larger the loading, and, therefore, the slower the output rise and fall times. Typical values of propagation time in logic datasheets range from 5 ns to 35 ns, depending upon the logic family, minimum/maximum behavior, and loading conditions (FANOUT).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we develop our combinatorial circuit, which will typically consist of several levels of logic gates, due to the layer on gates, we need to be careful of the differing propagation delays, as differing propagation delays can lead to glitches in the output value which are not correct. This is one of the reasons that in many applications, combinatorial circuits are used with storage elements like D type flip flops and an associated clock to ensure the output does not glitch and is stable when it is presented to the next processing/decision element.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;However, if we are working purely with combinatorial circuits, we can also take some steps to mitigate these glitches, which are often referred to as RACE Hazards.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec7"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;7. Combinatorial Circuit Example&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The best way to demonstrate how we can pull together what we have learned so far about Boolean Algebra, Logic Gates, Propagation Delays, and Hazards is to outline a few simple examples.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;For the first example, we will create a system which monitors three motors. Each motor has a health indication output which is high when the motor has a fault. For the overall system to function correctly, at least two of the motors must be working correctly, therefore, we will create a system that outputs a logic high when two out of the three motors have asserted their fault outputs.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The first stage in developing this solution is to create a truth table that shows the possible input combinations and the correct output for each of those input conditions. As we have 3 inputs, then there are 2&lt;sup&gt;3&lt;/sup&gt; or eight possible combinations of the input:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:0px 15px 5px 0px;vertical-align:top;width:230px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="30%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 10: Truth Table for the motor monitoring system&amp;#39;s logic function&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;From this truth table we can generate the following logic equations: &lt;strong&gt;OP = (A.B) + (A.C) + (B.C)&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We call the format of this equation a SUM of PRODUCTS (SOP) equation as the OP is the Boolean SUM (Logical OR) of the Boolean PRODUCTS (AND) equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we so desired, we could calculate a PRODUCT of SUMS (POS) output by following the approach.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Firstly, we create the SOP logic equation for each entry on the truth table where the output is low: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;OP&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;A.C&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B.C&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;div style="padding-top:12px;"&gt;Next, we apply DeMorgan&amp;#39;s theorem to convert from the SOP to the POS format. The first step is to invert the SOP equation: &lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/PrgmLogicEQ1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can then apply DeMorgan&amp;#39;s theorem and the ninth law of logic to create the final POS equation: &lt;strong&gt;OP=(A+B).(A+C).(B+C)&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;For the remainder of this example, however, we will work with the SOP format as that is the most common method for implementing logic functions. As such, we can realize our SOP equation using a two-level logic circuit as below:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:8px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram11_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram11_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 11: Example Logic Circuit in SOP form&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With this two-level network, we need to consider the propagation delay through the first AND gate level and the impact it might have on the output.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, this implementation uses two logic gate types (AND, OR). But it is possible to implement the same logical function using only NAND gates, as they are universal.&amp;nbsp; Thanks to DeMorgan&amp;#39;s Theorem, the NAND gate also implements the Negative OR function: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:8px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram12_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram12_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 12: Example Logic Circuit in SOP form implemented using NAND Gates&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As such, we can redraw the logic circuit above.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Let&amp;#39;s look at how we get the same functionality using NAND gates. The output equation can be represented as: &lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ2.png"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/2018/PrgmLogicEQ2.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Using DeMorgan&amp;#39;s Theorem, we can iterate through the following steps, changing the sign as we break the bar and applying other rules of Boolean algebra:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2" /&gt;&lt;/a&gt;&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we are working with POS logic equations, we can use NOR gates to implement the logic equation and prove the functionality the same way using DeMorgan&amp;#39;s Theorem and Boolean Algebra rules.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the example above, we used a truth table to determine the logic equations and it works well for a simple application. However, if we have more complex applications we need a better way of determining the logic equations. This is where the Karnaugh-map (Kmap) comes into play. Kmaps are visual representations of the logic behavior which allow us to use our natural ability for pattern recognition to determine the logic equations.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 13: Example Karnaugh-map used for four variables (A,B,C,D). Note the gray scale count.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Karnaugh-maps are used by grouping together adjacent 1&amp;#39;s for SOP and adjacent 0&amp;#39;s for POS. These groupings can then be used to determine the logic equation, using the rules of Boolean Algebra to implement the desired functionality.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 14: Example of a Karnaugh-map: Grouping the 1s together.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Often, if we use a Karnaugh-map, we will obtain an equation which uses the minimum number of logic gates to implement. Using the example to the left we can group together the 1&amp;#39;s within the design where they are adjacent to each other.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The example groups together four 1&amp;#39;s within the center of the Karnaugh-map (highlighted green), and from this we can see that the logic equation is D.B as the C and A cancel each other out due to being across not C and C or not A and A, respectively.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The blue elements in the corner can also be grouped together as they are also judged to be adjacent, since the Karnaugh-map is judged to wrap around edge to edge and top to bottom. As such, the second equation to be extracted from the Karnaugh-map is C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;; therefore, the resulting logic equation for the Karnaugh-map is: &lt;strong&gt;OP = C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + D.B&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can also use Karnaugh-maps to identify hazards which might result in glitches during operation and help us eliminate them. In the next example, we can extract the logical equation for the green and blue cells as: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D&lt;/strong&gt;&lt;/p&gt;
&lt;div style="clear:both;float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;border-left:2px solid #D23620;border-right:2px solid #D23620;border-top:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;border-bottom:2px solid #D23620;border-left:2px solid #D23620;border-right:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 15: Karnaugh-maps: Identifying Potential Hazards&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;However, this leaves the equation highlighted by the red circle as a potential hazard, which occurs when the input D changes from a 1 to a 0. The output is intended to stay high; however, there is not a specific term in the logic equation to address it. To remove the hazard, we should update the logic equation. See in the additional equation where the red text is: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D + &lt;span style="color:#d23620;"&gt;&lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B.C.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;By this point now you should be familiar with Boolean Algebra, logic gates, how they relate to each other, and how they are used with truth tables and Karnaugh-maps to not only determine logic equations but also to identify race conditions. You should also understand how we can use universal gates for implementing logic equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the basics of Boolean Algebra and logic gates introduced, we can focus now on how to create logical structures which can be used in applications. As such, we are going to explore Half and Full Adders along with the basics of synchronous logic design, using flip flops and their application, to help us create counters, shift registers, and state machines.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec8"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;8. Arithmetic in Logic&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;There are times in logic design when we want to perform mathematical operations such as Addition, Subtraction, Multiplication, and Division. While how we do this and number systems we use can be a course on its own, the Half and Full Adder are the key logic circuits we use to achieve these and should be introduced here.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.1 Half Adder&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The Half Adder is so called as it adds two input variables, generating a sum and carry outputs; it has no ability to accept a carry-in from a previous adder.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram16_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram16_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:250px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 16: Half Adder logic diagram and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.2 Full Adder&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The Full Adder provides the ability to accept a carry-in and is therefore used more commonly when working with multi-bit buses in logic.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 20px 5px 0px;width:380px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram17_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram17_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:320px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry In&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry Out&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 17: Full Adder logic diagram and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, like any logic circuits, there are variations optimized for different applications, including Ripple Carry Adder, Carry Look Ahead, and Carry Save Adders.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can also use the same adders for subtraction, if we use the twos complement number system to represent signed numbers.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.3 Signed and Unsigned Number Systems&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;For those not familiar with signed and unsigned binary numbers, we&amp;#39;ll very briefly discuss them now. Simply stated, there are several number systems which allow us to represent both signed and unsigned number systems.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Unsigned numbers are the simplest and we can represent a range of 0 to 2&lt;sup&gt;n&lt;/sup&gt;&amp;ndash;1, where n is the width of the bus. Unsigned numbers always represent positive numbers.&amp;nbsp; To represent signed numbers, we have a choice of several number systems, the most common being the Sign and Magnitude, Ones Complement, or Twos Complement.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Sign and Magnitude utilizes the left most bit (often called the most significant bit) to represent the sign of the number (0 = positive, 1 = negative), and the remainder of the bits represent the magnitude.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the Sign and Magnitude system, both positive and negative numbers have the same magnitude; however, the sign bit differs. Due to this it is possible to have both a positive and negative zero within the Sign and Magnitude system.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Ones Complement uses the same unsigned representation for positive numbers as the Sign and Magnitude representation. However, for negative numbers, the inversion (ones complement) of the positive number is used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Twos Complement is the most widely used encoding scheme for representing signed numbers. Just like Sign and Magnitude and Ones Complement schemes, positive numbers are represented in the same manner as an unsigned number. While negative numbers are represented as the binary number, you add to a positive number of the same magnitude to get zero. A negative twos complement number is calculated by first taking the ones complement (inversion) of the positive number and then adding one to it. The twos complement number system allows subtraction of one number from another by performing an addition of the two numbers. The range a twos complement number can represent is given by: &lt;strong&gt;-(2&lt;sup&gt;n-1&lt;/sup&gt;) to + (2&lt;sup&gt;n-1&lt;/sup&gt;&amp;ndash;1)&lt;/strong&gt;.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One method we can use to convert a number to its twos complement format is to work right to left, leaving the number the same until the first one is encountered; after this each bit is inverted.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec9"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;9. Sequential Circuits&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Combinatorial logic circuits are unable to implement functions that require knowledge of their previous inputs or decisions as they contain no memory/storage elements.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In contrast, sequential circuits&amp;#39; outputs are based upon not only current inputs but also previous inputs and decisions. Sequential logic circuits achieve this by using storage elements called flip flops, the simplest of which is the D Type flip flop. The value stored in the flip flop is updated at a regular interval as indicated by the clock signal.&lt;/p&gt;
&lt;div style="float:left;"&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:180px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram18_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram18_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:160px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" colspan="2"&gt;&lt;strong&gt;Inputs&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" colspan="2"&gt;&lt;strong&gt;Outputs&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;CK&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;D&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;Q&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;span style="text-decoration:overline;"&gt;Q&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;X&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;" colspan="2"&gt;No Change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 18: D Flip-flop and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This ability to store states within our logic design allows more complex logic structures to be implemented. It also aids timing as the output of the combinatorial logic circuit must be stable just before the clock is applied to the Flip Flop to store the next value, thereby eliminating glitches. But as we will see this introduces more issues as well, especially when there are multiple layers of logic between flip flops.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.1 Half Adder in a Synchronous Design&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In this example, you can see the two-clock cycle delay between the application of an input and the generation of the output. The first clock cycle stores the inputs A and B in the first flip flops. The output of these flip flops will then be passed through the combinatorial logic, in this case, the half adder. The output of the half adder is then stored into the second rank of flip flops and output on the second clock cycle.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 25px 5px 0px;width:350px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 19a: Example Half Adder in a synchronous design (clock is shown in orange).&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:350px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 19b: Timing Diagram for the example Half Adder in a synchronous design above.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/center&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.2 Shift Registers and Counters&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The three most commonly implemented sequential logic design structures are shift registers, counters, and state machines.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Shift registers in their basic form are a collection of Flip Flops where the output of one flip flop feeds the input of the next flip flop. Signals are then progressed through the shift register on each clock. We can use shift registers for a range of things in our logic design from delays (although there are better ways to implement delays) to metastability synchronizers, as well as conversion between serial and parallel and the generation of random numbers using feedback correctly.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 20: Shift Register and associated timing diagram.&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In many designs, we need to time events or introduce delays between the generation or issuing of signals. We do this by using a counter. In this application, we use the flip flops to store the count and combinatorial logic to determine the next value of the count based upon the current value.&lt;/p&gt;
&lt;div style="float:left;padding:12px 20px 5px 0px;width:260px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram21_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram21_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 21: Four-bit counter state diagram&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The first stage in the development of a counter is to create a simple state diagram which shows the counter behavior.&lt;/p&gt;
&lt;div style="clear:both;float:left;padding:12px 20px 5px 0px;width:260px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Present A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Present B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Next A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Next B&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 22: Present State, Next State Table for the counter&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Once the state diagram is created, we can then create a present state, next state table and extract from it the logic equations to implement the counter. Of course, while the example counts in sequential binary, if we desired, we could have the counter count in gray code, etc.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the present state, next state table (PS, NS) created, we can then create the logic equations needed to create in combinatorial logic. If necessary we can use Karnaugh-maps, etc. However, for this simple example we can work directly from the present state, next state table.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the PS, NS table, we create a logic equation for each of the next states, e.g. next A. As such the equations are: &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;Next A = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;Next B = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;From these equations we can generate the logic circuit which contains the D Type flip flops and logic gates.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 25px 5px 0px;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 23: Logic Design for a two-bit counter.&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Along with counters, logic designs are often called upon to perform sequence and control-based actions. These actions and sequences are best addressed using a state machine.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.3 State Machines&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;State machines are logical constructs that transition between a finite number of states, like a counter; however, the path through the states is not sequential. A state machine will only be in one state at a point in time. It will transition between states depending upon several triggers, e.g. inputs or counter values, etc.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Theoretically, state machines are divided into two basic classes: Moore and Mealy. They differ only in how the state machine&amp;#39;s outputs are generated.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Moore:&lt;/strong&gt; State Machine outputs are a function of the present state only. A classic example is a counter.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Mealy:&lt;/strong&gt; State Machine outputs are a function of the present state and inputs. A classic example is the &lt;a class="jive-link-external-small" href="http://en.wikipedia.org/wiki/Richards_controller" rel="nofollow ugc noopener noreferrer" target="_blank"&gt;Richards Controller&lt;/a&gt;.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we are faced with the task of defining a state machine, we will develop a state diagram as we would do for a counter. The state diagram shows the states, inputs, and the transitions between the states and the outputs from the state machine. Figure 24 demonstrates the two types of state diagrams: one for a Moore State Machine (left), the other a Mealy State Machine (right).&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:200px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 24: State Diagrams for a Moore (left) and Mealy (right) State Machine.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we were to implement these in logic gates and flip flops we would generate a present state, next state table, as we did for the previous counter example, and then create the logic equations for each of the state variables. The only difference is that, along with the current state, the present state, next state table will also have to consider the inputs and outputs for the state machine.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec10"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;10. Programmable Logic with FPGAs&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;So far, we have looked at how we create logic designs and implement them with discrete logic gates and flip flops. However, the most common way of implementing a logic design is using a programmable logic device (PLD) such as a Complex Programmable Logic Device (CPLD) or a Field Programmable Gate Array (FPGA). These devices enable the implementation of large logic designs and, depending upon the technology of the device used, they can be reprogrammed in the field.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Programmable logic devices are available in three different technologies:&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;SRAM:&lt;/strong&gt; The FPGA program is stored in an external memory and loaded into the FPGA each time it is powered.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;FLASH:&lt;/strong&gt; The FLASH architecture of the FPGA also contains the program; no external memory device is needed.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;One Time Programmable (OTP):&lt;/strong&gt; The FPGA is applied by blowing fuses in the device. Once programmed, it cannot be modified.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Typically, SRAM-based programmable logic is used where high performance is required, while Flash-based devices are used in middle-to-low performance applications. While one time programmable devices are very limited in application, they still remain popular in space applications.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The key to programmable logic is how logic equations are implemented in the device. It is of course very difficult for the device designers to include a range of AND, OR gates, etc. as the number of each gate type will vary with each application. This will result in either many unused gates or a shortage of a needed gate type. Either way it would not be an efficient method for the implementation of a programmable logic device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Device manufacturers addressed this challenge in a very smart manner. In place of discrete gates, they use a several input look up table (LUT) which is programmed to implement the combinatorial logic equations. In many respects, this LUT is very similar to a multiplexer. Let&amp;#39;s take a quick look at how we can use a LUT to implement logic equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Using the same truth table as for the previous example, we can set the LUT inputs to either ground or VCC depending upon the truth table&amp;#39;s needs. We can then use the logic equation inputs (A,B,C) to drive the LUT selection inputs to output the correct value for that particular input combination implementing the desired logic equation.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram25_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram25_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:240px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 25: Setting the LUT&amp;#39;s Inputs to the Truth Table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Using a LUT inside our programmable device therefore provides the best flexibility to implement a wide range of logic equations.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Of course, we do not want to just implement the combinatorial logic circuits. We also want to implement sequential structures. This means that following the LUT there needs to be a flip flop to act as storage for the combinatorial output such that we can implement sequential structures.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;This combination of a LUT and Flip Flop is often called a Configurable Logic Block (CLB). A programmable logic device will consist of many thousands of CLBs. To provide the most flexibility, additional multiplexers will be used to support a wide range of CLB configurations.&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram26_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram26_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 26: Very Basic Logic Slice&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Obviously, modern devices have very complex CLB structures, which include local memory, fast carry inputs, arithmetic functions, and shift registers.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, these CLB&amp;#39;s need to be interconnected, which is where the device interconnect comes in, which allows the output of one CLB to be connected to the input of another CLB and eventually to the Input/Output of the device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This routing can be considered at two elements. First, there is global routing, which distributes global signals such as clocks. These are global specialist routing networks designed to be low skew and support high fan outs. This dedicated clocking network might be further split between truly global routes across the device and several additional regional limited routes to a specific area of the device. For all other signals, the programmable interconnect is used, which connects the CLBs to each other and other specialist functions within the device. To connect CLBs together it uses a switch matrix, which is configured to provide the internal routing between CLBs.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One of the key drivers of programmable logic technology development was the reduction in the cost of transistors.&amp;nbsp; However, interconnect wires also played a role in enabling much larger devices at reduced cost.&amp;nbsp; When we develop programmable logic applications we spend a lot of time and effort optimizing the performance of the design with regards to its routing to ensure we can operate at the desired clock frequency.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram27_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram27_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 27: CLB and Routing matrix&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To get signals on and off the chip, programmable logic devices also provide IO cells, which are configurable. These enable the device to support a range of single-ended logic standards, e.g. LVCMOS2v4, LVCOM 1V5, etc., Stub Series Terminated Logic (SSTL) as used for High Speed DDR interfaces, and a range of differential standards, including Low Swing Differential Voltage Signaling (LVDS).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Many devices also include complex structures in the IO cells to allow for double data rate signals, source synchronous designs, bus skew correction, and conversion to/from serial. Electrically, the IO can control slew rates, drive strengths and even match the impedance with the transmission line, all of which are controlled by the developer. This means that given the right PHY on the board, using programmable logic, we can achieve any-to-any interconnectivity.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec11"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;11. Hardware Description Languages&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Thanks to the sheer scale of resources offered by programmable logic we cannot any longer design at the gate level like we have done previously. It would simply take too long to develop applications which can leverage the resources provided by the programmable device at the gate level. In the place of developing by using logic equations, we use Hardware Description languages (HDL) such as Verilog or VHDL.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we work with these languages, we do not describe the logic equations, but rather the desired behavior at the register transfer level (RTL). This allows us to define the functionality of the programmable logic device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;How our description gets translated from our HDL file into the logic equations and implemented in the programmable logic device requires several stages.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Synthesis&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;The conversion of the HDL file into logic equations often targeted at the specific resources of the programmable logic device.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#f17c0e;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Placing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;Placing of the identified logic cells (LUT, Flip Flops, etc.) into the programmable logic CLBs.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#003082;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Routing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;Connecting together the placed CLBs to achieve the required performance.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 28: Stages to Convert HDL File into Logic Equations&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Each stage often requires addition constraints to ensure the desired timing is achieved or the correct IO standards are used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;What developers who are used to using VHDL and Verilog will be familiar with is that not all constructs / commands within a language can be synthesized. Therefore, there is only a subset of language commands and coding structures which can be synthesized into a programmable logic device successfully. The remaining elements of the HDL language which are not synthesizable are used in the verification of the design before we implement it in the device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This verification is called the development of a test bench which ensures the Unit Under Test (UUT) meets its specification and is suitable for its intended purpose. When it comes to test benching, we have a couple of choices as to how we perform it.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Functional Simulation only:&lt;/strong&gt; This checks if the design is functionally correct.&amp;nbsp; It does not include internal device timing delays such as propagation delays, which may affect performance when implemented in the device.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Gate Level Simulation:&lt;/strong&gt; This verifies the functionality of the design when back annotated with timing information from the final implemented design. This can take considerable time to perform.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram29_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram29_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 29: Example Test Bench architecture&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Let&amp;#39;s look at how we would implement a state machine using the VHDL Language. Learning VHDL itself is a short course; however, we can briefly introduce the basics here.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A VHDL file is split into two distinct elements, the entity and the architecture. The entity defines the input and outputs of the VHDL module and if it is at the top level of the design. It represents the inputs and outputs of the programmable logic device itself.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The architecture defines the functionality and consists of either sequential statements, which are all executed in parallel or processes.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Processes execute sequentially from top to bottom, more like in a traditional programming application. However, there are rules around when signals update during the process. Additionally, each process in the architecture runs in parallel as you are describing logic functions.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;table width="100%"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="padding-right:15px;"&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state only&lt;/span&gt; &lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state and inputs&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 30: VHDL Architecture which shows the implementation of the state machines in the above example&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the above example, the process runs each time the clock or reset is changed. This is defined in the sensitivity list of the process declaration.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In these examples, the reset is asynchronous and used to reset the current state and the output, while the next actions only occur following the rising edge of the clock. Where the state machine progresses through each state depends upon its inputs and current state, moving if necessary to the next state.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;What this demonstrates is that, using programmable logic and HDL, we can directly code the state machine or counter from the state diagram and without the need to create the logic equations. Indeed, we let the synthesis tool do that for us.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="clear:both;font-size:11px;margin:0;padding-top:12px;"&gt;*Trademark. &lt;strong&gt;Xilinx is a trademark of Xilinx Inc.&lt;/strong&gt; Other logos, product and/or company names may be trademarks of their respective owners.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;border:1px solid #a9aaaa;padding:12px 12px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/PrgmLogic_profile.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox essProfile" style="float:left;padding-right:10px;vertical-align:middle;"  height="115" src="/e14/assets/legacy/2018/PrgmLogic_profile.png" /&gt;&lt;/a&gt;
&lt;div&gt;
&lt;p style="color:#007fac;font-size:15px;margin:0;padding-bottom:10px;"&gt;Shop our wide range of &lt;strong&gt;FPGAs, SoCs, EVMs, application specific kits, embedded development boards, and more.&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-AU_CN_HK_IN_KR_MY_NZ_PH_SG_TH_TW_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://sg.element14.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-AT_BE_BG_CZ_DK_EE_FI_FR_DE_HU_IE_IL_IT_LV_LT_NL_NO_PL_PT_RO_RU_SK_SI_ES_SE_CH_TR_UK_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://uk.farnell.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-US_BR_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://www.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-CA_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://canada.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-MX_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://mexico.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:20px;"&gt;&lt;a name="test"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="color:#007fac;font-size:18px;margin:0;padding-bottom:8px;"&gt;&lt;strong&gt;Test Your Knowledge&lt;/strong&gt;&lt;span style="float:right;font-size:11px;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a href="/e14/assets/legacy/2018/100x100_PrgmDevice1Bdg.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox" style="float:left;padding:0px 10px 5px 0px;vertical-align:top;"  height="80" src="/e14/assets/legacy/2018/100x100_PrgmDevice1Bdg.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-bottom:8px;"&gt;Are you ready to demonstrate your Essentials of Programmable Logic knowledge? &lt;strong&gt;Then take a quick 15-question, multiple-choice quiz to see how much you&amp;#39;ve learned from this Programmable Devices module.&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;strong&gt;To earn the Programmable Devices I Badge&lt;/strong&gt;, read through the module to learn all about Programmable Logic, attain 100% in the quiz at the bottom, leave us some feedback in the comments section, and give the module a star rating.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&lt;div class="voltquiz" data-formid="0fcd3450-c4f3-4322-8af1-4b03e66c0ed0" data-formtype="quiz" data-success-message="" data-fail-message="" data-pass-mark="OTk=" &gt;&lt;/div&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="e14-quiz-document-metadata e14-init-hidden"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class="migration-injected-attachments"&gt;
&lt;div style="font-weight:bold;margin:15px 0 5px 0;"&gt;Attachments:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;table style="border:0;"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width="160"&gt;&lt;span id="attid_https://www.element14.com/community/api/core/v3/attachments/265862" class="_se_attachment"&gt;&lt;a href="https://community.element14.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-02-50/Programmable-Devices-I-_2D00_-Programmable-Logic.pdf"&gt;community.element14.com/.../Programmable-Devices-I-_2D00_-Programmable-Logic.pdf&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:80%;"&gt;Programmable Devices I - Programmable Logic.pdf&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;script&gt;window.top.e14.func.queueScripts.add(function() { window.top.e14.func.e14ConditionalContent();} );&lt;/script&gt;

&lt;div style="font-size: 90%;"&gt;Tags: fpga_essentials, programmable_devices, xilinx_essentials, xilinx, fpga, programmable_device, programmable_logic, ess_module&lt;/div&gt;
</description></item><item><title>Programmable Logic</title><link>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic/revision/5</link><pubDate>Fri, 25 Feb 2022 17:48:02 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:722dc523-e66e-42a7-84b5-de3f2731c4d8</guid><dc:creator>pchan</dc:creator><comments>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic#comments</comments><description>Revision 5 posted to Documents by pchan on 2/25/2022 5:48:02 PM&lt;br /&gt;
&lt;p&gt;&lt;span&gt;&lt;div class="e14-navigation-buttons"&gt;&lt;a href="/learn/learning-center/essentials?ICID=essentials-programdevice1-doc"&gt;
                    &lt;button class="e14-nav-button-prev"&gt;Previous&lt;/button&gt;
                &lt;/a&gt;&lt;a href="/learn/learning-center/essentials/w/documents/4109/programmable-socs?ICID=essentials-programdevice1-doc"&gt;
                    &lt;button class="e14-nav-button-next"&gt;Next&lt;/button&gt;
                &lt;/a&gt;&lt;/div&gt;&lt;script&gt;e14.func.queueScripts.add(function(){ e14.func.repositionNavButtons(); })&lt;/script&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style="background-color:#f9f9f9;border:1px solid #c6c6c6;display:block;float:right;padding:6px 8px;width:212px;"&gt;&lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/learn/learning-center/?ICID=essentials-programdevice1-doc"&gt;element14 Learning Center&lt;/a&gt;&lt;/div&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="border:1px solid #c6c6c6;clear:both;padding:8px;"&gt;
&lt;div style="display:inline-block;padding-right:16px;vertical-align:top;"&gt;&lt;a href="/learn/learning-center/online-learning/essentials/?ICID=essentials-programdevice1-doc"&gt;&lt;img alt="image"  src="/e14/assets/legacy/2017/learningess.png" width="175px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;"&gt;
&lt;p class="essTitle" style="font-size:18px;font-weight:bold;margin:0;" title="Programmable Logic"&gt;&lt;span style="color:#007fac;"&gt;Programmable Devices I: &lt;/span&gt; Programmable Logic&lt;/p&gt;
&lt;p style="margin:0;padding:8px;"&gt;&lt;span style="font-size:11px;padding-right:10px;"&gt;&lt;em&gt;Sponsored by&lt;/em&gt;&lt;/span&gt;&lt;a href="http://www.xilinx.com/" rel="nofollow ugc noopener noreferrer" target="_blank"&gt;&lt;img loading="lazy" alt="image" class="essSponsor" style="vertical-align:top;" title="Xilinx"  height="25px" src="/e14/assets/main/mfg-group-assets/xilinxLogo.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;div style="clear:both;line-height:1.5;"&gt;&lt;span style="padding-right:6px;"&gt;&lt;a class="jive-link-anchor-small" href="#intro"&gt;1. Introduction&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#object"&gt;2. Objectives&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec3"&gt;3. Boolean Algebra&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec4"&gt;4. Logic Gates&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec5"&gt;5. Transistor Implementation of a Gate&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec6"&gt;6. Propagation Delay&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec7"&gt;7. Combinatorial Circuit Example&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec8"&gt;8. Arithmetic in Logic&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec9"&gt;9. Sequential Circuits&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec10"&gt;10. Programmable Logic with FPGAs&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec11"&gt;11. Hardware Description Languages&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-wiki-small" href="/learn/learning-center/online-learning/essentials/w/documents/3803/related-components-dev-boards-for-element14-essentials-programmable-devices-i"&gt;Related Components &amp;amp; Dev Boards&lt;/a&gt;&lt;/span&gt; | &lt;span style="font-weight:bold;padding:0px 6px;"&gt;&lt;a href="#test"&gt;Test Your Knowledge &lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/LinkArrow.gif" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="color:#007fac;font-size:15px;margin:0;padding:8px 0px;"&gt;&lt;a name="intro"&gt;&lt;/a&gt;&lt;strong&gt;1. Introduction&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;The world and our interaction with it is analog. Our surrounding environment, colors in the electromagnetic spectrum, speech, and sound all are represented by continuously changing analog values. When it comes to processing these analog signals, however, digital systems offer several benefits to a traditional analog processing solution. For example, they have higher performance, ease of storage and transmission, and better noise immunity. As such, while the world is analog, it is mainly processed digitally using logic circuits. In this learning module, you will be introduced to the essentials of logic design, and how it can be implemented using programmable logic.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="object"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin:0;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;&lt;strong&gt;2. Objectives&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 8px 35px;"&gt;&lt;em&gt;Upon completion of this module, you will be able to:&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Perform some fundamental operations of Boolean algebra&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Explain the operation and truth tables of common logic gates&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Illustrate how combinatorial circuits are designed&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Discuss the differences between combinatorial and sequential circuits&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Understand how shift registers, counters, and state machines operate&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Explain the basic structures of PLDs&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Describe the role of HDLs&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec3"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;3. Boolean Algebra&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The key foundation of digital logic is Boolean Algebra. Without understanding it we cannot produce effective logic designs or understand the outputs of higher level tools such as synthesis engines.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Boolean algebra is named after its inventor, George Boole, who in 1854 published his work entitled, &amp;quot;An investigation of the laws of thought on which are founded the mathematical theories of logic and probabilities.&amp;quot; This work was later used by Claude Shannon in his 1937 master&amp;#39;s thesis at MIT entitled, &amp;quot;A Symbolic Analysis of Relay and Switching Circuits,&amp;quot; which demonstrated that switching circuits could solve all problems in the same manner as Boolean algebra. Thus, the relationship between switching circuits and Boolean algebra became the foundation of all digital applications.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.1 Boolean Addition and Multiplication&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1+0=1&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+1=1&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1+1=1&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As you can see, the result of the SUM is equal to one only when one or more of the literals is one.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Boolean multiplication produces the PRODUCT of the literals:&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.1=0&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1.1=1&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In this case, you can see the PRODUCT is equal to one only when both literals are equal to one.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Understanding the meaning of the SUM and PRODUCT terms will be important later when we examine logic gates and equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.2 Boolean Algebra Laws&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Just as in other areas of mathematics, Boolean algebra has several laws which we must understand, such as:&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Commutative Law:&lt;/strong&gt; The order of literals in Boolean addition does not affect the result: A+B=B+A&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Associative Law:&lt;/strong&gt; When performing Boolean addition of more than two literals, the result is the same regardless of grouping:&amp;nbsp; A+(B+C)=(A+B)+C&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Distributive Law:&lt;/strong&gt; Performing a Boolean addition of two or more literals before performing a Boolean multiplication on the result is the same as performing the Boolean multiplication with each literal before performing the Boolean Addition A(B+C)=AB+AC&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;These laws become very important when we design logic circuits and wish to optimize the number of logic gates we use in our solution.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Along with these laws we also have twelve rules of Boolean Logic with which we must become familiar. They are:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:white;padding:6px;" colspan="2"&gt;&lt;strong&gt;12 Boolean Logic Rules&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + 0 = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . A = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + 1 = 1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . 0 = 0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;a href="/e14/assets/legacy/2018/A2bars.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/A2bars.png" /&gt;&lt;/a&gt; = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . 1 = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + A.B = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + A = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B = A + B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;(A + B).(A+C) = A + B.C&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.3 DeMorgan&amp;#39;s Theorem&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The final remaining element we need to understand about Boolean Algebra is DeMorgan&amp;#39;s Theorem which states, &amp;quot;The complement of a product of sums is equal to the sum of the complements.&amp;quot;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This is better shown represented as an equation: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A good mnemonic device to remember this is: &amp;quot;break the bar, change the sign.&amp;quot;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, now that we understand Boolean algebra, we want to be able to see how it maps to the logic gates we use to implement digital circuits.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec4"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;4. Logic Gates&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The seven commonly used logic gates in digital design are NOT, AND, OR, XOR, NOR, NAND and XNOR gates. In our designs we use combinations of these logic gates to implement the logic function. In this section, we&amp;#39;ll review these logic gates.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;At the lowest level these logic gates are made from arrangements of transistors; however, each arrangement has its own symbol and truth table, which shows for a given input what its outputs will be. (Note: For simplicity&amp;#39;s sake, except for the NOT gate, all gates are demonstrated with two inputs).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.1 NOT Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of the logic gates is the NOT gate. This gate simply inverts the logic value presented on the input.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram1_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:150px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NOT symbol &amp;amp; truth table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 1: NOT Gate&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.2 AND Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One of the most commonly used logic gates is the AND gate, which implements Boolean algebra multiplication and produces the PRODUCT of its inputs as we described earlier in this learning module.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram2_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram2_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;AND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 2: AND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.3 OR Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To implement Boolean addition and generate the SUM of its inputs, we use the OR Gate which uses the symbol as shown in Figure 3.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram3_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram3_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;OR Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 3: OR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The remaining logic gates are derivatives of the AND, OR, and NOT functions. However, the NAND and NOR gates have proven to be very popular due to their universality, which allows any logic gate&amp;mdash;AND, OR, NOT&amp;mdash;to be implemented using these two gates. We will look at exactly how we can do this in an example further on in this learning module.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.4 NAND Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of the gates is the NAND gate, which stands for Not AND. This can be represented by an AND gate followed by a NOT gate. However, it is normally shown as an AND gate with an inversion bubble on its output.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram4_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram4_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NAND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 4: NAND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.5 NOR Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A similar logic gate is the NOR gate, which is also a universal gate and represents the NOT OR function. We represent the NOR symbol as the OR gate with an inversion bubble.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram5_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram5_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NOR Symbol and Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 5: NOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.6 XOR and XNOR Gates&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The final two gates are the XOR and XNOR gates, which are constructed from logic gates already introduced. However, they provide very useful functions allowing us to determine if both inputs agree (XNOR) or both inputs differ (XOR).&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;XOR Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 6a: XOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;XNOR Symbol &amp;amp; Truth Table &lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 6b: XNOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec5"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;5. Transistor Implementation of a Gate&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As mentioned earlier in this learning module, each of the logic gates consists of several transistors arranged to implement the desired logic gate.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:280px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram7_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram7_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 7: Transistor Level implementation of a NOT Gate&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of these is the NOT gate, which uses two complementary transistors to invert the input at its output. When the Input is high, transistor Q1 is turned off thanks to the inversion, while transistor Q2 is turned on pulling the output to ground, which is the opposite of the presented signal. Conversely, when the input is low, transistor Q2 is this time turned off, while Q1 is turned on, pulling the output to the power rail and outputting a logic high.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:280px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram8_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram8_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 8: Transistor level implementation of a AND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This NOT structure is also used in more complex gates such as the AND gate. Looking at the transistor level of the AND gate you will first notice the Output stage Q5 and Q6 is the same as for the NOT gate function.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When inputs A and B are both high, transistors Q1 and Q2 are turned on while Q3 and Q4 are turned off. This pulls the input to Q6 and Q5 low, which due to the inversion means Q5 turns on and Q6 turns off allowing the output to be set high. For all other combinations at least one of Q1, Q2, Q3 and Q4 is turned off ,which pulls the input to Q5 and Q6 high, as such turning on Q6 and off Q5 pulling the output low as would be expected for an AND logic gate.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec6"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;6. Propagation Delay&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we implement logic circuits, using logic gates, we call these combinatorial logic circuits as there is no storage or feedback. To ensure these circuits function as intended we also, need to understand what occurs when an input changes. As just demonstrated, logic gates are made up from arrangements of switching transistors, and as such it takes time for a change at an input to result in a change of the output.&amp;nbsp; We call this delay the PROPAGATION time and it will vary depending upon the logic family used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To ensure we are all on the same page, there are several different logic families, each implemented in different underlying technologies such as CMOS (Complementary Metal Oxide Semi-conductor) or TTL (Transistor to Transistor Logic). Each logic family will exhibit a different propagation delay, which will limit the switching frequency of the logic design. If we are testing in the lab, we measure the propagation delay between the mid-point (50%) of the rising and falling edges as shown below.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram1_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:255px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 9: Timing Diagram of NOT gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The propagation time is normally defined within the data sheet for the logic gate selected; however, it will often list two propagation times: one for the high to low transition and another for the low to high transition.&amp;nbsp; Of course, the propagation time will also be affected by the ambient temperature, changes in power supply conditions, resistance of the driver, and the capacitive load on the device output.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We call the output driving several devices inputs the FANOUT. The higher the fanout, the larger the loading, and, therefore, the slower the output rise and fall times. Typical values of propagation time in logic datasheets range from 5 ns to 35 ns, depending upon the logic family, minimum/maximum behavior, and loading conditions (FANOUT).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we develop our combinatorial circuit, which will typically consist of several levels of logic gates, due to the layer on gates, we need to be careful of the differing propagation delays, as differing propagation delays can lead to glitches in the output value which are not correct. This is one of the reasons that in many applications, combinatorial circuits are used with storage elements like D type flip flops and an associated clock to ensure the output does not glitch and is stable when it is presented to the next processing/decision element.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;However, if we are working purely with combinatorial circuits, we can also take some steps to mitigate these glitches, which are often referred to as RACE Hazards.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec7"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;7. Combinatorial Circuit Example&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The best way to demonstrate how we can pull together what we have learned so far about Boolean Algebra, Logic Gates, Propagation Delays, and Hazards is to outline a few simple examples.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;For the first example, we will create a system which monitors three motors. Each motor has a health indication output which is high when the motor has a fault. For the overall system to function correctly, at least two of the motors must be working correctly, therefore, we will create a system that outputs a logic high when two out of the three motors have asserted their fault outputs.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The first stage in developing this solution is to create a truth table that shows the possible input combinations and the correct output for each of those input conditions. As we have 3 inputs, then there are 2&lt;sup&gt;3&lt;/sup&gt; or eight possible combinations of the input:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:0px 15px 5px 0px;vertical-align:top;width:230px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="30%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 10: Truth Table for the motor monitoring system&amp;#39;s logic function&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;From this truth table we can generate the following logic equations: &lt;strong&gt;OP = (A.B) + (A.C) + (B.C)&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We call the format of this equation a SUM of PRODUCTS (SOP) equation as the OP is the Boolean SUM (Logical OR) of the Boolean PRODUCTS (AND) equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we so desired, we could calculate a PRODUCT of SUMS (POS) output by following the approach.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Firstly, we create the SOP logic equation for each entry on the truth table where the output is low: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;OP&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;A.C&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B.C&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;div style="padding-top:12px;"&gt;Next, we apply DeMorgan&amp;#39;s theorem to convert from the SOP to the POS format. The first step is to invert the SOP equation: &lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/PrgmLogicEQ1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can then apply DeMorgan&amp;#39;s theorem and the ninth law of logic to create the final POS equation: &lt;strong&gt;OP=(A+B).(A+C).(B+C)&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;For the remainder of this example, however, we will work with the SOP format as that is the most common method for implementing logic functions. As such, we can realize our SOP equation using a two-level logic circuit as below:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:8px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram11_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram11_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 11: Example Logic Circuit in SOP form&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With this two-level network, we need to consider the propagation delay through the first AND gate level and the impact it might have on the output.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, this implementation uses two logic gate types (AND, OR). But it is possible to implement the same logical function using only NAND gates, as they are universal.&amp;nbsp; Thanks to DeMorgan&amp;#39;s Theorem, the NAND gate also implements the Negative OR function: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:8px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram12_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram12_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 12: Example Logic Circuit in SOP form implemented using NAND Gates&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As such, we can redraw the logic circuit above.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Let&amp;#39;s look at how we get the same functionality using NAND gates. The output equation can be represented as: &lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ2.png"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/2018/PrgmLogicEQ2.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Using DeMorgan&amp;#39;s Theorem, we can iterate through the following steps, changing the sign as we break the bar and applying other rules of Boolean algebra:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2" /&gt;&lt;/a&gt;&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we are working with POS logic equations, we can use NOR gates to implement the logic equation and prove the functionality the same way using DeMorgan&amp;#39;s Theorem and Boolean Algebra rules.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the example above, we used a truth table to determine the logic equations and it works well for a simple application. However, if we have more complex applications we need a better way of determining the logic equations. This is where the Karnaugh-map (Kmap) comes into play. Kmaps are visual representations of the logic behavior which allow us to use our natural ability for pattern recognition to determine the logic equations.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 13: Example Karnaugh-map used for four variables (A,B,C,D). Note the gray scale count.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Karnaugh-maps are used by grouping together adjacent 1&amp;#39;s for SOP and adjacent 0&amp;#39;s for POS. These groupings can then be used to determine the logic equation, using the rules of Boolean Algebra to implement the desired functionality.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 14: Example of a Karnaugh-map: Grouping the 1s together.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Often, if we use a Karnaugh-map, we will obtain an equation which uses the minimum number of logic gates to implement. Using the example to the left we can group together the 1&amp;#39;s within the design where they are adjacent to each other.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The example groups together four 1&amp;#39;s within the center of the Karnaugh-map (highlighted green), and from this we can see that the logic equation is D.B as the C and A cancel each other out due to being across not C and C or not A and A, respectively.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The blue elements in the corner can also be grouped together as they are also judged to be adjacent, since the Karnaugh-map is judged to wrap around edge to edge and top to bottom. As such, the second equation to be extracted from the Karnaugh-map is C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;; therefore, the resulting logic equation for the Karnaugh-map is: &lt;strong&gt;OP = C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + D.B&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can also use Karnaugh-maps to identify hazards which might result in glitches during operation and help us eliminate them. In the next example, we can extract the logical equation for the green and blue cells as: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D&lt;/strong&gt;&lt;/p&gt;
&lt;div style="clear:both;float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;border-left:2px solid #D23620;border-right:2px solid #D23620;border-top:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;border-bottom:2px solid #D23620;border-left:2px solid #D23620;border-right:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 15: Karnaugh-maps: Identifying Potential Hazards&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;However, this leaves the equation highlighted by the red circle as a potential hazard, which occurs when the input D changes from a 1 to a 0. The output is intended to stay high; however, there is not a specific term in the logic equation to address it. To remove the hazard, we should update the logic equation. See in the additional equation where the red text is: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D + &lt;span style="color:#d23620;"&gt;&lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B.C.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;By this point now you should be familiar with Boolean Algebra, logic gates, how they relate to each other, and how they are used with truth tables and Karnaugh-maps to not only determine logic equations but also to identify race conditions. You should also understand how we can use universal gates for implementing logic equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the basics of Boolean Algebra and logic gates introduced, we can focus now on how to create logical structures which can be used in applications. As such, we are going to explore Half and Full Adders along with the basics of synchronous logic design, using flip flops and their application, to help us create counters, shift registers, and state machines.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec8"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;8. Arithmetic in Logic&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;There are times in logic design when we want to perform mathematical operations such as Addition, Subtraction, Multiplication, and Division. While how we do this and number systems we use can be a course on its own, the Half and Full Adder are the key logic circuits we use to achieve these and should be introduced here.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.1 Half Adder&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The Half Adder is so called as it adds two input variables, generating a sum and carry outputs; it has no ability to accept a carry-in from a previous adder.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram16_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram16_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:250px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 16: Half Adder logic diagram and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.2 Full Adder&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The Full Adder provides the ability to accept a carry-in and is therefore used more commonly when working with multi-bit buses in logic.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 20px 5px 0px;width:380px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram17_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram17_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:320px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry In&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry Out&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 17: Full Adder logic diagram and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, like any logic circuits, there are variations optimized for different applications, including Ripple Carry Adder, Carry Look Ahead, and Carry Save Adders.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can also use the same adders for subtraction, if we use the twos complement number system to represent signed numbers.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.3 Signed and Unsigned Number Systems&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;For those not familiar with signed and unsigned binary numbers, we&amp;#39;ll very briefly discuss them now. Simply stated, there are several number systems which allow us to represent both signed and unsigned number systems.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Unsigned numbers are the simplest and we can represent a range of 0 to 2&lt;sup&gt;n&lt;/sup&gt;&amp;ndash;1, where n is the width of the bus. Unsigned numbers always represent positive numbers.&amp;nbsp; To represent signed numbers, we have a choice of several number systems, the most common being the Sign and Magnitude, Ones Complement, or Twos Complement.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Sign and Magnitude utilizes the left most bit (often called the most significant bit) to represent the sign of the number (0 = positive, 1 = negative), and the remainder of the bits represent the magnitude.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the Sign and Magnitude system, both positive and negative numbers have the same magnitude; however, the sign bit differs. Due to this it is possible to have both a positive and negative zero within the Sign and Magnitude system.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Ones Complement uses the same unsigned representation for positive numbers as the Sign and Magnitude representation. However, for negative numbers, the inversion (ones complement) of the positive number is used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Twos Complement is the most widely used encoding scheme for representing signed numbers. Just like Sign and Magnitude and Ones Complement schemes, positive numbers are represented in the same manner as an unsigned number. While negative numbers are represented as the binary number, you add to a positive number of the same magnitude to get zero. A negative twos complement number is calculated by first taking the ones complement (inversion) of the positive number and then adding one to it. The twos complement number system allows subtraction of one number from another by performing an addition of the two numbers. The range a twos complement number can represent is given by: &lt;strong&gt;-(2&lt;sup&gt;n-1&lt;/sup&gt;) to + (2&lt;sup&gt;n-1&lt;/sup&gt;&amp;ndash;1)&lt;/strong&gt;.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One method we can use to convert a number to its twos complement format is to work right to left, leaving the number the same until the first one is encountered; after this each bit is inverted.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec9"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;9. Sequential Circuits&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Combinatorial logic circuits are unable to implement functions that require knowledge of their previous inputs or decisions as they contain no memory/storage elements.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In contrast, sequential circuits&amp;#39; outputs are based upon not only current inputs but also previous inputs and decisions. Sequential logic circuits achieve this by using storage elements called flip flops, the simplest of which is the D Type flip flop. The value stored in the flip flop is updated at a regular interval as indicated by the clock signal.&lt;/p&gt;
&lt;div style="float:left;"&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:180px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram18_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram18_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:160px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" colspan="2"&gt;&lt;strong&gt;Inputs&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" colspan="2"&gt;&lt;strong&gt;Outputs&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;CK&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;D&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;Q&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;span style="text-decoration:overline;"&gt;Q&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;X&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;" colspan="2"&gt;No Change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 18: D Flip-flop and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This ability to store states within our logic design allows more complex logic structures to be implemented. It also aids timing as the output of the combinatorial logic circuit must be stable just before the clock is applied to the Flip Flop to store the next value, thereby eliminating glitches. But as we will see this introduces more issues as well, especially when there are multiple layers of logic between flip flops.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.1 Half Adder in a Synchronous Design&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In this example, you can see the two-clock cycle delay between the application of an input and the generation of the output. The first clock cycle stores the inputs A and B in the first flip flops. The output of these flip flops will then be passed through the combinatorial logic, in this case, the half adder. The output of the half adder is then stored into the second rank of flip flops and output on the second clock cycle.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 25px 5px 0px;width:350px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 19a: Example Half Adder in a synchronous design (clock is shown in orange).&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:350px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 19b: Timing Diagram for the example Half Adder in a synchronous design above.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/center&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.2 Shift Registers and Counters&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The three most commonly implemented sequential logic design structures are shift registers, counters, and state machines.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Shift registers in their basic form are a collection of Flip Flops where the output of one flip flop feeds the input of the next flip flop. Signals are then progressed through the shift register on each clock. We can use shift registers for a range of things in our logic design from delays (although there are better ways to implement delays) to metastability synchronizers, as well as conversion between serial and parallel and the generation of random numbers using feedback correctly.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 20: Shift Register and associated timing diagram.&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In many designs, we need to time events or introduce delays between the generation or issuing of signals. We do this by using a counter. In this application, we use the flip flops to store the count and combinatorial logic to determine the next value of the count based upon the current value.&lt;/p&gt;
&lt;div style="float:left;padding:12px 20px 5px 0px;width:260px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram21_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram21_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 21: Four-bit counter state diagram&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The first stage in the development of a counter is to create a simple state diagram which shows the counter behavior.&lt;/p&gt;
&lt;div style="clear:both;float:left;padding:12px 20px 5px 0px;width:260px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Present A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Present B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Next A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Next B&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 22: Present State, Next State Table for the counter&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Once the state diagram is created, we can then create a present state, next state table and extract from it the logic equations to implement the counter. Of course, while the example counts in sequential binary, if we desired, we could have the counter count in gray code, etc.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the present state, next state table (PS, NS) created, we can then create the logic equations needed to create in combinatorial logic. If necessary we can use Karnaugh-maps, etc. However, for this simple example we can work directly from the present state, next state table.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the PS, NS table, we create a logic equation for each of the next states, e.g. next A. As such the equations are: &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;Next A = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;Next B = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;From these equations we can generate the logic circuit which contains the D Type flip flops and logic gates.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 25px 5px 0px;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 23: Logic Design for a two-bit counter.&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Along with counters, logic designs are often called upon to perform sequence and control-based actions. These actions and sequences are best addressed using a state machine.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.3 State Machines&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;State machines are logical constructs that transition between a finite number of states, like a counter; however, the path through the states is not sequential. A state machine will only be in one state at a point in time. It will transition between states depending upon several triggers, e.g. inputs or counter values, etc.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Theoretically, state machines are divided into two basic classes: Moore and Mealy. They differ only in how the state machine&amp;#39;s outputs are generated.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Moore:&lt;/strong&gt; State Machine outputs are a function of the present state only. A classic example is a counter.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Mealy:&lt;/strong&gt; State Machine outputs are a function of the present state and inputs. A classic example is the &lt;a class="jive-link-external-small" href="http://en.wikipedia.org/wiki/Richards_controller" rel="nofollow ugc noopener noreferrer" target="_blank"&gt;Richards Controller&lt;/a&gt;.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we are faced with the task of defining a state machine, we will develop a state diagram as we would do for a counter. The state diagram shows the states, inputs, and the transitions between the states and the outputs from the state machine. Figure 24 demonstrates the two types of state diagrams: one for a Moore State Machine (left), the other a Mealy State Machine (right).&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:200px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 24: State Diagrams for a Moore (left) and Mealy (right) State Machine.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we were to implement these in logic gates and flip flops we would generate a present state, next state table, as we did for the previous counter example, and then create the logic equations for each of the state variables. The only difference is that, along with the current state, the present state, next state table will also have to consider the inputs and outputs for the state machine.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec10"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;10. Programmable Logic with FPGAs&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;So far, we have looked at how we create logic designs and implement them with discrete logic gates and flip flops. However, the most common way of implementing a logic design is using a programmable logic device (PLD) such as a Complex Programmable Logic Device (CPLD) or a Field Programmable Gate Array (FPGA). These devices enable the implementation of large logic designs and, depending upon the technology of the device used, they can be reprogrammed in the field.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Programmable logic devices are available in three different technologies:&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;SRAM:&lt;/strong&gt; The FPGA program is stored in an external memory and loaded into the FPGA each time it is powered.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;FLASH:&lt;/strong&gt; The FLASH architecture of the FPGA also contains the program; no external memory device is needed.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;One Time Programmable (OTP):&lt;/strong&gt; The FPGA is applied by blowing fuses in the device. Once programmed, it cannot be modified.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Typically, SRAM-based programmable logic is used where high performance is required, while Flash-based devices are used in middle-to-low performance applications. While one time programmable devices are very limited in application, they still remain popular in space applications.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The key to programmable logic is how logic equations are implemented in the device. It is of course very difficult for the device designers to include a range of AND, OR gates, etc. as the number of each gate type will vary with each application. This will result in either many unused gates or a shortage of a needed gate type. Either way it would not be an efficient method for the implementation of a programmable logic device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Device manufacturers addressed this challenge in a very smart manner. In place of discrete gates, they use a several input look up table (LUT) which is programmed to implement the combinatorial logic equations. In many respects, this LUT is very similar to a multiplexer. Let&amp;#39;s take a quick look at how we can use a LUT to implement logic equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Using the same truth table as for the previous example, we can set the LUT inputs to either ground or VCC depending upon the truth table&amp;#39;s needs. We can then use the logic equation inputs (A,B,C) to drive the LUT selection inputs to output the correct value for that particular input combination implementing the desired logic equation.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram25_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram25_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:240px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 25: Setting the LUT&amp;#39;s Inputs to the Truth Table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Using a LUT inside our programmable device therefore provides the best flexibility to implement a wide range of logic equations.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Of course, we do not want to just implement the combinatorial logic circuits. We also want to implement sequential structures. This means that following the LUT there needs to be a flip flop to act as storage for the combinatorial output such that we can implement sequential structures.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;This combination of a LUT and Flip Flop is often called a Configurable Logic Block (CLB). A programmable logic device will consist of many thousands of CLBs. To provide the most flexibility, additional multiplexers will be used to support a wide range of CLB configurations.&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram26_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram26_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 26: Very Basic Logic Slice&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Obviously, modern devices have very complex CLB structures, which include local memory, fast carry inputs, arithmetic functions, and shift registers.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, these CLB&amp;#39;s need to be interconnected, which is where the device interconnect comes in, which allows the output of one CLB to be connected to the input of another CLB and eventually to the Input/Output of the device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This routing can be considered at two elements. First, there is global routing, which distributes global signals such as clocks. These are global specialist routing networks designed to be low skew and support high fan outs. This dedicated clocking network might be further split between truly global routes across the device and several additional regional limited routes to a specific area of the device. For all other signals, the programmable interconnect is used, which connects the CLBs to each other and other specialist functions within the device. To connect CLBs together it uses a switch matrix, which is configured to provide the internal routing between CLBs.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One of the key drivers of programmable logic technology development was the reduction in the cost of transistors.&amp;nbsp; However, interconnect wires also played a role in enabling much larger devices at reduced cost.&amp;nbsp; When we develop programmable logic applications we spend a lot of time and effort optimizing the performance of the design with regards to its routing to ensure we can operate at the desired clock frequency.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram27_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram27_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 27: CLB and Routing matrix&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To get signals on and off the chip, programmable logic devices also provide IO cells, which are configurable. These enable the device to support a range of single-ended logic standards, e.g. LVCMOS2v4, LVCOM 1V5, etc., Stub Series Terminated Logic (SSTL) as used for High Speed DDR interfaces, and a range of differential standards, including Low Swing Differential Voltage Signaling (LVDS).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Many devices also include complex structures in the IO cells to allow for double data rate signals, source synchronous designs, bus skew correction, and conversion to/from serial. Electrically, the IO can control slew rates, drive strengths and even match the impedance with the transmission line, all of which are controlled by the developer. This means that given the right PHY on the board, using programmable logic, we can achieve any-to-any interconnectivity.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec11"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;11. Hardware Description Languages&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Thanks to the sheer scale of resources offered by programmable logic we cannot any longer design at the gate level like we have done previously. It would simply take too long to develop applications which can leverage the resources provided by the programmable device at the gate level. In the place of developing by using logic equations, we use Hardware Description languages (HDL) such as Verilog or VHDL.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we work with these languages, we do not describe the logic equations, but rather the desired behavior at the register transfer level (RTL). This allows us to define the functionality of the programmable logic device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;How our description gets translated from our HDL file into the logic equations and implemented in the programmable logic device requires several stages.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Synthesis&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;The conversion of the HDL file into logic equations often targeted at the specific resources of the programmable logic device.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#f17c0e;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Placing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;Placing of the identified logic cells (LUT, Flip Flops, etc.) into the programmable logic CLBs.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#003082;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Routing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;Connecting together the placed CLBs to achieve the required performance.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 28: Stages to Convert HDL File into Logic Equations&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Each stage often requires addition constraints to ensure the desired timing is achieved or the correct IO standards are used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;What developers who are used to using VHDL and Verilog will be familiar with is that not all constructs / commands within a language can be synthesized. Therefore, there is only a subset of language commands and coding structures which can be synthesized into a programmable logic device successfully. The remaining elements of the HDL language which are not synthesizable are used in the verification of the design before we implement it in the device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This verification is called the development of a test bench which ensures the Unit Under Test (UUT) meets its specification and is suitable for its intended purpose. When it comes to test benching, we have a couple of choices as to how we perform it.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Functional Simulation only:&lt;/strong&gt; This checks if the design is functionally correct.&amp;nbsp; It does not include internal device timing delays such as propagation delays, which may affect performance when implemented in the device.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Gate Level Simulation:&lt;/strong&gt; This verifies the functionality of the design when back annotated with timing information from the final implemented design. This can take considerable time to perform.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram29_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram29_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 29: Example Test Bench architecture&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Let&amp;#39;s look at how we would implement a state machine using the VHDL Language. Learning VHDL itself is a short course; however, we can briefly introduce the basics here.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A VHDL file is split into two distinct elements, the entity and the architecture. The entity defines the input and outputs of the VHDL module and if it is at the top level of the design. It represents the inputs and outputs of the programmable logic device itself.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The architecture defines the functionality and consists of either sequential statements, which are all executed in parallel or processes.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Processes execute sequentially from top to bottom, more like in a traditional programming application. However, there are rules around when signals update during the process. Additionally, each process in the architecture runs in parallel as you are describing logic functions.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;table width="100%"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="padding-right:15px;"&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state only&lt;/span&gt; &lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state and inputs&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 30: VHDL Architecture which shows the implementation of the state machines in the above example&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the above example, the process runs each time the clock or reset is changed. This is defined in the sensitivity list of the process declaration.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In these examples, the reset is asynchronous and used to reset the current state and the output, while the next actions only occur following the rising edge of the clock. Where the state machine progresses through each state depends upon its inputs and current state, moving if necessary to the next state.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;What this demonstrates is that, using programmable logic and HDL, we can directly code the state machine or counter from the state diagram and without the need to create the logic equations. Indeed, we let the synthesis tool do that for us.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="clear:both;font-size:11px;margin:0;padding-top:12px;"&gt;*Trademark. &lt;strong&gt;Xilinx is a trademark of Xilinx Inc.&lt;/strong&gt; Other logos, product and/or company names may be trademarks of their respective owners.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;border:1px solid #a9aaaa;padding:12px 12px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/PrgmLogic_profile.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox essProfile" style="float:left;padding-right:10px;vertical-align:middle;"  height="115" src="/e14/assets/legacy/2018/PrgmLogic_profile.png" /&gt;&lt;/a&gt;
&lt;div&gt;
&lt;p style="color:#007fac;font-size:15px;margin:0;padding-bottom:10px;"&gt;Shop our wide range of &lt;strong&gt;FPGAs, SoCs, EVMs, application specific kits, embedded development boards, and more.&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-AU_CN_HK_IN_KR_MY_NZ_PH_SG_TH_TW_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://sg.element14.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-AT_BE_BG_CZ_DK_EE_FI_FR_DE_HU_IE_IL_IT_LV_LT_NL_NO_PL_PT_RO_RU_SK_SI_ES_SE_CH_TR_UK_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://uk.farnell.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-US_BR_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://www.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-CA_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://canada.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-MX_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://mexico.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:20px;"&gt;&lt;a name="test"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="color:#007fac;font-size:18px;margin:0;padding-bottom:8px;"&gt;&lt;strong&gt;Test Your Knowledge&lt;/strong&gt;&lt;span style="float:right;font-size:11px;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a href="/e14/assets/legacy/2018/100x100_PrgmDevice1Bdg.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox" style="float:left;padding:0px 10px 5px 0px;vertical-align:top;"  height="80" src="/e14/assets/legacy/2018/100x100_PrgmDevice1Bdg.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-bottom:8px;"&gt;Are you ready to demonstrate your Essentials of Programmable Logic knowledge? &lt;strong&gt;Then take a quick 15-question, multiple-choice quiz to see how much you&amp;#39;ve learned from this Programmable Devices module.&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;strong&gt;To earn the Programmable Devices I Badge&lt;/strong&gt;, read through the module to learn all about Programmable Logic, attain 100% in the quiz at the bottom, leave us some feedback in the comments section, and give the module a star rating.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&lt;div class="voltquiz" data-formid="0fcd3450-c4f3-4322-8af1-4b03e66c0ed0" data-formtype="quiz" data-success-message="" data-fail-message="" data-pass-mark="OTk=" &gt;&lt;/div&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="e14-quiz-document-metadata e14-init-hidden"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class="migration-injected-attachments"&gt;
&lt;div style="font-weight:bold;margin:15px 0 5px 0;"&gt;Attachments:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;table style="border:0;"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width="160"&gt;&lt;span id="attid_https://www.element14.com/community/api/core/v3/attachments/265862" class="_se_attachment"&gt;&lt;a href="https://community.element14.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-02-50/Programmable-Devices-I-_2D00_-Programmable-Logic.pdf"&gt;community.element14.com/.../Programmable-Devices-I-_2D00_-Programmable-Logic.pdf&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:80%;"&gt;Programmable Devices I - Programmable Logic.pdf&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;script&gt;window.top.e14.func.queueScripts.add(function() { window.top.e14.func.e14ConditionalContent();} );&lt;/script&gt;

&lt;div style="font-size: 90%;"&gt;Tags: fpga_essentials, programmable_devices, xilinx_essentials, xilinx, fpga, programmable_device, programmable_logic, ess_module&lt;/div&gt;
</description></item><item><title>Programmable Devices I: Programmable Logic</title><link>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic/revision/4</link><pubDate>Fri, 18 Feb 2022 20:30:27 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:722dc523-e66e-42a7-84b5-de3f2731c4d8</guid><dc:creator>pchan</dc:creator><comments>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic#comments</comments><description>Revision 4 posted to Documents by pchan on 2/18/2022 8:30:27 PM&lt;br /&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style="background-color:#f9f9f9;border:1px solid #c6c6c6;display:block;float:right;padding:6px 8px;width:212px;"&gt;&lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/learn/learning-center/"&gt;element14 Learning Center&lt;/a&gt;&lt;/div&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="border:1px solid #c6c6c6;clear:both;padding:8px;"&gt;
&lt;div style="display:inline-block;padding-right:16px;vertical-align:top;"&gt;&lt;a href="/learn/learning-center/online-learning/essentials/"&gt;&lt;img alt="image"  src="/e14/assets/legacy/2017/learningess.png" width="175px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;"&gt;
&lt;p class="essTitle" style="font-size:18px;font-weight:bold;margin:0;" title="Programmable Logic"&gt;&lt;span style="color:#007fac;"&gt;Programmable Devices I: &lt;/span&gt; Programmable Logic&lt;/p&gt;
&lt;p style="margin:0;padding:8px;"&gt;&lt;span style="font-size:11px;padding-right:10px;"&gt;&lt;em&gt;Sponsored by&lt;/em&gt;&lt;/span&gt;&lt;a href="http://www.xilinx.com/" rel="nofollow ugc noopener noreferrer" target="_blank"&gt;&lt;img loading="lazy" alt="image" class="essSponsor" style="vertical-align:top;" title="Xilinx"  height="25px" src="/e14/assets/main/mfg-group-assets/xilinxLogo.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;div style="clear:both;line-height:1.5;"&gt;&lt;span style="padding-right:6px;"&gt;&lt;a class="jive-link-anchor-small" href="#intro"&gt;1. Introduction&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#object"&gt;2. Objectives&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec3"&gt;3. Boolean Algebra&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec4"&gt;4. Logic Gates&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec5"&gt;5. Transistor Implementation of a Gate&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec6"&gt;6. Propagation Delay&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec7"&gt;7. Combinatorial Circuit Example&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec8"&gt;8. Arithmetic in Logic&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec9"&gt;9. Sequential Circuits&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec10"&gt;10. Programmable Logic with FPGAs&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec11"&gt;11. Hardware Description Languages&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-wiki-small" href="/learn/learning-center/online-learning/essentials/w/documents/3803/related-components-dev-boards-for-element14-essentials-programmable-devices-i"&gt;Related Components &amp;amp; Dev Boards&lt;/a&gt;&lt;/span&gt; | &lt;span style="font-weight:bold;padding:0px 6px;"&gt;&lt;a href="#test"&gt;Test Your Knowledge &lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/LinkArrow.gif" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="background-color:#e4f2f8;border:1px solid #b8d7e5;float:right;margin:20px 0px 5px 5px;padding:12px;width:155px;"&gt;
&lt;p style="color:#007fac;font-weight:bold;margin:0;"&gt;Also Available:&lt;/p&gt;
&lt;p style="margin:0;padding-top:5px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;a class="jive-link-wiki-small" href="/learn/learning-center/online-learning/essentials/w/documents/4109/programmable-devices-ii-programmable-socs"&gt;Programmable Devices II: Programmable SoCs&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:5px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;a class="jive-link-wiki-small" href="/learn/learning-center/online-learning/essentials/w/documents/4501/programmable-devices-iii-fpga-programmable-soc-programming-languages"&gt;Programmable Device III: FPGA / Programmable SoC Programming Languages&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="color:#007fac;font-size:15px;margin:0;padding:8px 0px;"&gt;&lt;a name="intro"&gt;&lt;/a&gt;&lt;strong&gt;1. Introduction&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;The world and our interaction with it is analog. Our surrounding environment, colors in the electromagnetic spectrum, speech, and sound all are represented by continuously changing analog values. When it comes to processing these analog signals, however, digital systems offer several benefits to a traditional analog processing solution. For example, they have higher performance, ease of storage and transmission, and better noise immunity. As such, while the world is analog, it is mainly processed digitally using logic circuits. In this learning module, you will be introduced to the essentials of logic design, and how it can be implemented using programmable logic.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="object"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin:0;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;&lt;strong&gt;2. Objectives&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 8px 35px;"&gt;&lt;em&gt;Upon completion of this module, you will be able to:&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Perform some fundamental operations of Boolean algebra&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Explain the operation and truth tables of common logic gates&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Illustrate how combinatorial circuits are designed&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Discuss the differences between combinatorial and sequential circuits&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Understand how shift registers, counters, and state machines operate&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Explain the basic structures of PLDs&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Describe the role of HDLs&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec3"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;3. Boolean Algebra&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The key foundation of digital logic is Boolean Algebra. Without understanding it we cannot produce effective logic designs or understand the outputs of higher level tools such as synthesis engines.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Boolean algebra is named after its inventor, George Boole, who in 1854 published his work entitled, &amp;quot;An investigation of the laws of thought on which are founded the mathematical theories of logic and probabilities.&amp;quot; This work was later used by Claude Shannon in his 1937 master&amp;#39;s thesis at MIT entitled, &amp;quot;A Symbolic Analysis of Relay and Switching Circuits,&amp;quot; which demonstrated that switching circuits could solve all problems in the same manner as Boolean algebra. Thus, the relationship between switching circuits and Boolean algebra became the foundation of all digital applications.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.1 Boolean Addition and Multiplication&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1+0=1&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+1=1&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1+1=1&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As you can see, the result of the SUM is equal to one only when one or more of the literals is one.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Boolean multiplication produces the PRODUCT of the literals:&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.1=0&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1.1=1&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In this case, you can see the PRODUCT is equal to one only when both literals are equal to one.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Understanding the meaning of the SUM and PRODUCT terms will be important later when we examine logic gates and equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.2 Boolean Algebra Laws&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Just as in other areas of mathematics, Boolean algebra has several laws which we must understand, such as:&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Commutative Law:&lt;/strong&gt; The order of literals in Boolean addition does not affect the result: A+B=B+A&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Associative Law:&lt;/strong&gt; When performing Boolean addition of more than two literals, the result is the same regardless of grouping:&amp;nbsp; A+(B+C)=(A+B)+C&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Distributive Law:&lt;/strong&gt; Performing a Boolean addition of two or more literals before performing a Boolean multiplication on the result is the same as performing the Boolean multiplication with each literal before performing the Boolean Addition A(B+C)=AB+AC&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;These laws become very important when we design logic circuits and wish to optimize the number of logic gates we use in our solution.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Along with these laws we also have twelve rules of Boolean Logic with which we must become familiar. They are:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:white;padding:6px;" colspan="2"&gt;&lt;strong&gt;12 Boolean Logic Rules&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + 0 = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . A = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + 1 = 1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . 0 = 0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;a href="/e14/assets/legacy/2018/A2bars.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/A2bars.png" /&gt;&lt;/a&gt; = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . 1 = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + A.B = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + A = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B = A + B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;(A + B).(A+C) = A + B.C&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.3 DeMorgan&amp;#39;s Theorem&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The final remaining element we need to understand about Boolean Algebra is DeMorgan&amp;#39;s Theorem which states, &amp;quot;The complement of a product of sums is equal to the sum of the complements.&amp;quot;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This is better shown represented as an equation: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A good mnemonic device to remember this is: &amp;quot;break the bar, change the sign.&amp;quot;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, now that we understand Boolean algebra, we want to be able to see how it maps to the logic gates we use to implement digital circuits.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec4"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;4. Logic Gates&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The seven commonly used logic gates in digital design are NOT, AND, OR, XOR, NOR, NAND and XNOR gates. In our designs we use combinations of these logic gates to implement the logic function. In this section, we&amp;#39;ll review these logic gates.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;At the lowest level these logic gates are made from arrangements of transistors; however, each arrangement has its own symbol and truth table, which shows for a given input what its outputs will be. (Note: For simplicity&amp;#39;s sake, except for the NOT gate, all gates are demonstrated with two inputs).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.1 NOT Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of the logic gates is the NOT gate. This gate simply inverts the logic value presented on the input.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram1_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:150px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NOT symbol &amp;amp; truth table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 1: NOT Gate&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.2 AND Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One of the most commonly used logic gates is the AND gate, which implements Boolean algebra multiplication and produces the PRODUCT of its inputs as we described earlier in this learning module.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram2_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram2_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;AND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 2: AND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.3 OR Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To implement Boolean addition and generate the SUM of its inputs, we use the OR Gate which uses the symbol as shown in Figure 3.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram3_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram3_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;OR Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 3: OR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The remaining logic gates are derivatives of the AND, OR, and NOT functions. However, the NAND and NOR gates have proven to be very popular due to their universality, which allows any logic gate&amp;mdash;AND, OR, NOT&amp;mdash;to be implemented using these two gates. We will look at exactly how we can do this in an example further on in this learning module.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.4 NAND Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of the gates is the NAND gate, which stands for Not AND. This can be represented by an AND gate followed by a NOT gate. However, it is normally shown as an AND gate with an inversion bubble on its output.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram4_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram4_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NAND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 4: NAND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.5 NOR Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A similar logic gate is the NOR gate, which is also a universal gate and represents the NOT OR function. We represent the NOR symbol as the OR gate with an inversion bubble.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram5_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram5_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NOR Symbol and Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 5: NOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.6 XOR and XNOR Gates&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The final two gates are the XOR and XNOR gates, which are constructed from logic gates already introduced. However, they provide very useful functions allowing us to determine if both inputs agree (XNOR) or both inputs differ (XOR).&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;XOR Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 6a: XOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;XNOR Symbol &amp;amp; Truth Table &lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 6b: XNOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec5"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;5. Transistor Implementation of a Gate&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As mentioned earlier in this learning module, each of the logic gates consists of several transistors arranged to implement the desired logic gate.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:280px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram7_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram7_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 7: Transistor Level implementation of a NOT Gate&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of these is the NOT gate, which uses two complementary transistors to invert the input at its output. When the Input is high, transistor Q1 is turned off thanks to the inversion, while transistor Q2 is turned on pulling the output to ground, which is the opposite of the presented signal. Conversely, when the input is low, transistor Q2 is this time turned off, while Q1 is turned on, pulling the output to the power rail and outputting a logic high.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:280px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram8_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram8_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 8: Transistor level implementation of a AND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This NOT structure is also used in more complex gates such as the AND gate. Looking at the transistor level of the AND gate you will first notice the Output stage Q5 and Q6 is the same as for the NOT gate function.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When inputs A and B are both high, transistors Q1 and Q2 are turned on while Q3 and Q4 are turned off. This pulls the input to Q6 and Q5 low, which due to the inversion means Q5 turns on and Q6 turns off allowing the output to be set high. For all other combinations at least one of Q1, Q2, Q3 and Q4 is turned off ,which pulls the input to Q5 and Q6 high, as such turning on Q6 and off Q5 pulling the output low as would be expected for an AND logic gate.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec6"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;6. Propagation Delay&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we implement logic circuits, using logic gates, we call these combinatorial logic circuits as there is no storage or feedback. To ensure these circuits function as intended we also, need to understand what occurs when an input changes. As just demonstrated, logic gates are made up from arrangements of switching transistors, and as such it takes time for a change at an input to result in a change of the output.&amp;nbsp; We call this delay the PROPAGATION time and it will vary depending upon the logic family used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To ensure we are all on the same page, there are several different logic families, each implemented in different underlying technologies such as CMOS (Complementary Metal Oxide Semi-conductor) or TTL (Transistor to Transistor Logic). Each logic family will exhibit a different propagation delay, which will limit the switching frequency of the logic design. If we are testing in the lab, we measure the propagation delay between the mid-point (50%) of the rising and falling edges as shown below.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram1_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:255px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 9: Timing Diagram of NOT gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The propagation time is normally defined within the data sheet for the logic gate selected; however, it will often list two propagation times: one for the high to low transition and another for the low to high transition.&amp;nbsp; Of course, the propagation time will also be affected by the ambient temperature, changes in power supply conditions, resistance of the driver, and the capacitive load on the device output.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We call the output driving several devices inputs the FANOUT. The higher the fanout, the larger the loading, and, therefore, the slower the output rise and fall times. Typical values of propagation time in logic datasheets range from 5 ns to 35 ns, depending upon the logic family, minimum/maximum behavior, and loading conditions (FANOUT).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we develop our combinatorial circuit, which will typically consist of several levels of logic gates, due to the layer on gates, we need to be careful of the differing propagation delays, as differing propagation delays can lead to glitches in the output value which are not correct. This is one of the reasons that in many applications, combinatorial circuits are used with storage elements like D type flip flops and an associated clock to ensure the output does not glitch and is stable when it is presented to the next processing/decision element.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;However, if we are working purely with combinatorial circuits, we can also take some steps to mitigate these glitches, which are often referred to as RACE Hazards.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec7"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;7. Combinatorial Circuit Example&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The best way to demonstrate how we can pull together what we have learned so far about Boolean Algebra, Logic Gates, Propagation Delays, and Hazards is to outline a few simple examples.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;For the first example, we will create a system which monitors three motors. Each motor has a health indication output which is high when the motor has a fault. For the overall system to function correctly, at least two of the motors must be working correctly, therefore, we will create a system that outputs a logic high when two out of the three motors have asserted their fault outputs.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The first stage in developing this solution is to create a truth table that shows the possible input combinations and the correct output for each of those input conditions. As we have 3 inputs, then there are 2&lt;sup&gt;3&lt;/sup&gt; or eight possible combinations of the input:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:0px 15px 5px 0px;vertical-align:top;width:230px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="30%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 10: Truth Table for the motor monitoring system&amp;#39;s logic function&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;From this truth table we can generate the following logic equations: &lt;strong&gt;OP = (A.B) + (A.C) + (B.C)&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We call the format of this equation a SUM of PRODUCTS (SOP) equation as the OP is the Boolean SUM (Logical OR) of the Boolean PRODUCTS (AND) equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we so desired, we could calculate a PRODUCT of SUMS (POS) output by following the approach.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Firstly, we create the SOP logic equation for each entry on the truth table where the output is low: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;OP&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;A.C&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B.C&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;div style="padding-top:12px;"&gt;Next, we apply DeMorgan&amp;#39;s theorem to convert from the SOP to the POS format. The first step is to invert the SOP equation: &lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/PrgmLogicEQ1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can then apply DeMorgan&amp;#39;s theorem and the ninth law of logic to create the final POS equation: &lt;strong&gt;OP=(A+B).(A+C).(B+C)&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;For the remainder of this example, however, we will work with the SOP format as that is the most common method for implementing logic functions. As such, we can realize our SOP equation using a two-level logic circuit as below:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:8px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram11_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram11_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 11: Example Logic Circuit in SOP form&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With this two-level network, we need to consider the propagation delay through the first AND gate level and the impact it might have on the output.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, this implementation uses two logic gate types (AND, OR). But it is possible to implement the same logical function using only NAND gates, as they are universal.&amp;nbsp; Thanks to DeMorgan&amp;#39;s Theorem, the NAND gate also implements the Negative OR function: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:8px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram12_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram12_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 12: Example Logic Circuit in SOP form implemented using NAND Gates&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As such, we can redraw the logic circuit above.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Let&amp;#39;s look at how we get the same functionality using NAND gates. The output equation can be represented as: &lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ2.png"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/2018/PrgmLogicEQ2.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Using DeMorgan&amp;#39;s Theorem, we can iterate through the following steps, changing the sign as we break the bar and applying other rules of Boolean algebra:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2" /&gt;&lt;/a&gt;&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we are working with POS logic equations, we can use NOR gates to implement the logic equation and prove the functionality the same way using DeMorgan&amp;#39;s Theorem and Boolean Algebra rules.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the example above, we used a truth table to determine the logic equations and it works well for a simple application. However, if we have more complex applications we need a better way of determining the logic equations. This is where the Karnaugh-map (Kmap) comes into play. Kmaps are visual representations of the logic behavior which allow us to use our natural ability for pattern recognition to determine the logic equations.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 13: Example Karnaugh-map used for four variables (A,B,C,D). Note the gray scale count.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Karnaugh-maps are used by grouping together adjacent 1&amp;#39;s for SOP and adjacent 0&amp;#39;s for POS. These groupings can then be used to determine the logic equation, using the rules of Boolean Algebra to implement the desired functionality.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 14: Example of a Karnaugh-map: Grouping the 1s together.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Often, if we use a Karnaugh-map, we will obtain an equation which uses the minimum number of logic gates to implement. Using the example to the left we can group together the 1&amp;#39;s within the design where they are adjacent to each other.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The example groups together four 1&amp;#39;s within the center of the Karnaugh-map (highlighted green), and from this we can see that the logic equation is D.B as the C and A cancel each other out due to being across not C and C or not A and A, respectively.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The blue elements in the corner can also be grouped together as they are also judged to be adjacent, since the Karnaugh-map is judged to wrap around edge to edge and top to bottom. As such, the second equation to be extracted from the Karnaugh-map is C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;; therefore, the resulting logic equation for the Karnaugh-map is: &lt;strong&gt;OP = C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + D.B&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can also use Karnaugh-maps to identify hazards which might result in glitches during operation and help us eliminate them. In the next example, we can extract the logical equation for the green and blue cells as: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D&lt;/strong&gt;&lt;/p&gt;
&lt;div style="clear:both;float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;border-left:2px solid #D23620;border-right:2px solid #D23620;border-top:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;border-bottom:2px solid #D23620;border-left:2px solid #D23620;border-right:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 15: Karnaugh-maps: Identifying Potential Hazards&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;However, this leaves the equation highlighted by the red circle as a potential hazard, which occurs when the input D changes from a 1 to a 0. The output is intended to stay high; however, there is not a specific term in the logic equation to address it. To remove the hazard, we should update the logic equation. See in the additional equation where the red text is: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D + &lt;span style="color:#d23620;"&gt;&lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B.C.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;By this point now you should be familiar with Boolean Algebra, logic gates, how they relate to each other, and how they are used with truth tables and Karnaugh-maps to not only determine logic equations but also to identify race conditions. You should also understand how we can use universal gates for implementing logic equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the basics of Boolean Algebra and logic gates introduced, we can focus now on how to create logical structures which can be used in applications. As such, we are going to explore Half and Full Adders along with the basics of synchronous logic design, using flip flops and their application, to help us create counters, shift registers, and state machines.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec8"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;8. Arithmetic in Logic&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;There are times in logic design when we want to perform mathematical operations such as Addition, Subtraction, Multiplication, and Division. While how we do this and number systems we use can be a course on its own, the Half and Full Adder are the key logic circuits we use to achieve these and should be introduced here.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.1 Half Adder&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The Half Adder is so called as it adds two input variables, generating a sum and carry outputs; it has no ability to accept a carry-in from a previous adder.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram16_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram16_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:250px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 16: Half Adder logic diagram and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.2 Full Adder&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The Full Adder provides the ability to accept a carry-in and is therefore used more commonly when working with multi-bit buses in logic.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 20px 5px 0px;width:380px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram17_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram17_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:320px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry In&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry Out&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 17: Full Adder logic diagram and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, like any logic circuits, there are variations optimized for different applications, including Ripple Carry Adder, Carry Look Ahead, and Carry Save Adders.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can also use the same adders for subtraction, if we use the twos complement number system to represent signed numbers.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.3 Signed and Unsigned Number Systems&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;For those not familiar with signed and unsigned binary numbers, we&amp;#39;ll very briefly discuss them now. Simply stated, there are several number systems which allow us to represent both signed and unsigned number systems.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Unsigned numbers are the simplest and we can represent a range of 0 to 2&lt;sup&gt;n&lt;/sup&gt;&amp;ndash;1, where n is the width of the bus. Unsigned numbers always represent positive numbers.&amp;nbsp; To represent signed numbers, we have a choice of several number systems, the most common being the Sign and Magnitude, Ones Complement, or Twos Complement.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Sign and Magnitude utilizes the left most bit (often called the most significant bit) to represent the sign of the number (0 = positive, 1 = negative), and the remainder of the bits represent the magnitude.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the Sign and Magnitude system, both positive and negative numbers have the same magnitude; however, the sign bit differs. Due to this it is possible to have both a positive and negative zero within the Sign and Magnitude system.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Ones Complement uses the same unsigned representation for positive numbers as the Sign and Magnitude representation. However, for negative numbers, the inversion (ones complement) of the positive number is used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Twos Complement is the most widely used encoding scheme for representing signed numbers. Just like Sign and Magnitude and Ones Complement schemes, positive numbers are represented in the same manner as an unsigned number. While negative numbers are represented as the binary number, you add to a positive number of the same magnitude to get zero. A negative twos complement number is calculated by first taking the ones complement (inversion) of the positive number and then adding one to it. The twos complement number system allows subtraction of one number from another by performing an addition of the two numbers. The range a twos complement number can represent is given by: &lt;strong&gt;-(2&lt;sup&gt;n-1&lt;/sup&gt;) to + (2&lt;sup&gt;n-1&lt;/sup&gt;&amp;ndash;1)&lt;/strong&gt;.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One method we can use to convert a number to its twos complement format is to work right to left, leaving the number the same until the first one is encountered; after this each bit is inverted.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec9"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;9. Sequential Circuits&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Combinatorial logic circuits are unable to implement functions that require knowledge of their previous inputs or decisions as they contain no memory/storage elements.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In contrast, sequential circuits&amp;#39; outputs are based upon not only current inputs but also previous inputs and decisions. Sequential logic circuits achieve this by using storage elements called flip flops, the simplest of which is the D Type flip flop. The value stored in the flip flop is updated at a regular interval as indicated by the clock signal.&lt;/p&gt;
&lt;div style="float:left;"&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:180px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram18_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram18_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:160px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" colspan="2"&gt;&lt;strong&gt;Inputs&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" colspan="2"&gt;&lt;strong&gt;Outputs&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;CK&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;D&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;Q&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;span style="text-decoration:overline;"&gt;Q&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;X&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;" colspan="2"&gt;No Change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 18: D Flip-flop and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This ability to store states within our logic design allows more complex logic structures to be implemented. It also aids timing as the output of the combinatorial logic circuit must be stable just before the clock is applied to the Flip Flop to store the next value, thereby eliminating glitches. But as we will see this introduces more issues as well, especially when there are multiple layers of logic between flip flops.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.1 Half Adder in a Synchronous Design&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In this example, you can see the two-clock cycle delay between the application of an input and the generation of the output. The first clock cycle stores the inputs A and B in the first flip flops. The output of these flip flops will then be passed through the combinatorial logic, in this case, the half adder. The output of the half adder is then stored into the second rank of flip flops and output on the second clock cycle.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 25px 5px 0px;width:350px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 19a: Example Half Adder in a synchronous design (clock is shown in orange).&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:350px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 19b: Timing Diagram for the example Half Adder in a synchronous design above.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/center&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.2 Shift Registers and Counters&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The three most commonly implemented sequential logic design structures are shift registers, counters, and state machines.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Shift registers in their basic form are a collection of Flip Flops where the output of one flip flop feeds the input of the next flip flop. Signals are then progressed through the shift register on each clock. We can use shift registers for a range of things in our logic design from delays (although there are better ways to implement delays) to metastability synchronizers, as well as conversion between serial and parallel and the generation of random numbers using feedback correctly.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 20: Shift Register and associated timing diagram.&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In many designs, we need to time events or introduce delays between the generation or issuing of signals. We do this by using a counter. In this application, we use the flip flops to store the count and combinatorial logic to determine the next value of the count based upon the current value.&lt;/p&gt;
&lt;div style="float:left;padding:12px 20px 5px 0px;width:260px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram21_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram21_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 21: Four-bit counter state diagram&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The first stage in the development of a counter is to create a simple state diagram which shows the counter behavior.&lt;/p&gt;
&lt;div style="clear:both;float:left;padding:12px 20px 5px 0px;width:260px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Present A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Present B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Next A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Next B&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 22: Present State, Next State Table for the counter&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Once the state diagram is created, we can then create a present state, next state table and extract from it the logic equations to implement the counter. Of course, while the example counts in sequential binary, if we desired, we could have the counter count in gray code, etc.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the present state, next state table (PS, NS) created, we can then create the logic equations needed to create in combinatorial logic. If necessary we can use Karnaugh-maps, etc. However, for this simple example we can work directly from the present state, next state table.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the PS, NS table, we create a logic equation for each of the next states, e.g. next A. As such the equations are: &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;Next A = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;Next B = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;From these equations we can generate the logic circuit which contains the D Type flip flops and logic gates.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 25px 5px 0px;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 23: Logic Design for a two-bit counter.&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Along with counters, logic designs are often called upon to perform sequence and control-based actions. These actions and sequences are best addressed using a state machine.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.3 State Machines&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;State machines are logical constructs that transition between a finite number of states, like a counter; however, the path through the states is not sequential. A state machine will only be in one state at a point in time. It will transition between states depending upon several triggers, e.g. inputs or counter values, etc.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Theoretically, state machines are divided into two basic classes: Moore and Mealy. They differ only in how the state machine&amp;#39;s outputs are generated.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Moore:&lt;/strong&gt; State Machine outputs are a function of the present state only. A classic example is a counter.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Mealy:&lt;/strong&gt; State Machine outputs are a function of the present state and inputs. A classic example is the &lt;a class="jive-link-external-small" href="http://en.wikipedia.org/wiki/Richards_controller" rel="nofollow ugc noopener noreferrer" target="_blank"&gt;Richards Controller&lt;/a&gt;.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we are faced with the task of defining a state machine, we will develop a state diagram as we would do for a counter. The state diagram shows the states, inputs, and the transitions between the states and the outputs from the state machine. Figure 24 demonstrates the two types of state diagrams: one for a Moore State Machine (left), the other a Mealy State Machine (right).&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:200px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 24: State Diagrams for a Moore (left) and Mealy (right) State Machine.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we were to implement these in logic gates and flip flops we would generate a present state, next state table, as we did for the previous counter example, and then create the logic equations for each of the state variables. The only difference is that, along with the current state, the present state, next state table will also have to consider the inputs and outputs for the state machine.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec10"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;10. Programmable Logic with FPGAs&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;So far, we have looked at how we create logic designs and implement them with discrete logic gates and flip flops. However, the most common way of implementing a logic design is using a programmable logic device (PLD) such as a Complex Programmable Logic Device (CPLD) or a Field Programmable Gate Array (FPGA). These devices enable the implementation of large logic designs and, depending upon the technology of the device used, they can be reprogrammed in the field.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Programmable logic devices are available in three different technologies:&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;SRAM:&lt;/strong&gt; The FPGA program is stored in an external memory and loaded into the FPGA each time it is powered.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;FLASH:&lt;/strong&gt; The FLASH architecture of the FPGA also contains the program; no external memory device is needed.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;One Time Programmable (OTP):&lt;/strong&gt; The FPGA is applied by blowing fuses in the device. Once programmed, it cannot be modified.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Typically, SRAM-based programmable logic is used where high performance is required, while Flash-based devices are used in middle-to-low performance applications. While one time programmable devices are very limited in application, they still remain popular in space applications.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The key to programmable logic is how logic equations are implemented in the device. It is of course very difficult for the device designers to include a range of AND, OR gates, etc. as the number of each gate type will vary with each application. This will result in either many unused gates or a shortage of a needed gate type. Either way it would not be an efficient method for the implementation of a programmable logic device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Device manufacturers addressed this challenge in a very smart manner. In place of discrete gates, they use a several input look up table (LUT) which is programmed to implement the combinatorial logic equations. In many respects, this LUT is very similar to a multiplexer. Let&amp;#39;s take a quick look at how we can use a LUT to implement logic equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Using the same truth table as for the previous example, we can set the LUT inputs to either ground or VCC depending upon the truth table&amp;#39;s needs. We can then use the logic equation inputs (A,B,C) to drive the LUT selection inputs to output the correct value for that particular input combination implementing the desired logic equation.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram25_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram25_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:240px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 25: Setting the LUT&amp;#39;s Inputs to the Truth Table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Using a LUT inside our programmable device therefore provides the best flexibility to implement a wide range of logic equations.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Of course, we do not want to just implement the combinatorial logic circuits. We also want to implement sequential structures. This means that following the LUT there needs to be a flip flop to act as storage for the combinatorial output such that we can implement sequential structures.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;This combination of a LUT and Flip Flop is often called a Configurable Logic Block (CLB). A programmable logic device will consist of many thousands of CLBs. To provide the most flexibility, additional multiplexers will be used to support a wide range of CLB configurations.&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram26_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram26_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 26: Very Basic Logic Slice&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Obviously, modern devices have very complex CLB structures, which include local memory, fast carry inputs, arithmetic functions, and shift registers.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, these CLB&amp;#39;s need to be interconnected, which is where the device interconnect comes in, which allows the output of one CLB to be connected to the input of another CLB and eventually to the Input/Output of the device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This routing can be considered at two elements. First, there is global routing, which distributes global signals such as clocks. These are global specialist routing networks designed to be low skew and support high fan outs. This dedicated clocking network might be further split between truly global routes across the device and several additional regional limited routes to a specific area of the device. For all other signals, the programmable interconnect is used, which connects the CLBs to each other and other specialist functions within the device. To connect CLBs together it uses a switch matrix, which is configured to provide the internal routing between CLBs.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One of the key drivers of programmable logic technology development was the reduction in the cost of transistors.&amp;nbsp; However, interconnect wires also played a role in enabling much larger devices at reduced cost.&amp;nbsp; When we develop programmable logic applications we spend a lot of time and effort optimizing the performance of the design with regards to its routing to ensure we can operate at the desired clock frequency.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram27_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram27_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 27: CLB and Routing matrix&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To get signals on and off the chip, programmable logic devices also provide IO cells, which are configurable. These enable the device to support a range of single-ended logic standards, e.g. LVCMOS2v4, LVCOM 1V5, etc., Stub Series Terminated Logic (SSTL) as used for High Speed DDR interfaces, and a range of differential standards, including Low Swing Differential Voltage Signaling (LVDS).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Many devices also include complex structures in the IO cells to allow for double data rate signals, source synchronous designs, bus skew correction, and conversion to/from serial. Electrically, the IO can control slew rates, drive strengths and even match the impedance with the transmission line, all of which are controlled by the developer. This means that given the right PHY on the board, using programmable logic, we can achieve any-to-any interconnectivity.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec11"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;11. Hardware Description Languages&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Thanks to the sheer scale of resources offered by programmable logic we cannot any longer design at the gate level like we have done previously. It would simply take too long to develop applications which can leverage the resources provided by the programmable device at the gate level. In the place of developing by using logic equations, we use Hardware Description languages (HDL) such as Verilog or VHDL.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we work with these languages, we do not describe the logic equations, but rather the desired behavior at the register transfer level (RTL). This allows us to define the functionality of the programmable logic device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;How our description gets translated from our HDL file into the logic equations and implemented in the programmable logic device requires several stages.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Synthesis&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;The conversion of the HDL file into logic equations often targeted at the specific resources of the programmable logic device.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#f17c0e;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Placing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;Placing of the identified logic cells (LUT, Flip Flops, etc.) into the programmable logic CLBs.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#003082;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Routing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;Connecting together the placed CLBs to achieve the required performance.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 28: Stages to Convert HDL File into Logic Equations&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Each stage often requires addition constraints to ensure the desired timing is achieved or the correct IO standards are used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;What developers who are used to using VHDL and Verilog will be familiar with is that not all constructs / commands within a language can be synthesized. Therefore, there is only a subset of language commands and coding structures which can be synthesized into a programmable logic device successfully. The remaining elements of the HDL language which are not synthesizable are used in the verification of the design before we implement it in the device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This verification is called the development of a test bench which ensures the Unit Under Test (UUT) meets its specification and is suitable for its intended purpose. When it comes to test benching, we have a couple of choices as to how we perform it.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Functional Simulation only:&lt;/strong&gt; This checks if the design is functionally correct.&amp;nbsp; It does not include internal device timing delays such as propagation delays, which may affect performance when implemented in the device.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Gate Level Simulation:&lt;/strong&gt; This verifies the functionality of the design when back annotated with timing information from the final implemented design. This can take considerable time to perform.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram29_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram29_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 29: Example Test Bench architecture&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Let&amp;#39;s look at how we would implement a state machine using the VHDL Language. Learning VHDL itself is a short course; however, we can briefly introduce the basics here.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A VHDL file is split into two distinct elements, the entity and the architecture. The entity defines the input and outputs of the VHDL module and if it is at the top level of the design. It represents the inputs and outputs of the programmable logic device itself.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The architecture defines the functionality and consists of either sequential statements, which are all executed in parallel or processes.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Processes execute sequentially from top to bottom, more like in a traditional programming application. However, there are rules around when signals update during the process. Additionally, each process in the architecture runs in parallel as you are describing logic functions.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;table width="100%"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="padding-right:15px;"&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state only&lt;/span&gt; &lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state and inputs&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 30: VHDL Architecture which shows the implementation of the state machines in the above example&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the above example, the process runs each time the clock or reset is changed. This is defined in the sensitivity list of the process declaration.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In these examples, the reset is asynchronous and used to reset the current state and the output, while the next actions only occur following the rising edge of the clock. Where the state machine progresses through each state depends upon its inputs and current state, moving if necessary to the next state.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;What this demonstrates is that, using programmable logic and HDL, we can directly code the state machine or counter from the state diagram and without the need to create the logic equations. Indeed, we let the synthesis tool do that for us.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="clear:both;font-size:11px;margin:0;padding-top:12px;"&gt;*Trademark. &lt;strong&gt;Xilinx is a trademark of Xilinx Inc.&lt;/strong&gt; Other logos, product and/or company names may be trademarks of their respective owners.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;border:1px solid #a9aaaa;padding:12px 12px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/PrgmLogic_profile.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox essProfile" style="float:left;padding-right:10px;vertical-align:middle;"  height="115" src="/e14/assets/legacy/2018/PrgmLogic_profile.png" /&gt;&lt;/a&gt;
&lt;div&gt;
&lt;p style="color:#007fac;font-size:15px;margin:0;padding-bottom:10px;"&gt;Shop our wide range of &lt;strong&gt;FPGAs, SoCs, EVMs, application specific kits, embedded development boards, and more.&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-AU_CN_HK_IN_KR_MY_NZ_PH_SG_TH_TW_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://sg.element14.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-AT_BE_BG_CZ_DK_EE_FI_FR_DE_HU_IE_IL_IT_LV_LT_NL_NO_PL_PT_RO_RU_SK_SI_ES_SE_CH_TR_UK_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://uk.farnell.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-US_BR_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://www.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-CA_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://canada.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-MX_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://mexico.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:20px;"&gt;&lt;a name="test"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="color:#007fac;font-size:18px;margin:0;padding-bottom:8px;"&gt;&lt;strong&gt;Test Your Knowledge&lt;/strong&gt;&lt;span style="float:right;font-size:11px;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a href="/e14/assets/legacy/2018/100x100_PrgmDevice1Bdg.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox" style="float:left;padding:0px 10px 5px 0px;vertical-align:top;"  height="80" src="/e14/assets/legacy/2018/100x100_PrgmDevice1Bdg.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-bottom:8px;"&gt;Are you ready to demonstrate your Essentials of Programmable Logic knowledge? &lt;strong&gt;Then take a quick 15-question, multiple-choice quiz to see how much you&amp;#39;ve learned from this Programmable Devices module.&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;strong&gt;To earn the Programmable Devices I Badge&lt;/strong&gt;, read through the module to learn all about Programmable Logic, attain 100% in the quiz at the bottom, leave us some feedback in the comments section, and give the module a star rating.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&lt;div class="voltquiz" data-formid="0fcd3450-c4f3-4322-8af1-4b03e66c0ed0" data-formtype="quiz" data-success-message="" data-fail-message="" data-pass-mark="OTk=" &gt;&lt;/div&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="e14-quiz-document-metadata e14-init-hidden"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class="migration-injected-attachments"&gt;
&lt;div style="font-weight:bold;margin:15px 0 5px 0;"&gt;Attachments:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;table style="border:0;"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width="160"&gt;&lt;span id="attid_https://www.element14.com/community/api/core/v3/attachments/265862" class="_se_attachment"&gt;&lt;a href="https://community.element14.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-02-50/Programmable-Devices-I-_2D00_-Programmable-Logic.pdf"&gt;community.element14.com/.../Programmable-Devices-I-_2D00_-Programmable-Logic.pdf&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:80%;"&gt;Programmable Devices I - Programmable Logic.pdf&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;script&gt;window.top.e14.func.queueScripts.add(function() { window.top.e14.func.e14ConditionalContent();} );&lt;/script&gt;

&lt;div style="font-size: 90%;"&gt;Tags: fpga_essentials, programmable_devices, xilinx_essentials, xilinx, fpga, programmable_device, programmable_logic, ess_module&lt;/div&gt;
</description></item><item><title>Programmable Devices I: Programmable Logic</title><link>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic/revision/3</link><pubDate>Thu, 20 Jan 2022 10:31:23 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:722dc523-e66e-42a7-84b5-de3f2731c4d8</guid><dc:creator>cstanton</dc:creator><comments>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic#comments</comments><description>Revision 3 posted to Documents by cstanton on 1/20/2022 10:31:23 AM&lt;br /&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style="background-color:#f9f9f9;border:1px solid #c6c6c6;display:block;float:right;padding:6px 8px;width:212px;"&gt;&lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/learn/learning-center/"&gt;element14 Learning Center&lt;/a&gt;&lt;/div&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="border:1px solid #c6c6c6;clear:both;padding:8px;"&gt;
&lt;div style="display:inline-block;padding-right:16px;vertical-align:top;"&gt;&lt;a href="/learn/learning-center/online-learning/essentials/"&gt;&lt;img alt="image"  src="/e14/assets/legacy/2017/learningess.png" width="175px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;"&gt;
&lt;p class="essTitle" style="font-size:18px;font-weight:bold;margin:0;" title="Programmable Logic"&gt;&lt;span style="color:#007fac;"&gt;Programmable Devices I: &lt;/span&gt; Programmable Logic&lt;/p&gt;
&lt;p style="margin:0;padding:8px;"&gt;&lt;span style="font-size:11px;padding-right:10px;"&gt;&lt;em&gt;Sponsored by&lt;/em&gt;&lt;/span&gt;&lt;a href="http://www.xilinx.com/" rel="nofollow ugc noopener noreferrer" target="_blank"&gt;&lt;img loading="lazy" alt="image" class="essSponsor" style="vertical-align:top;" title="Xilinx"  height="25px" src="/e14/assets/legacy/2018/xilinxlogoSM.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;div style="clear:both;line-height:1.5;"&gt;&lt;span style="padding-right:6px;"&gt;&lt;a class="jive-link-anchor-small" href="#intro"&gt;1. Introduction&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#object"&gt;2. Objectives&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec3"&gt;3. Boolean Algebra&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec4"&gt;4. Logic Gates&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec5"&gt;5. Transistor Implementation of a Gate&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec6"&gt;6. Propagation Delay&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec7"&gt;7. Combinatorial Circuit Example&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec8"&gt;8. Arithmetic in Logic&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec9"&gt;9. Sequential Circuits&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec10"&gt;10. Programmable Logic with FPGAs&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec11"&gt;11. Hardware Description Languages&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-wiki-small" href="/learn/learning-center/online-learning/essentials/w/documents/3803/related-components-dev-boards-for-element14-essentials-programmable-devices-i"&gt;Related Components &amp;amp; Dev Boards&lt;/a&gt;&lt;/span&gt; | &lt;span style="font-weight:bold;padding:0px 6px;"&gt;&lt;a href="#test"&gt;Test Your Knowledge &lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/LinkArrow.gif" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="background-color:#e4f2f8;border:1px solid #b8d7e5;float:right;margin:20px 0px 5px 5px;padding:12px;width:155px;"&gt;
&lt;p style="color:#007fac;font-weight:bold;margin:0;"&gt;Also Available:&lt;/p&gt;
&lt;p style="margin:0;padding-top:5px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;a class="jive-link-wiki-small" href="/learn/learning-center/online-learning/essentials/w/documents/4109/programmable-devices-ii-programmable-socs"&gt;Programmable Devices II: Programmable SoCs&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:5px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;a class="jive-link-wiki-small" href="/learn/learning-center/online-learning/essentials/w/documents/4501/programmable-devices-iii-fpga-programmable-soc-programming-languages"&gt;Programmable Device III: FPGA / Programmable SoC Programming Languages&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="color:#007fac;font-size:15px;margin:0;padding:8px 0px;"&gt;&lt;a name="intro"&gt;&lt;/a&gt;&lt;strong&gt;1. Introduction&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;The world and our interaction with it is analog. Our surrounding environment, colors in the electromagnetic spectrum, speech, and sound all are represented by continuously changing analog values. When it comes to processing these analog signals, however, digital systems offer several benefits to a traditional analog processing solution. For example, they have higher performance, ease of storage and transmission, and better noise immunity. As such, while the world is analog, it is mainly processed digitally using logic circuits. In this learning module, you will be introduced to the essentials of logic design, and how it can be implemented using programmable logic.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="object"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin:0;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;&lt;strong&gt;2. Objectives&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 8px 35px;"&gt;&lt;em&gt;Upon completion of this module, you will be able to:&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Perform some fundamental operations of Boolean algebra&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Explain the operation and truth tables of common logic gates&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Illustrate how combinatorial circuits are designed&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Discuss the differences between combinatorial and sequential circuits&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Understand how shift registers, counters, and state machines operate&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Explain the basic structures of PLDs&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Describe the role of HDLs&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec3"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;3. Boolean Algebra&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The key foundation of digital logic is Boolean Algebra. Without understanding it we cannot produce effective logic designs or understand the outputs of higher level tools such as synthesis engines.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Boolean algebra is named after its inventor, George Boole, who in 1854 published his work entitled, &amp;quot;An investigation of the laws of thought on which are founded the mathematical theories of logic and probabilities.&amp;quot; This work was later used by Claude Shannon in his 1937 master&amp;#39;s thesis at MIT entitled, &amp;quot;A Symbolic Analysis of Relay and Switching Circuits,&amp;quot; which demonstrated that switching circuits could solve all problems in the same manner as Boolean algebra. Thus, the relationship between switching circuits and Boolean algebra became the foundation of all digital applications.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.1 Boolean Addition and Multiplication&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1+0=1&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+1=1&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1+1=1&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As you can see, the result of the SUM is equal to one only when one or more of the literals is one.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Boolean multiplication produces the PRODUCT of the literals:&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.1=0&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1.1=1&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In this case, you can see the PRODUCT is equal to one only when both literals are equal to one.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Understanding the meaning of the SUM and PRODUCT terms will be important later when we examine logic gates and equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.2 Boolean Algebra Laws&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Just as in other areas of mathematics, Boolean algebra has several laws which we must understand, such as:&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Commutative Law:&lt;/strong&gt; The order of literals in Boolean addition does not affect the result: A+B=B+A&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Associative Law:&lt;/strong&gt; When performing Boolean addition of more than two literals, the result is the same regardless of grouping:&amp;nbsp; A+(B+C)=(A+B)+C&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Distributive Law:&lt;/strong&gt; Performing a Boolean addition of two or more literals before performing a Boolean multiplication on the result is the same as performing the Boolean multiplication with each literal before performing the Boolean Addition A(B+C)=AB+AC&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;These laws become very important when we design logic circuits and wish to optimize the number of logic gates we use in our solution.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Along with these laws we also have twelve rules of Boolean Logic with which we must become familiar. They are:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:white;padding:6px;" colspan="2"&gt;&lt;strong&gt;12 Boolean Logic Rules&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + 0 = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . A = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + 1 = 1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . 0 = 0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;a href="/e14/assets/legacy/2018/A2bars.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/A2bars.png" /&gt;&lt;/a&gt; = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . 1 = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + A.B = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + A = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B = A + B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;(A + B).(A+C) = A + B.C&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.3 DeMorgan&amp;#39;s Theorem&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The final remaining element we need to understand about Boolean Algebra is DeMorgan&amp;#39;s Theorem which states, &amp;quot;The complement of a product of sums is equal to the sum of the complements.&amp;quot;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This is better shown represented as an equation: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A good mnemonic device to remember this is: &amp;quot;break the bar, change the sign.&amp;quot;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, now that we understand Boolean algebra, we want to be able to see how it maps to the logic gates we use to implement digital circuits.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec4"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;4. Logic Gates&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The seven commonly used logic gates in digital design are NOT, AND, OR, XOR, NOR, NAND and XNOR gates. In our designs we use combinations of these logic gates to implement the logic function. In this section, we&amp;#39;ll review these logic gates.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;At the lowest level these logic gates are made from arrangements of transistors; however, each arrangement has its own symbol and truth table, which shows for a given input what its outputs will be. (Note: For simplicity&amp;#39;s sake, except for the NOT gate, all gates are demonstrated with two inputs).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.1 NOT Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of the logic gates is the NOT gate. This gate simply inverts the logic value presented on the input.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram1_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:150px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NOT symbol &amp;amp; truth table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 1: NOT Gate&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.2 AND Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One of the most commonly used logic gates is the AND gate, which implements Boolean algebra multiplication and produces the PRODUCT of its inputs as we described earlier in this learning module.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram2_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram2_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;AND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 2: AND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.3 OR Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To implement Boolean addition and generate the SUM of its inputs, we use the OR Gate which uses the symbol as shown in Figure 3.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram3_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram3_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;OR Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 3: OR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The remaining logic gates are derivatives of the AND, OR, and NOT functions. However, the NAND and NOR gates have proven to be very popular due to their universality, which allows any logic gate&amp;mdash;AND, OR, NOT&amp;mdash;to be implemented using these two gates. We will look at exactly how we can do this in an example further on in this learning module.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.4 NAND Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of the gates is the NAND gate, which stands for Not AND. This can be represented by an AND gate followed by a NOT gate. However, it is normally shown as an AND gate with an inversion bubble on its output.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram4_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram4_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NAND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 4: NAND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.5 NOR Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A similar logic gate is the NOR gate, which is also a universal gate and represents the NOT OR function. We represent the NOR symbol as the OR gate with an inversion bubble.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram5_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram5_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NOR Symbol and Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 5: NOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.6 XOR and XNOR Gates&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The final two gates are the XOR and XNOR gates, which are constructed from logic gates already introduced. However, they provide very useful functions allowing us to determine if both inputs agree (XNOR) or both inputs differ (XOR).&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;XOR Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 6a: XOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;XNOR Symbol &amp;amp; Truth Table &lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 6b: XNOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec5"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;5. Transistor Implementation of a Gate&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As mentioned earlier in this learning module, each of the logic gates consists of several transistors arranged to implement the desired logic gate.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:280px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram7_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram7_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 7: Transistor Level implementation of a NOT Gate&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of these is the NOT gate, which uses two complementary transistors to invert the input at its output. When the Input is high, transistor Q1 is turned off thanks to the inversion, while transistor Q2 is turned on pulling the output to ground, which is the opposite of the presented signal. Conversely, when the input is low, transistor Q2 is this time turned off, while Q1 is turned on, pulling the output to the power rail and outputting a logic high.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:280px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram8_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram8_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 8: Transistor level implementation of a AND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This NOT structure is also used in more complex gates such as the AND gate. Looking at the transistor level of the AND gate you will first notice the Output stage Q5 and Q6 is the same as for the NOT gate function.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When inputs A and B are both high, transistors Q1 and Q2 are turned on while Q3 and Q4 are turned off. This pulls the input to Q6 and Q5 low, which due to the inversion means Q5 turns on and Q6 turns off allowing the output to be set high. For all other combinations at least one of Q1, Q2, Q3 and Q4 is turned off ,which pulls the input to Q5 and Q6 high, as such turning on Q6 and off Q5 pulling the output low as would be expected for an AND logic gate.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec6"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;6. Propagation Delay&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we implement logic circuits, using logic gates, we call these combinatorial logic circuits as there is no storage or feedback. To ensure these circuits function as intended we also, need to understand what occurs when an input changes. As just demonstrated, logic gates are made up from arrangements of switching transistors, and as such it takes time for a change at an input to result in a change of the output.&amp;nbsp; We call this delay the PROPAGATION time and it will vary depending upon the logic family used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To ensure we are all on the same page, there are several different logic families, each implemented in different underlying technologies such as CMOS (Complementary Metal Oxide Semi-conductor) or TTL (Transistor to Transistor Logic). Each logic family will exhibit a different propagation delay, which will limit the switching frequency of the logic design. If we are testing in the lab, we measure the propagation delay between the mid-point (50%) of the rising and falling edges as shown below.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram1_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:255px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 9: Timing Diagram of NOT gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The propagation time is normally defined within the data sheet for the logic gate selected; however, it will often list two propagation times: one for the high to low transition and another for the low to high transition.&amp;nbsp; Of course, the propagation time will also be affected by the ambient temperature, changes in power supply conditions, resistance of the driver, and the capacitive load on the device output.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We call the output driving several devices inputs the FANOUT. The higher the fanout, the larger the loading, and, therefore, the slower the output rise and fall times. Typical values of propagation time in logic datasheets range from 5 ns to 35 ns, depending upon the logic family, minimum/maximum behavior, and loading conditions (FANOUT).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we develop our combinatorial circuit, which will typically consist of several levels of logic gates, due to the layer on gates, we need to be careful of the differing propagation delays, as differing propagation delays can lead to glitches in the output value which are not correct. This is one of the reasons that in many applications, combinatorial circuits are used with storage elements like D type flip flops and an associated clock to ensure the output does not glitch and is stable when it is presented to the next processing/decision element.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;However, if we are working purely with combinatorial circuits, we can also take some steps to mitigate these glitches, which are often referred to as RACE Hazards.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec7"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;7. Combinatorial Circuit Example&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The best way to demonstrate how we can pull together what we have learned so far about Boolean Algebra, Logic Gates, Propagation Delays, and Hazards is to outline a few simple examples.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;For the first example, we will create a system which monitors three motors. Each motor has a health indication output which is high when the motor has a fault. For the overall system to function correctly, at least two of the motors must be working correctly, therefore, we will create a system that outputs a logic high when two out of the three motors have asserted their fault outputs.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The first stage in developing this solution is to create a truth table that shows the possible input combinations and the correct output for each of those input conditions. As we have 3 inputs, then there are 2&lt;sup&gt;3&lt;/sup&gt; or eight possible combinations of the input:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:0px 15px 5px 0px;vertical-align:top;width:230px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="30%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 10: Truth Table for the motor monitoring system&amp;#39;s logic function&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;From this truth table we can generate the following logic equations: &lt;strong&gt;OP = (A.B) + (A.C) + (B.C)&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We call the format of this equation a SUM of PRODUCTS (SOP) equation as the OP is the Boolean SUM (Logical OR) of the Boolean PRODUCTS (AND) equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we so desired, we could calculate a PRODUCT of SUMS (POS) output by following the approach.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Firstly, we create the SOP logic equation for each entry on the truth table where the output is low: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;OP&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;A.C&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B.C&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;div style="padding-top:12px;"&gt;Next, we apply DeMorgan&amp;#39;s theorem to convert from the SOP to the POS format. The first step is to invert the SOP equation: &lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/PrgmLogicEQ1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can then apply DeMorgan&amp;#39;s theorem and the ninth law of logic to create the final POS equation: &lt;strong&gt;OP=(A+B).(A+C).(B+C)&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;For the remainder of this example, however, we will work with the SOP format as that is the most common method for implementing logic functions. As such, we can realize our SOP equation using a two-level logic circuit as below:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:8px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram11_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram11_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 11: Example Logic Circuit in SOP form&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With this two-level network, we need to consider the propagation delay through the first AND gate level and the impact it might have on the output.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, this implementation uses two logic gate types (AND, OR). But it is possible to implement the same logical function using only NAND gates, as they are universal.&amp;nbsp; Thanks to DeMorgan&amp;#39;s Theorem, the NAND gate also implements the Negative OR function: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:8px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram12_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram12_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 12: Example Logic Circuit in SOP form implemented using NAND Gates&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As such, we can redraw the logic circuit above.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Let&amp;#39;s look at how we get the same functionality using NAND gates. The output equation can be represented as: &lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ2.png"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/2018/PrgmLogicEQ2.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Using DeMorgan&amp;#39;s Theorem, we can iterate through the following steps, changing the sign as we break the bar and applying other rules of Boolean algebra:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2" /&gt;&lt;/a&gt;&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we are working with POS logic equations, we can use NOR gates to implement the logic equation and prove the functionality the same way using DeMorgan&amp;#39;s Theorem and Boolean Algebra rules.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the example above, we used a truth table to determine the logic equations and it works well for a simple application. However, if we have more complex applications we need a better way of determining the logic equations. This is where the Karnaugh-map (Kmap) comes into play. Kmaps are visual representations of the logic behavior which allow us to use our natural ability for pattern recognition to determine the logic equations.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 13: Example Karnaugh-map used for four variables (A,B,C,D). Note the gray scale count.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Karnaugh-maps are used by grouping together adjacent 1&amp;#39;s for SOP and adjacent 0&amp;#39;s for POS. These groupings can then be used to determine the logic equation, using the rules of Boolean Algebra to implement the desired functionality.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 14: Example of a Karnaugh-map: Grouping the 1s together.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Often, if we use a Karnaugh-map, we will obtain an equation which uses the minimum number of logic gates to implement. Using the example to the left we can group together the 1&amp;#39;s within the design where they are adjacent to each other.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The example groups together four 1&amp;#39;s within the center of the Karnaugh-map (highlighted green), and from this we can see that the logic equation is D.B as the C and A cancel each other out due to being across not C and C or not A and A, respectively.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The blue elements in the corner can also be grouped together as they are also judged to be adjacent, since the Karnaugh-map is judged to wrap around edge to edge and top to bottom. As such, the second equation to be extracted from the Karnaugh-map is C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;; therefore, the resulting logic equation for the Karnaugh-map is: &lt;strong&gt;OP = C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + D.B&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can also use Karnaugh-maps to identify hazards which might result in glitches during operation and help us eliminate them. In the next example, we can extract the logical equation for the green and blue cells as: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D&lt;/strong&gt;&lt;/p&gt;
&lt;div style="clear:both;float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;border-left:2px solid #D23620;border-right:2px solid #D23620;border-top:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;border-bottom:2px solid #D23620;border-left:2px solid #D23620;border-right:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 15: Karnaugh-maps: Identifying Potential Hazards&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;However, this leaves the equation highlighted by the red circle as a potential hazard, which occurs when the input D changes from a 1 to a 0. The output is intended to stay high; however, there is not a specific term in the logic equation to address it. To remove the hazard, we should update the logic equation. See in the additional equation where the red text is: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D + &lt;span style="color:#d23620;"&gt;&lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B.C.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;By this point now you should be familiar with Boolean Algebra, logic gates, how they relate to each other, and how they are used with truth tables and Karnaugh-maps to not only determine logic equations but also to identify race conditions. You should also understand how we can use universal gates for implementing logic equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the basics of Boolean Algebra and logic gates introduced, we can focus now on how to create logical structures which can be used in applications. As such, we are going to explore Half and Full Adders along with the basics of synchronous logic design, using flip flops and their application, to help us create counters, shift registers, and state machines.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec8"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;8. Arithmetic in Logic&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;There are times in logic design when we want to perform mathematical operations such as Addition, Subtraction, Multiplication, and Division. While how we do this and number systems we use can be a course on its own, the Half and Full Adder are the key logic circuits we use to achieve these and should be introduced here.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.1 Half Adder&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The Half Adder is so called as it adds two input variables, generating a sum and carry outputs; it has no ability to accept a carry-in from a previous adder.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram16_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram16_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:250px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 16: Half Adder logic diagram and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.2 Full Adder&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The Full Adder provides the ability to accept a carry-in and is therefore used more commonly when working with multi-bit buses in logic.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 20px 5px 0px;width:380px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram17_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram17_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:320px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry In&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry Out&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 17: Full Adder logic diagram and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, like any logic circuits, there are variations optimized for different applications, including Ripple Carry Adder, Carry Look Ahead, and Carry Save Adders.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can also use the same adders for subtraction, if we use the twos complement number system to represent signed numbers.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.3 Signed and Unsigned Number Systems&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;For those not familiar with signed and unsigned binary numbers, we&amp;#39;ll very briefly discuss them now. Simply stated, there are several number systems which allow us to represent both signed and unsigned number systems.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Unsigned numbers are the simplest and we can represent a range of 0 to 2&lt;sup&gt;n&lt;/sup&gt;&amp;ndash;1, where n is the width of the bus. Unsigned numbers always represent positive numbers.&amp;nbsp; To represent signed numbers, we have a choice of several number systems, the most common being the Sign and Magnitude, Ones Complement, or Twos Complement.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Sign and Magnitude utilizes the left most bit (often called the most significant bit) to represent the sign of the number (0 = positive, 1 = negative), and the remainder of the bits represent the magnitude.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the Sign and Magnitude system, both positive and negative numbers have the same magnitude; however, the sign bit differs. Due to this it is possible to have both a positive and negative zero within the Sign and Magnitude system.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Ones Complement uses the same unsigned representation for positive numbers as the Sign and Magnitude representation. However, for negative numbers, the inversion (ones complement) of the positive number is used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Twos Complement is the most widely used encoding scheme for representing signed numbers. Just like Sign and Magnitude and Ones Complement schemes, positive numbers are represented in the same manner as an unsigned number. While negative numbers are represented as the binary number, you add to a positive number of the same magnitude to get zero. A negative twos complement number is calculated by first taking the ones complement (inversion) of the positive number and then adding one to it. The twos complement number system allows subtraction of one number from another by performing an addition of the two numbers. The range a twos complement number can represent is given by: &lt;strong&gt;-(2&lt;sup&gt;n-1&lt;/sup&gt;) to + (2&lt;sup&gt;n-1&lt;/sup&gt;&amp;ndash;1)&lt;/strong&gt;.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One method we can use to convert a number to its twos complement format is to work right to left, leaving the number the same until the first one is encountered; after this each bit is inverted.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec9"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;9. Sequential Circuits&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Combinatorial logic circuits are unable to implement functions that require knowledge of their previous inputs or decisions as they contain no memory/storage elements.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In contrast, sequential circuits&amp;#39; outputs are based upon not only current inputs but also previous inputs and decisions. Sequential logic circuits achieve this by using storage elements called flip flops, the simplest of which is the D Type flip flop. The value stored in the flip flop is updated at a regular interval as indicated by the clock signal.&lt;/p&gt;
&lt;div style="float:left;"&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:180px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram18_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram18_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:160px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" colspan="2"&gt;&lt;strong&gt;Inputs&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" colspan="2"&gt;&lt;strong&gt;Outputs&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;CK&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;D&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;Q&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;span style="text-decoration:overline;"&gt;Q&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;X&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;" colspan="2"&gt;No Change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 18: D Flip-flop and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This ability to store states within our logic design allows more complex logic structures to be implemented. It also aids timing as the output of the combinatorial logic circuit must be stable just before the clock is applied to the Flip Flop to store the next value, thereby eliminating glitches. But as we will see this introduces more issues as well, especially when there are multiple layers of logic between flip flops.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.1 Half Adder in a Synchronous Design&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In this example, you can see the two-clock cycle delay between the application of an input and the generation of the output. The first clock cycle stores the inputs A and B in the first flip flops. The output of these flip flops will then be passed through the combinatorial logic, in this case, the half adder. The output of the half adder is then stored into the second rank of flip flops and output on the second clock cycle.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 25px 5px 0px;width:350px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 19a: Example Half Adder in a synchronous design (clock is shown in orange).&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:350px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 19b: Timing Diagram for the example Half Adder in a synchronous design above.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/center&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.2 Shift Registers and Counters&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The three most commonly implemented sequential logic design structures are shift registers, counters, and state machines.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Shift registers in their basic form are a collection of Flip Flops where the output of one flip flop feeds the input of the next flip flop. Signals are then progressed through the shift register on each clock. We can use shift registers for a range of things in our logic design from delays (although there are better ways to implement delays) to metastability synchronizers, as well as conversion between serial and parallel and the generation of random numbers using feedback correctly.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 20: Shift Register and associated timing diagram.&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In many designs, we need to time events or introduce delays between the generation or issuing of signals. We do this by using a counter. In this application, we use the flip flops to store the count and combinatorial logic to determine the next value of the count based upon the current value.&lt;/p&gt;
&lt;div style="float:left;padding:12px 20px 5px 0px;width:260px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram21_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram21_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 21: Four-bit counter state diagram&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The first stage in the development of a counter is to create a simple state diagram which shows the counter behavior.&lt;/p&gt;
&lt;div style="clear:both;float:left;padding:12px 20px 5px 0px;width:260px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Present A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Present B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Next A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Next B&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 22: Present State, Next State Table for the counter&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Once the state diagram is created, we can then create a present state, next state table and extract from it the logic equations to implement the counter. Of course, while the example counts in sequential binary, if we desired, we could have the counter count in gray code, etc.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the present state, next state table (PS, NS) created, we can then create the logic equations needed to create in combinatorial logic. If necessary we can use Karnaugh-maps, etc. However, for this simple example we can work directly from the present state, next state table.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the PS, NS table, we create a logic equation for each of the next states, e.g. next A. As such the equations are: &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;Next A = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;Next B = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;From these equations we can generate the logic circuit which contains the D Type flip flops and logic gates.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 25px 5px 0px;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 23: Logic Design for a two-bit counter.&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Along with counters, logic designs are often called upon to perform sequence and control-based actions. These actions and sequences are best addressed using a state machine.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.3 State Machines&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;State machines are logical constructs that transition between a finite number of states, like a counter; however, the path through the states is not sequential. A state machine will only be in one state at a point in time. It will transition between states depending upon several triggers, e.g. inputs or counter values, etc.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Theoretically, state machines are divided into two basic classes: Moore and Mealy. They differ only in how the state machine&amp;#39;s outputs are generated.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Moore:&lt;/strong&gt; State Machine outputs are a function of the present state only. A classic example is a counter.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Mealy:&lt;/strong&gt; State Machine outputs are a function of the present state and inputs. A classic example is the &lt;a class="jive-link-external-small" href="http://en.wikipedia.org/wiki/Richards_controller" rel="nofollow ugc noopener noreferrer" target="_blank"&gt;Richards Controller&lt;/a&gt;.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we are faced with the task of defining a state machine, we will develop a state diagram as we would do for a counter. The state diagram shows the states, inputs, and the transitions between the states and the outputs from the state machine. Figure 24 demonstrates the two types of state diagrams: one for a Moore State Machine (left), the other a Mealy State Machine (right).&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:200px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 24: State Diagrams for a Moore (left) and Mealy (right) State Machine.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we were to implement these in logic gates and flip flops we would generate a present state, next state table, as we did for the previous counter example, and then create the logic equations for each of the state variables. The only difference is that, along with the current state, the present state, next state table will also have to consider the inputs and outputs for the state machine.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec10"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;10. Programmable Logic with FPGAs&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;So far, we have looked at how we create logic designs and implement them with discrete logic gates and flip flops. However, the most common way of implementing a logic design is using a programmable logic device (PLD) such as a Complex Programmable Logic Device (CPLD) or a Field Programmable Gate Array (FPGA). These devices enable the implementation of large logic designs and, depending upon the technology of the device used, they can be reprogrammed in the field.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Programmable logic devices are available in three different technologies:&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;SRAM:&lt;/strong&gt; The FPGA program is stored in an external memory and loaded into the FPGA each time it is powered.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;FLASH:&lt;/strong&gt; The FLASH architecture of the FPGA also contains the program; no external memory device is needed.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;One Time Programmable (OTP):&lt;/strong&gt; The FPGA is applied by blowing fuses in the device. Once programmed, it cannot be modified.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Typically, SRAM-based programmable logic is used where high performance is required, while Flash-based devices are used in middle-to-low performance applications. While one time programmable devices are very limited in application, they still remain popular in space applications.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The key to programmable logic is how logic equations are implemented in the device. It is of course very difficult for the device designers to include a range of AND, OR gates, etc. as the number of each gate type will vary with each application. This will result in either many unused gates or a shortage of a needed gate type. Either way it would not be an efficient method for the implementation of a programmable logic device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Device manufacturers addressed this challenge in a very smart manner. In place of discrete gates, they use a several input look up table (LUT) which is programmed to implement the combinatorial logic equations. In many respects, this LUT is very similar to a multiplexer. Let&amp;#39;s take a quick look at how we can use a LUT to implement logic equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Using the same truth table as for the previous example, we can set the LUT inputs to either ground or VCC depending upon the truth table&amp;#39;s needs. We can then use the logic equation inputs (A,B,C) to drive the LUT selection inputs to output the correct value for that particular input combination implementing the desired logic equation.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram25_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram25_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:240px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 25: Setting the LUT&amp;#39;s Inputs to the Truth Table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Using a LUT inside our programmable device therefore provides the best flexibility to implement a wide range of logic equations.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Of course, we do not want to just implement the combinatorial logic circuits. We also want to implement sequential structures. This means that following the LUT there needs to be a flip flop to act as storage for the combinatorial output such that we can implement sequential structures.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;This combination of a LUT and Flip Flop is often called a Configurable Logic Block (CLB). A programmable logic device will consist of many thousands of CLBs. To provide the most flexibility, additional multiplexers will be used to support a wide range of CLB configurations.&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram26_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram26_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 26: Very Basic Logic Slice&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Obviously, modern devices have very complex CLB structures, which include local memory, fast carry inputs, arithmetic functions, and shift registers.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, these CLB&amp;#39;s need to be interconnected, which is where the device interconnect comes in, which allows the output of one CLB to be connected to the input of another CLB and eventually to the Input/Output of the device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This routing can be considered at two elements. First, there is global routing, which distributes global signals such as clocks. These are global specialist routing networks designed to be low skew and support high fan outs. This dedicated clocking network might be further split between truly global routes across the device and several additional regional limited routes to a specific area of the device. For all other signals, the programmable interconnect is used, which connects the CLBs to each other and other specialist functions within the device. To connect CLBs together it uses a switch matrix, which is configured to provide the internal routing between CLBs.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One of the key drivers of programmable logic technology development was the reduction in the cost of transistors.&amp;nbsp; However, interconnect wires also played a role in enabling much larger devices at reduced cost.&amp;nbsp; When we develop programmable logic applications we spend a lot of time and effort optimizing the performance of the design with regards to its routing to ensure we can operate at the desired clock frequency.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram27_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram27_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 27: CLB and Routing matrix&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To get signals on and off the chip, programmable logic devices also provide IO cells, which are configurable. These enable the device to support a range of single-ended logic standards, e.g. LVCMOS2v4, LVCOM 1V5, etc., Stub Series Terminated Logic (SSTL) as used for High Speed DDR interfaces, and a range of differential standards, including Low Swing Differential Voltage Signaling (LVDS).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Many devices also include complex structures in the IO cells to allow for double data rate signals, source synchronous designs, bus skew correction, and conversion to/from serial. Electrically, the IO can control slew rates, drive strengths and even match the impedance with the transmission line, all of which are controlled by the developer. This means that given the right PHY on the board, using programmable logic, we can achieve any-to-any interconnectivity.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec11"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;11. Hardware Description Languages&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Thanks to the sheer scale of resources offered by programmable logic we cannot any longer design at the gate level like we have done previously. It would simply take too long to develop applications which can leverage the resources provided by the programmable device at the gate level. In the place of developing by using logic equations, we use Hardware Description languages (HDL) such as Verilog or VHDL.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we work with these languages, we do not describe the logic equations, but rather the desired behavior at the register transfer level (RTL). This allows us to define the functionality of the programmable logic device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;How our description gets translated from our HDL file into the logic equations and implemented in the programmable logic device requires several stages.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Synthesis&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;The conversion of the HDL file into logic equations often targeted at the specific resources of the programmable logic device.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#f17c0e;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Placing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;Placing of the identified logic cells (LUT, Flip Flops, etc.) into the programmable logic CLBs.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#003082;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Routing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;Connecting together the placed CLBs to achieve the required performance.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 28: Stages to Convert HDL File into Logic Equations&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Each stage often requires addition constraints to ensure the desired timing is achieved or the correct IO standards are used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;What developers who are used to using VHDL and Verilog will be familiar with is that not all constructs / commands within a language can be synthesized. Therefore, there is only a subset of language commands and coding structures which can be synthesized into a programmable logic device successfully. The remaining elements of the HDL language which are not synthesizable are used in the verification of the design before we implement it in the device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This verification is called the development of a test bench which ensures the Unit Under Test (UUT) meets its specification and is suitable for its intended purpose. When it comes to test benching, we have a couple of choices as to how we perform it.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Functional Simulation only:&lt;/strong&gt; This checks if the design is functionally correct.&amp;nbsp; It does not include internal device timing delays such as propagation delays, which may affect performance when implemented in the device.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Gate Level Simulation:&lt;/strong&gt; This verifies the functionality of the design when back annotated with timing information from the final implemented design. This can take considerable time to perform.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram29_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram29_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 29: Example Test Bench architecture&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Let&amp;#39;s look at how we would implement a state machine using the VHDL Language. Learning VHDL itself is a short course; however, we can briefly introduce the basics here.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A VHDL file is split into two distinct elements, the entity and the architecture. The entity defines the input and outputs of the VHDL module and if it is at the top level of the design. It represents the inputs and outputs of the programmable logic device itself.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The architecture defines the functionality and consists of either sequential statements, which are all executed in parallel or processes.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Processes execute sequentially from top to bottom, more like in a traditional programming application. However, there are rules around when signals update during the process. Additionally, each process in the architecture runs in parallel as you are describing logic functions.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;table width="100%"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="padding-right:15px;"&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state only&lt;/span&gt; &lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state and inputs&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 30: VHDL Architecture which shows the implementation of the state machines in the above example&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the above example, the process runs each time the clock or reset is changed. This is defined in the sensitivity list of the process declaration.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In these examples, the reset is asynchronous and used to reset the current state and the output, while the next actions only occur following the rising edge of the clock. Where the state machine progresses through each state depends upon its inputs and current state, moving if necessary to the next state.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;What this demonstrates is that, using programmable logic and HDL, we can directly code the state machine or counter from the state diagram and without the need to create the logic equations. Indeed, we let the synthesis tool do that for us.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="clear:both;font-size:11px;margin:0;padding-top:12px;"&gt;*Trademark. &lt;strong&gt;Xilinx is a trademark of Xilinx Inc.&lt;/strong&gt; Other logos, product and/or company names may be trademarks of their respective owners.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;border:1px solid #a9aaaa;padding:12px 12px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/PrgmLogic_profile.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox essProfile" style="float:left;padding-right:10px;vertical-align:middle;"  height="115" src="/e14/assets/legacy/2018/PrgmLogic_profile.png" /&gt;&lt;/a&gt;
&lt;div&gt;
&lt;p style="color:#007fac;font-size:15px;margin:0;padding-bottom:10px;"&gt;Shop our wide range of &lt;strong&gt;FPGAs, SoCs, EVMs, application specific kits, embedded development boards, and more.&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-AU_CN_HK_IN_KR_MY_NZ_PH_SG_TH_TW_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://sg.element14.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-AT_BE_BG_CZ_DK_EE_FI_FR_DE_HU_IE_IL_IT_LV_LT_NL_NO_PL_PT_RO_RU_SK_SI_ES_SE_CH_TR_UK_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://uk.farnell.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-US_BR_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://www.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-CA_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://canada.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-MX_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://mexico.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:20px;"&gt;&lt;a name="test"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="color:#007fac;font-size:18px;margin:0;padding-bottom:8px;"&gt;&lt;strong&gt;Test Your Knowledge&lt;/strong&gt;&lt;span style="float:right;font-size:11px;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a href="/e14/assets/legacy/2018/100x100_PrgmDevice1Bdg.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox" style="float:left;padding:0px 10px 5px 0px;vertical-align:top;"  height="80" src="/e14/assets/legacy/2018/100x100_PrgmDevice1Bdg.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-bottom:8px;"&gt;Are you ready to demonstrate your Essentials of Programmable Logic knowledge? &lt;strong&gt;Then take a quick 15-question, multiple-choice quiz to see how much you&amp;#39;ve learned from this Programmable Devices module.&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;strong&gt;To earn the Programmable Devices I Badge&lt;/strong&gt;, read through the module to learn all about Programmable Logic, attain 100% in the quiz at the bottom, leave us some feedback in the comments section, and give the module a star rating.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&lt;div class="voltquiz" data-formid="0fcd3450-c4f3-4322-8af1-4b03e66c0ed0" data-formtype="quiz" data-success-message="" data-fail-message="" data-pass-mark="OTk=" &gt;&lt;/div&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="e14-quiz-document-metadata e14-init-hidden"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class="migration-injected-attachments"&gt;
&lt;div style="font-weight:bold;margin:15px 0 5px 0;"&gt;Attachments:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;table style="border:0;"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width="160"&gt;&lt;span id="attid_https://www.element14.com/community/api/core/v3/attachments/265862" class="_se_attachment"&gt;&lt;a href="https://community.element14.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-02-50/Programmable-Devices-I-_2D00_-Programmable-Logic.pdf"&gt;community.element14.com/.../Programmable-Devices-I-_2D00_-Programmable-Logic.pdf&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:80%;"&gt;Programmable Devices I - Programmable Logic.pdf&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;script&gt;window.top.e14.func.queueScripts.add(function() { window.top.e14.func.e14ConditionalContent();} );&lt;/script&gt;

&lt;div style="font-size: 90%;"&gt;Tags: fpga_essentials, programmable_devices, xilinx_essentials, xilinx, fpga, programmable_device, programmable_logic, ess_module&lt;/div&gt;
</description></item><item><title>Programmable Devices I: Programmable Logic</title><link>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic/revision/2</link><pubDate>Thu, 04 Nov 2021 22:27:51 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:722dc523-e66e-42a7-84b5-de3f2731c4d8</guid><dc:creator>dychen</dc:creator><comments>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic#comments</comments><description>Revision 2 posted to Documents by dychen on 11/4/2021 10:27:51 PM&lt;br /&gt;
&lt;p&gt;&lt;span&gt;&lt;div class="e14-navigation-buttons"&gt;&lt;a href="/community/learning-center/online-learning/essentials?ICID=essentials-prgmdevice1-doc"&gt;
                    &lt;button class="e14-nav-button-prev"&gt;Previous&lt;/button&gt;
                &lt;/a&gt;&lt;a href="/learn/learning-center/online-learning/essentials/w/documents/4109/programmable-devices-ii-programmable-socs?ICID=essentials-prgmdevice1-doc"&gt;
                    &lt;button class="e14-nav-button-next"&gt;Next&lt;/button&gt;
                &lt;/a&gt;&lt;/div&gt;&lt;script&gt;e14.func.queueScripts.add(function(){ e14.func.repositionNavButtons(); })&lt;/script&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div style="background-color:#f9f9f9;border:1px solid #c6c6c6;display:block;float:right;padding:6px 8px;width:212px;"&gt;&lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/learn/learning-center/"&gt;element14 Learning Center&lt;/a&gt;&lt;/div&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="border:1px solid #c6c6c6;clear:both;padding:8px;"&gt;
&lt;div style="display:inline-block;padding-right:16px;vertical-align:top;"&gt;&lt;a href="/learn/learning-center/online-learning/essentials/"&gt;&lt;img alt="image"  src="/e14/assets/legacy/2017/learningess.png" width="175px" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;"&gt;
&lt;p class="essTitle" style="font-size:18px;font-weight:bold;margin:0;" title="Programmable Logic"&gt;&lt;span style="color:#007fac;"&gt;Programmable Devices I: &lt;/span&gt; Programmable Logic&lt;/p&gt;
&lt;p style="margin:0;padding:8px;"&gt;&lt;span style="font-size:11px;padding-right:10px;"&gt;&lt;em&gt;Sponsored by&lt;/em&gt;&lt;/span&gt;&lt;a href="http://www.xilinx.com/" rel="nofollow ugc noopener noreferrer" target="_blank"&gt;&lt;img loading="lazy" alt="image" class="essSponsor" style="vertical-align:top;" title="Xilinx"  height="25px" src="/e14/assets/legacy/2018/xilinxlogoSM.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;div style="clear:both;line-height:1.5;"&gt;&lt;span style="padding-right:6px;"&gt;&lt;a class="jive-link-anchor-small" href="#intro"&gt;1. Introduction&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#object"&gt;2. Objectives&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec3"&gt;3. Boolean Algebra&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec4"&gt;4. Logic Gates&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec5"&gt;5. Transistor Implementation of a Gate&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec6"&gt;6. Propagation Delay&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec7"&gt;7. Combinatorial Circuit Example&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec8"&gt;8. Arithmetic in Logic&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec9"&gt;9. Sequential Circuits&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec10"&gt;10. Programmable Logic with FPGAs&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec11"&gt;11. Hardware Description Languages&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-wiki-small" href="/learn/learning-center/online-learning/essentials/w/documents/3803/related-components-dev-boards-for-element14-essentials-programmable-devices-i"&gt;Related Components &amp;amp; Dev Boards&lt;/a&gt;&lt;/span&gt; | &lt;span style="font-weight:bold;padding:0px 6px;"&gt;&lt;a href="#test"&gt;Test Your Knowledge &lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/LinkArrow.gif" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="background-color:#e4f2f8;border:1px solid #b8d7e5;float:right;margin:20px 0px 5px 5px;padding:12px;width:155px;"&gt;
&lt;p style="color:#007fac;font-weight:bold;margin:0;"&gt;Also Available:&lt;/p&gt;
&lt;p style="margin:0;padding-top:5px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;a class="jive-link-wiki-small" href="/learn/learning-center/online-learning/essentials/w/documents/4109/programmable-devices-ii-programmable-socs"&gt;Programmable Devices II: Programmable SoCs&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:5px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;a class="jive-link-wiki-small" href="/learn/learning-center/online-learning/essentials/w/documents/4501/programmable-devices-iii-fpga-programmable-soc-programming-languages"&gt;Programmable Device III: FPGA / Programmable SoC Programming Languages&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="color:#007fac;font-size:15px;margin:0;padding:8px 0px;"&gt;&lt;a name="intro"&gt;&lt;/a&gt;&lt;strong&gt;1. Introduction&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;The world and our interaction with it is analog. Our surrounding environment, colors in the electromagnetic spectrum, speech, and sound all are represented by continuously changing analog values. When it comes to processing these analog signals, however, digital systems offer several benefits to a traditional analog processing solution. For example, they have higher performance, ease of storage and transmission, and better noise immunity. As such, while the world is analog, it is mainly processed digitally using logic circuits. In this learning module, you will be introduced to the essentials of logic design, and how it can be implemented using programmable logic.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="object"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin:0;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;&lt;strong&gt;2. Objectives&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 8px 35px;"&gt;&lt;em&gt;Upon completion of this module, you will be able to:&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Perform some fundamental operations of Boolean algebra&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Explain the operation and truth tables of common logic gates&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Illustrate how combinatorial circuits are designed&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Discuss the differences between combinatorial and sequential circuits&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Understand how shift registers, counters, and state machines operate&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Explain the basic structures of PLDs&lt;/p&gt;
&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; Describe the role of HDLs&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec3"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;3. Boolean Algebra&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The key foundation of digital logic is Boolean Algebra. Without understanding it we cannot produce effective logic designs or understand the outputs of higher level tools such as synthesis engines.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Boolean algebra is named after its inventor, George Boole, who in 1854 published his work entitled, &amp;quot;An investigation of the laws of thought on which are founded the mathematical theories of logic and probabilities.&amp;quot; This work was later used by Claude Shannon in his 1937 master&amp;#39;s thesis at MIT entitled, &amp;quot;A Symbolic Analysis of Relay and Switching Circuits,&amp;quot; which demonstrated that switching circuits could solve all problems in the same manner as Boolean algebra. Thus, the relationship between switching circuits and Boolean algebra became the foundation of all digital applications.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.1 Boolean Addition and Multiplication&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1+0=1&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+1=1&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1+1=1&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As you can see, the result of the SUM is equal to one only when one or more of the literals is one.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Boolean multiplication produces the PRODUCT of the literals:&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.1=0&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1.1=1&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In this case, you can see the PRODUCT is equal to one only when both literals are equal to one.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Understanding the meaning of the SUM and PRODUCT terms will be important later when we examine logic gates and equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.2 Boolean Algebra Laws&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Just as in other areas of mathematics, Boolean algebra has several laws which we must understand, such as:&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Commutative Law:&lt;/strong&gt; The order of literals in Boolean addition does not affect the result: A+B=B+A&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Associative Law:&lt;/strong&gt; When performing Boolean addition of more than two literals, the result is the same regardless of grouping:&amp;nbsp; A+(B+C)=(A+B)+C&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Distributive Law:&lt;/strong&gt; Performing a Boolean addition of two or more literals before performing a Boolean multiplication on the result is the same as performing the Boolean multiplication with each literal before performing the Boolean Addition A(B+C)=AB+AC&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;These laws become very important when we design logic circuits and wish to optimize the number of logic gates we use in our solution.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Along with these laws we also have twelve rules of Boolean Logic with which we must become familiar. They are:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:white;padding:6px;" colspan="2"&gt;&lt;strong&gt;12 Boolean Logic Rules&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + 0 = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . A = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + 1 = 1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . 0 = 0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;a href="/e14/assets/legacy/2018/A2bars.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/A2bars.png" /&gt;&lt;/a&gt; = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . 1 = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + A.B = A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + A = A&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B = A + B&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;(A + B).(A+C) = A + B.C&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.3 DeMorgan&amp;#39;s Theorem&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The final remaining element we need to understand about Boolean Algebra is DeMorgan&amp;#39;s Theorem which states, &amp;quot;The complement of a product of sums is equal to the sum of the complements.&amp;quot;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This is better shown represented as an equation: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A good mnemonic device to remember this is: &amp;quot;break the bar, change the sign.&amp;quot;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, now that we understand Boolean algebra, we want to be able to see how it maps to the logic gates we use to implement digital circuits.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec4"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;4. Logic Gates&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The seven commonly used logic gates in digital design are NOT, AND, OR, XOR, NOR, NAND and XNOR gates. In our designs we use combinations of these logic gates to implement the logic function. In this section, we&amp;#39;ll review these logic gates.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;At the lowest level these logic gates are made from arrangements of transistors; however, each arrangement has its own symbol and truth table, which shows for a given input what its outputs will be. (Note: For simplicity&amp;#39;s sake, except for the NOT gate, all gates are demonstrated with two inputs).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.1 NOT Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of the logic gates is the NOT gate. This gate simply inverts the logic value presented on the input.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram1_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:150px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NOT symbol &amp;amp; truth table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 1: NOT Gate&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.2 AND Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One of the most commonly used logic gates is the AND gate, which implements Boolean algebra multiplication and produces the PRODUCT of its inputs as we described earlier in this learning module.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram2_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram2_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;AND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 2: AND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.3 OR Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To implement Boolean addition and generate the SUM of its inputs, we use the OR Gate which uses the symbol as shown in Figure 3.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram3_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram3_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;OR Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 3: OR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The remaining logic gates are derivatives of the AND, OR, and NOT functions. However, the NAND and NOR gates have proven to be very popular due to their universality, which allows any logic gate&amp;mdash;AND, OR, NOT&amp;mdash;to be implemented using these two gates. We will look at exactly how we can do this in an example further on in this learning module.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.4 NAND Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of the gates is the NAND gate, which stands for Not AND. This can be represented by an AND gate followed by a NOT gate. However, it is normally shown as an AND gate with an inversion bubble on its output.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram4_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram4_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NAND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 4: NAND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.5 NOR Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A similar logic gate is the NOR gate, which is also a universal gate and represents the NOT OR function. We represent the NOR symbol as the OR gate with an inversion bubble.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram5_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram5_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NOR Symbol and Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 5: NOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.6 XOR and XNOR Gates&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The final two gates are the XOR and XNOR gates, which are constructed from logic gates already introduced. However, they provide very useful functions allowing us to determine if both inputs agree (XNOR) or both inputs differ (XOR).&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;XOR Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 6a: XOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;
&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;XNOR Symbol &amp;amp; Truth Table &lt;/strong&gt;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 6b: XNOR Gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec5"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;5. Transistor Implementation of a Gate&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As mentioned earlier in this learning module, each of the logic gates consists of several transistors arranged to implement the desired logic gate.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:280px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram7_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram7_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 7: Transistor Level implementation of a NOT Gate&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of these is the NOT gate, which uses two complementary transistors to invert the input at its output. When the Input is high, transistor Q1 is turned off thanks to the inversion, while transistor Q2 is turned on pulling the output to ground, which is the opposite of the presented signal. Conversely, when the input is low, transistor Q2 is this time turned off, while Q1 is turned on, pulling the output to the power rail and outputting a logic high.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:280px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram8_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram8_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 8: Transistor level implementation of a AND Gate&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This NOT structure is also used in more complex gates such as the AND gate. Looking at the transistor level of the AND gate you will first notice the Output stage Q5 and Q6 is the same as for the NOT gate function.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When inputs A and B are both high, transistors Q1 and Q2 are turned on while Q3 and Q4 are turned off. This pulls the input to Q6 and Q5 low, which due to the inversion means Q5 turns on and Q6 turns off allowing the output to be set high. For all other combinations at least one of Q1, Q2, Q3 and Q4 is turned off ,which pulls the input to Q5 and Q6 high, as such turning on Q6 and off Q5 pulling the output low as would be expected for an AND logic gate.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec6"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;6. Propagation Delay&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we implement logic circuits, using logic gates, we call these combinatorial logic circuits as there is no storage or feedback. To ensure these circuits function as intended we also, need to understand what occurs when an input changes. As just demonstrated, logic gates are made up from arrangements of switching transistors, and as such it takes time for a change at an input to result in a change of the output.&amp;nbsp; We call this delay the PROPAGATION time and it will vary depending upon the logic family used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To ensure we are all on the same page, there are several different logic families, each implemented in different underlying technologies such as CMOS (Complementary Metal Oxide Semi-conductor) or TTL (Transistor to Transistor Logic). Each logic family will exhibit a different propagation delay, which will limit the switching frequency of the logic design. If we are testing in the lab, we measure the propagation delay between the mid-point (50%) of the rising and falling edges as shown below.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram1_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:255px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 9: Timing Diagram of NOT gate&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The propagation time is normally defined within the data sheet for the logic gate selected; however, it will often list two propagation times: one for the high to low transition and another for the low to high transition.&amp;nbsp; Of course, the propagation time will also be affected by the ambient temperature, changes in power supply conditions, resistance of the driver, and the capacitive load on the device output.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We call the output driving several devices inputs the FANOUT. The higher the fanout, the larger the loading, and, therefore, the slower the output rise and fall times. Typical values of propagation time in logic datasheets range from 5 ns to 35 ns, depending upon the logic family, minimum/maximum behavior, and loading conditions (FANOUT).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we develop our combinatorial circuit, which will typically consist of several levels of logic gates, due to the layer on gates, we need to be careful of the differing propagation delays, as differing propagation delays can lead to glitches in the output value which are not correct. This is one of the reasons that in many applications, combinatorial circuits are used with storage elements like D type flip flops and an associated clock to ensure the output does not glitch and is stable when it is presented to the next processing/decision element.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;However, if we are working purely with combinatorial circuits, we can also take some steps to mitigate these glitches, which are often referred to as RACE Hazards.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec7"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;7. Combinatorial Circuit Example&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The best way to demonstrate how we can pull together what we have learned so far about Boolean Algebra, Logic Gates, Propagation Delays, and Hazards is to outline a few simple examples.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;For the first example, we will create a system which monitors three motors. Each motor has a health indication output which is high when the motor has a fault. For the overall system to function correctly, at least two of the motors must be working correctly, therefore, we will create a system that outputs a logic high when two out of the three motors have asserted their fault outputs.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The first stage in developing this solution is to create a truth table that shows the possible input combinations and the correct output for each of those input conditions. As we have 3 inputs, then there are 2&lt;sup&gt;3&lt;/sup&gt; or eight possible combinations of the input:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:0px 15px 5px 0px;vertical-align:top;width:230px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="30%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 10: Truth Table for the motor monitoring system&amp;#39;s logic function&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;From this truth table we can generate the following logic equations: &lt;strong&gt;OP = (A.B) + (A.C) + (B.C)&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We call the format of this equation a SUM of PRODUCTS (SOP) equation as the OP is the Boolean SUM (Logical OR) of the Boolean PRODUCTS (AND) equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we so desired, we could calculate a PRODUCT of SUMS (POS) output by following the approach.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Firstly, we create the SOP logic equation for each entry on the truth table where the output is low: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;OP&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;A.C&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B.C&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;div style="padding-top:12px;"&gt;Next, we apply DeMorgan&amp;#39;s theorem to convert from the SOP to the POS format. The first step is to invert the SOP equation: &lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/PrgmLogicEQ1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can then apply DeMorgan&amp;#39;s theorem and the ninth law of logic to create the final POS equation: &lt;strong&gt;OP=(A+B).(A+C).(B+C)&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;For the remainder of this example, however, we will work with the SOP format as that is the most common method for implementing logic functions. As such, we can realize our SOP equation using a two-level logic circuit as below:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:8px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram11_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram11_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 11: Example Logic Circuit in SOP form&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With this two-level network, we need to consider the propagation delay through the first AND gate level and the impact it might have on the output.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, this implementation uses two logic gate types (AND, OR). But it is possible to implement the same logical function using only NAND gates, as they are universal.&amp;nbsp; Thanks to DeMorgan&amp;#39;s Theorem, the NAND gate also implements the Negative OR function: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:8px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram12_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram12_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 12: Example Logic Circuit in SOP form implemented using NAND Gates&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;As such, we can redraw the logic circuit above.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Let&amp;#39;s look at how we get the same functionality using NAND gates. The output equation can be represented as: &lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ2.png"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/2018/PrgmLogicEQ2.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Using DeMorgan&amp;#39;s Theorem, we can iterate through the following steps, changing the sign as we break the bar and applying other rules of Boolean algebra:&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2" /&gt;&lt;/a&gt;&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we are working with POS logic equations, we can use NOR gates to implement the logic equation and prove the functionality the same way using DeMorgan&amp;#39;s Theorem and Boolean Algebra rules.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the example above, we used a truth table to determine the logic equations and it works well for a simple application. However, if we have more complex applications we need a better way of determining the logic equations. This is where the Karnaugh-map (Kmap) comes into play. Kmaps are visual representations of the logic behavior which allow us to use our natural ability for pattern recognition to determine the logic equations.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 13: Example Karnaugh-map used for four variables (A,B,C,D). Note the gray scale count.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Karnaugh-maps are used by grouping together adjacent 1&amp;#39;s for SOP and adjacent 0&amp;#39;s for POS. These groupings can then be used to determine the logic equation, using the rules of Boolean Algebra to implement the desired functionality.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 14: Example of a Karnaugh-map: Grouping the 1s together.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Often, if we use a Karnaugh-map, we will obtain an equation which uses the minimum number of logic gates to implement. Using the example to the left we can group together the 1&amp;#39;s within the design where they are adjacent to each other.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The example groups together four 1&amp;#39;s within the center of the Karnaugh-map (highlighted green), and from this we can see that the logic equation is D.B as the C and A cancel each other out due to being across not C and C or not A and A, respectively.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The blue elements in the corner can also be grouped together as they are also judged to be adjacent, since the Karnaugh-map is judged to wrap around edge to edge and top to bottom. As such, the second equation to be extracted from the Karnaugh-map is C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;; therefore, the resulting logic equation for the Karnaugh-map is: &lt;strong&gt;OP = C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + D.B&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can also use Karnaugh-maps to identify hazards which might result in glitches during operation and help us eliminate them. In the next example, we can extract the logical equation for the green and blue cells as: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D&lt;/strong&gt;&lt;/p&gt;
&lt;div style="clear:both;float:left;padding:12px 10px 5px 0px;width:170px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/ABBCimg.png" /&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;border-left:2px solid #D23620;border-right:2px solid #D23620;border-top:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#d0df89;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="background-color:#bad7fe;border:1px solid #b8d7e5;border-bottom:2px solid #D23620;border-left:2px solid #D23620;border-right:2px solid #D23620;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 15: Karnaugh-maps: Identifying Potential Hazards&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;However, this leaves the equation highlighted by the red circle as a potential hazard, which occurs when the input D changes from a 1 to a 0. The output is intended to stay high; however, there is not a specific term in the logic equation to address it. To remove the hazard, we should update the logic equation. See in the additional equation where the red text is: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D + &lt;span style="color:#d23620;"&gt;&lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B.C.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;By this point now you should be familiar with Boolean Algebra, logic gates, how they relate to each other, and how they are used with truth tables and Karnaugh-maps to not only determine logic equations but also to identify race conditions. You should also understand how we can use universal gates for implementing logic equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the basics of Boolean Algebra and logic gates introduced, we can focus now on how to create logical structures which can be used in applications. As such, we are going to explore Half and Full Adders along with the basics of synchronous logic design, using flip flops and their application, to help us create counters, shift registers, and state machines.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec8"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;8. Arithmetic in Logic&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;There are times in logic design when we want to perform mathematical operations such as Addition, Subtraction, Multiplication, and Division. While how we do this and number systems we use can be a course on its own, the Half and Full Adder are the key logic circuits we use to achieve these and should be introduced here.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.1 Half Adder&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The Half Adder is so called as it adds two input variables, generating a sum and carry outputs; it has no ability to accept a carry-in from a previous adder.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram16_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram16_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:250px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 16: Half Adder logic diagram and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.2 Full Adder&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The Full Adder provides the ability to accept a carry-in and is therefore used more commonly when working with multi-bit buses in logic.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 20px 5px 0px;width:380px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram17_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram17_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:320px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry In&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Carry Out&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 17: Full Adder logic diagram and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, like any logic circuits, there are variations optimized for different applications, including Ripple Carry Adder, Carry Look Ahead, and Carry Save Adders.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;We can also use the same adders for subtraction, if we use the twos complement number system to represent signed numbers.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.3 Signed and Unsigned Number Systems&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;For those not familiar with signed and unsigned binary numbers, we&amp;#39;ll very briefly discuss them now. Simply stated, there are several number systems which allow us to represent both signed and unsigned number systems.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Unsigned numbers are the simplest and we can represent a range of 0 to 2&lt;sup&gt;n&lt;/sup&gt;&amp;ndash;1, where n is the width of the bus. Unsigned numbers always represent positive numbers.&amp;nbsp; To represent signed numbers, we have a choice of several number systems, the most common being the Sign and Magnitude, Ones Complement, or Twos Complement.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Sign and Magnitude utilizes the left most bit (often called the most significant bit) to represent the sign of the number (0 = positive, 1 = negative), and the remainder of the bits represent the magnitude.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the Sign and Magnitude system, both positive and negative numbers have the same magnitude; however, the sign bit differs. Due to this it is possible to have both a positive and negative zero within the Sign and Magnitude system.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Ones Complement uses the same unsigned representation for positive numbers as the Sign and Magnitude representation. However, for negative numbers, the inversion (ones complement) of the positive number is used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Twos Complement is the most widely used encoding scheme for representing signed numbers. Just like Sign and Magnitude and Ones Complement schemes, positive numbers are represented in the same manner as an unsigned number. While negative numbers are represented as the binary number, you add to a positive number of the same magnitude to get zero. A negative twos complement number is calculated by first taking the ones complement (inversion) of the positive number and then adding one to it. The twos complement number system allows subtraction of one number from another by performing an addition of the two numbers. The range a twos complement number can represent is given by: &lt;strong&gt;-(2&lt;sup&gt;n-1&lt;/sup&gt;) to + (2&lt;sup&gt;n-1&lt;/sup&gt;&amp;ndash;1)&lt;/strong&gt;.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One method we can use to convert a number to its twos complement format is to work right to left, leaving the number the same until the first one is encountered; after this each bit is inverted.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec9"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;9. Sequential Circuits&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Combinatorial logic circuits are unable to implement functions that require knowledge of their previous inputs or decisions as they contain no memory/storage elements.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In contrast, sequential circuits&amp;#39; outputs are based upon not only current inputs but also previous inputs and decisions. Sequential logic circuits achieve this by using storage elements called flip flops, the simplest of which is the D Type flip flop. The value stored in the flip flop is updated at a regular interval as indicated by the clock signal.&lt;/p&gt;
&lt;div style="float:left;"&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:180px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram18_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram18_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:160px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" colspan="2"&gt;&lt;strong&gt;Inputs&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" colspan="2"&gt;&lt;strong&gt;Outputs&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;CK&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;D&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;Q&lt;/td&gt;
&lt;td style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;span style="text-decoration:overline;"&gt;Q&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;X&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;" colspan="2"&gt;No Change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 18: D Flip-flop and truth table&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This ability to store states within our logic design allows more complex logic structures to be implemented. It also aids timing as the output of the combinatorial logic circuit must be stable just before the clock is applied to the Flip Flop to store the next value, thereby eliminating glitches. But as we will see this introduces more issues as well, especially when there are multiple layers of logic between flip flops.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.1 Half Adder in a Synchronous Design&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In this example, you can see the two-clock cycle delay between the application of an input and the generation of the output. The first clock cycle stores the inputs A and B in the first flip flops. The output of these flip flops will then be passed through the combinatorial logic, in this case, the half adder. The output of the half adder is then stored into the second rank of flip flops and output on the second clock cycle.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 25px 5px 0px;width:350px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 19a: Example Half Adder in a synchronous design (clock is shown in orange).&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:350px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 19b: Timing Diagram for the example Half Adder in a synchronous design above.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/center&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.2 Shift Registers and Counters&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The three most commonly implemented sequential logic design structures are shift registers, counters, and state machines.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Shift registers in their basic form are a collection of Flip Flops where the output of one flip flop feeds the input of the next flip flop. Signals are then progressed through the shift register on each clock. We can use shift registers for a range of things in our logic design from delays (although there are better ways to implement delays) to metastability synchronizers, as well as conversion between serial and parallel and the generation of random numbers using feedback correctly.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 20: Shift Register and associated timing diagram.&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In many designs, we need to time events or introduce delays between the generation or issuing of signals. We do this by using a counter. In this application, we use the flip flops to store the count and combinatorial logic to determine the next value of the count based upon the current value.&lt;/p&gt;
&lt;div style="float:left;padding:12px 20px 5px 0px;width:260px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram21_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram21_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 21: Four-bit counter state diagram&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The first stage in the development of a counter is to create a simple state diagram which shows the counter behavior.&lt;/p&gt;
&lt;div style="clear:both;float:left;padding:12px 20px 5px 0px;width:260px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Present A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Present B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Next A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Next B&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 22: Present State, Next State Table for the counter&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Once the state diagram is created, we can then create a present state, next state table and extract from it the logic equations to implement the counter. Of course, while the example counts in sequential binary, if we desired, we could have the counter count in gray code, etc.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the present state, next state table (PS, NS) created, we can then create the logic equations needed to create in combinatorial logic. If necessary we can use Karnaugh-maps, etc. However, for this simple example we can work directly from the present state, next state table.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;With the PS, NS table, we create a logic equation for each of the next states, e.g. next A. As such the equations are: &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;Next A = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;Next B = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;From these equations we can generate the logic circuit which contains the D Type flip flops and logic gates.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 25px 5px 0px;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 23: Logic Design for a two-bit counter.&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Along with counters, logic designs are often called upon to perform sequence and control-based actions. These actions and sequences are best addressed using a state machine.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.3 State Machines&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;State machines are logical constructs that transition between a finite number of states, like a counter; however, the path through the states is not sequential. A state machine will only be in one state at a point in time. It will transition between states depending upon several triggers, e.g. inputs or counter values, etc.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Theoretically, state machines are divided into two basic classes: Moore and Mealy. They differ only in how the state machine&amp;#39;s outputs are generated.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Moore:&lt;/strong&gt; State Machine outputs are a function of the present state only. A classic example is a counter.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Mealy:&lt;/strong&gt; State Machine outputs are a function of the present state and inputs. A classic example is the &lt;a class="jive-link-external-small" href="http://en.wikipedia.org/wiki/Richards_controller" rel="nofollow ugc noopener noreferrer" target="_blank"&gt;Richards Controller&lt;/a&gt;.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we are faced with the task of defining a state machine, we will develop a state diagram as we would do for a counter. The state diagram shows the states, inputs, and the transitions between the states and the outputs from the state machine. Figure 24 demonstrates the two types of state diagrams: one for a Moore State Machine (left), the other a Mealy State Machine (right).&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:200px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:200px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 24: State Diagrams for a Moore (left) and Mealy (right) State Machine.&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;If we were to implement these in logic gates and flip flops we would generate a present state, next state table, as we did for the previous counter example, and then create the logic equations for each of the state variables. The only difference is that, along with the current state, the present state, next state table will also have to consider the inputs and outputs for the state machine.&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a name="sec10"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;10. Programmable Logic with FPGAs&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;So far, we have looked at how we create logic designs and implement them with discrete logic gates and flip flops. However, the most common way of implementing a logic design is using a programmable logic device (PLD) such as a Complex Programmable Logic Device (CPLD) or a Field Programmable Gate Array (FPGA). These devices enable the implementation of large logic designs and, depending upon the technology of the device used, they can be reprogrammed in the field.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Programmable logic devices are available in three different technologies:&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;SRAM:&lt;/strong&gt; The FPGA program is stored in an external memory and loaded into the FPGA each time it is powered.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;FLASH:&lt;/strong&gt; The FLASH architecture of the FPGA also contains the program; no external memory device is needed.&lt;/p&gt;
&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;One Time Programmable (OTP):&lt;/strong&gt; The FPGA is applied by blowing fuses in the device. Once programmed, it cannot be modified.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Typically, SRAM-based programmable logic is used where high performance is required, while Flash-based devices are used in middle-to-low performance applications. While one time programmable devices are very limited in application, they still remain popular in space applications.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The key to programmable logic is how logic equations are implemented in the device. It is of course very difficult for the device designers to include a range of AND, OR gates, etc. as the number of each gate type will vary with each application. This will result in either many unused gates or a shortage of a needed gate type. Either way it would not be an efficient method for the implementation of a programmable logic device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Device manufacturers addressed this challenge in a very smart manner. In place of discrete gates, they use a several input look up table (LUT) which is programmed to implement the combinatorial logic equations. In many respects, this LUT is very similar to a multiplexer. Let&amp;#39;s take a quick look at how we can use a LUT to implement logic equations.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Using the same truth table as for the previous example, we can set the LUT inputs to either ground or VCC depending upon the truth table&amp;#39;s needs. We can then use the logic equation inputs (A,B,C) to drive the LUT selection inputs to output the correct value for that particular input combination implementing the desired logic equation.&lt;/p&gt;
&lt;center&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:250px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram25_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image"  src="/e14/assets/legacy/2018/diagram25_PrgLogic1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="display:inline-block;padding:12px 10px 5px 0px;vertical-align:top;width:240px;"&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0" width="100%"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;" width="25%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p style="clear:both;font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 25: Setting the LUT&amp;#39;s Inputs to the Truth Table&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Using a LUT inside our programmable device therefore provides the best flexibility to implement a wide range of logic equations.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;Of course, we do not want to just implement the combinatorial logic circuits. We also want to implement sequential structures. This means that following the LUT there needs to be a flip flop to act as storage for the combinatorial output such that we can implement sequential structures.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding-top:12px;"&gt;This combination of a LUT and Flip Flop is often called a Configurable Logic Block (CLB). A programmable logic device will consist of many thousands of CLBs. To provide the most flexibility, additional multiplexers will be used to support a wide range of CLB configurations.&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram26_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram26_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 26: Very Basic Logic Slice&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Obviously, modern devices have very complex CLB structures, which include local memory, fast carry inputs, arithmetic functions, and shift registers.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Of course, these CLB&amp;#39;s need to be interconnected, which is where the device interconnect comes in, which allows the output of one CLB to be connected to the input of another CLB and eventually to the Input/Output of the device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This routing can be considered at two elements. First, there is global routing, which distributes global signals such as clocks. These are global specialist routing networks designed to be low skew and support high fan outs. This dedicated clocking network might be further split between truly global routes across the device and several additional regional limited routes to a specific area of the device. For all other signals, the programmable interconnect is used, which connects the CLBs to each other and other specialist functions within the device. To connect CLBs together it uses a switch matrix, which is configured to provide the internal routing between CLBs.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;One of the key drivers of programmable logic technology development was the reduction in the cost of transistors.&amp;nbsp; However, interconnect wires also played a role in enabling much larger devices at reduced cost.&amp;nbsp; When we develop programmable logic applications we spend a lot of time and effort optimizing the performance of the design with regards to its routing to ensure we can operate at the desired clock frequency.&lt;/p&gt;
&lt;div style="float:left;padding:12px 10px 5px 0px;width:300px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram27_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram27_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 27: CLB and Routing matrix&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;To get signals on and off the chip, programmable logic devices also provide IO cells, which are configurable. These enable the device to support a range of single-ended logic standards, e.g. LVCMOS2v4, LVCOM 1V5, etc., Stub Series Terminated Logic (SSTL) as used for High Speed DDR interfaces, and a range of differential standards, including Low Swing Differential Voltage Signaling (LVDS).&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Many devices also include complex structures in the IO cells to allow for double data rate signals, source synchronous designs, bus skew correction, and conversion to/from serial. Electrically, the IO can control slew rates, drive strengths and even match the impedance with the transmission line, all of which are controlled by the developer. This means that given the right PHY on the board, using programmable logic, we can achieve any-to-any interconnectivity.&lt;/p&gt;
&lt;p style="clear:both;margin:0;"&gt;&lt;a name="sec11"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;color:#007fac;font-size:15px;margin-top:16px;padding:4px 8px;vertical-align:middle;"&gt;
&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;11. Hardware Description Languages&lt;/strong&gt;&lt;/div&gt;
&lt;div style="display:inline-block;font-size:11px;text-align:right;vertical-align:top;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Thanks to the sheer scale of resources offered by programmable logic we cannot any longer design at the gate level like we have done previously. It would simply take too long to develop applications which can leverage the resources provided by the programmable device at the gate level. In the place of developing by using logic equations, we use Hardware Description languages (HDL) such as Verilog or VHDL.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;When we work with these languages, we do not describe the logic equations, but rather the desired behavior at the register transfer level (RTL). This allows us to define the functionality of the programmable logic device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;How our description gets translated from our HDL file into the logic equations and implemented in the programmable logic device requires several stages.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#007fac;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Synthesis&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;The conversion of the HDL file into logic equations often targeted at the specific resources of the programmable logic device.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#f17c0e;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Placing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;Placing of the identified logic cells (LUT, Flip Flops, etc.) into the programmable logic CLBs.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" cellpadding="0" cellspacing="0"&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="background-color:#003082;border:1px solid #b8d7e5;color:#ffffff;padding:6px;"&gt;&lt;strong&gt;Routing&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;Connecting together the placed CLBs to achieve the required performance.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 28: Stages to Convert HDL File into Logic Equations&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Each stage often requires addition constraints to ensure the desired timing is achieved or the correct IO standards are used.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;What developers who are used to using VHDL and Verilog will be familiar with is that not all constructs / commands within a language can be synthesized. Therefore, there is only a subset of language commands and coding structures which can be synthesized into a programmable logic device successfully. The remaining elements of the HDL language which are not synthesizable are used in the verification of the design before we implement it in the device.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;This verification is called the development of a test bench which ensures the Unit Under Test (UUT) meets its specification and is suitable for its intended purpose. When it comes to test benching, we have a couple of choices as to how we perform it.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Functional Simulation only:&lt;/strong&gt; This checks if the design is functionally correct.&amp;nbsp; It does not include internal device timing delays such as propagation delays, which may affect performance when implemented in the device.&lt;/p&gt;
&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" style="vertical-align:middle;"  src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" /&gt;&lt;/a&gt; &lt;strong&gt;Gate Level Simulation:&lt;/strong&gt; This verifies the functionality of the design when back annotated with timing information from the final implemented design. This can take considerable time to perform.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram29_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox"  src="/e14/assets/legacy/2018/diagram29_PrgLogic1.png" /&gt;&lt;/a&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 29: Example Test Bench architecture&lt;/em&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Let&amp;#39;s look at how we would implement a state machine using the VHDL Language. Learning VHDL itself is a short course; however, we can briefly introduce the basics here.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;A VHDL file is split into two distinct elements, the entity and the architecture. The entity defines the input and outputs of the VHDL module and if it is at the top level of the design. It represents the inputs and outputs of the programmable logic device itself.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;The architecture defines the functionality and consists of either sequential statements, which are all executed in parallel or processes.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;Processes execute sequentially from top to bottom, more like in a traditional programming application. However, there are rules around when signals update during the process. Additionally, each process in the architecture runs in parallel as you are describing logic functions.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;table width="100%"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="padding-right:15px;"&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state only&lt;/span&gt; &lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state and inputs&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;
&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;
&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style="font-size:11px;line-height:12px;margin:0;padding-top:3px;"&gt;&lt;em&gt;Figure 30: VHDL Architecture which shows the implementation of the state machines in the above example&lt;/em&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In the above example, the process runs each time the clock or reset is changed. This is defined in the sensitivity list of the process declaration.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;In these examples, the reset is asynchronous and used to reset the current state and the output, while the next actions only occur following the rising edge of the clock. Where the state machine progresses through each state depends upon its inputs and current state, moving if necessary to the next state.&lt;/p&gt;
&lt;p style="margin:0;padding-top:12px;"&gt;What this demonstrates is that, using programmable logic and HDL, we can directly code the state machine or counter from the state diagram and without the need to create the logic equations. Indeed, we let the synthesis tool do that for us.&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="clear:both;font-size:11px;margin:0;padding-top:12px;"&gt;*Trademark. &lt;strong&gt;Xilinx is a trademark of Xilinx Inc.&lt;/strong&gt; Other logos, product and/or company names may be trademarks of their respective owners.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="background-color:#e9f6fc;border:1px solid #a9aaaa;padding:12px 12px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/PrgmLogic_profile.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox essProfile" style="float:left;padding-right:10px;vertical-align:middle;"  height="115" src="/e14/assets/legacy/2018/PrgmLogic_profile.png" /&gt;&lt;/a&gt;
&lt;div&gt;
&lt;p style="color:#007fac;font-size:15px;margin:0;padding-bottom:10px;"&gt;Shop our wide range of &lt;strong&gt;FPGAs, SoCs, EVMs, application specific kits, embedded development boards, and more.&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-AU_CN_HK_IN_KR_MY_NZ_PH_SG_TH_TW_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://sg.element14.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-AT_BE_BG_CZ_DK_EE_FI_FR_DE_HU_IE_IL_IT_LV_LT_NL_NO_PL_PT_RO_RU_SK_SI_ES_SE_CH_TR_UK_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://uk.farnell.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-US_BR_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://www.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-CA_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://canada.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-MX_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" title="Shop Now" href="http://mexico.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" rel="noopener noreferrer" target="_blank"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="clear:both;margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p style="margin:0;padding-top:20px;"&gt;&lt;a name="test"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="color:#007fac;font-size:18px;margin:0;padding-bottom:8px;"&gt;&lt;strong&gt;Test Your Knowledge&lt;/strong&gt;&lt;span style="float:right;font-size:11px;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;a href="/e14/assets/legacy/2018/100x100_PrgmDevice1Bdg.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox" style="float:left;padding:0px 10px 5px 0px;vertical-align:top;"  height="80" src="/e14/assets/legacy/2018/100x100_PrgmDevice1Bdg.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin:0;padding-bottom:8px;"&gt;Are you ready to demonstrate your Essentials of Programmable Logic knowledge? &lt;strong&gt;Then take a quick 15-question, multiple-choice quiz to see how much you&amp;#39;ve learned from this Programmable Devices module.&lt;/strong&gt;&lt;/p&gt;
&lt;p style="margin:0;"&gt;&lt;strong&gt;To earn the Programmable Devices I Badge&lt;/strong&gt;, read through the module to learn all about Programmable Logic, attain 100% in the quiz at the bottom, leave us some feedback in the comments section, and give the module a star rating.&lt;/p&gt;
&lt;p style="margin:0;padding:0px;"&gt;&lt;div class="voltquiz" data-formid="0fcd3450-c4f3-4322-8af1-4b03e66c0ed0" data-formtype="quiz" data-success-message="" data-fail-message="" data-pass-mark="OTk=" &gt;&lt;/div&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="e14-quiz-document-metadata e14-init-hidden"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class="migration-injected-attachments"&gt;
&lt;div style="font-weight:bold;margin:15px 0 5px 0;"&gt;Attachments:&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;table style="border:0;"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width="160"&gt;&lt;span id="attid_https://www.element14.com/community/api/core/v3/attachments/265862" class="_se_attachment"&gt;&lt;a href="https://community.element14.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-02-50/Programmable-Devices-I-_2D00_-Programmable-Logic.pdf"&gt;community.element14.com/.../Programmable-Devices-I-_2D00_-Programmable-Logic.pdf&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;
&lt;td&gt;&lt;span style="font-size:80%;"&gt;Programmable Devices I - Programmable Logic.pdf&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;script&gt;window.top.e14.func.queueScripts.add(function() { window.top.e14.func.e14ConditionalContent();} );&lt;/script&gt;

&lt;div style="font-size: 90%;"&gt;Tags: fpga_essentials, programmable_devices, xilinx_essentials, xilinx, fpga, programmable_device, programmable_logic, ess_module&lt;/div&gt;
</description></item><item><title>Programmable Devices I: Programmable Logic</title><link>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic/revision/1</link><pubDate>Tue, 26 Jan 2021 22:39:37 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:722dc523-e66e-42a7-84b5-de3f2731c4d8</guid><dc:creator>pchan</dc:creator><comments>https://community.element14.com/learn/learning-center/essentials/w/documents/3802/programmable-devices-programmable-logic#comments</comments><description>Revision 1 posted to Documents by pchan on 1/26/2021 10:39:37 PM&lt;br /&gt;
&lt;span&gt;&lt;div class="e14-navigation-buttons"&gt;&lt;a href="/community/learning-center/online-learning/essentials?ICID=essentials-prgmdevice1-doc"&gt;
                    &lt;button class="e14-nav-button-prev"&gt;Previous&lt;/button&gt;
                &lt;/a&gt;&lt;a href="/learn/learning-center/online-learning/essentials/w/documents/4109/programmable-devices-ii-programmable-socs?ICID=essentials-prgmdevice1-doc"&gt;
                    &lt;button class="e14-nav-button-next"&gt;Next&lt;/button&gt;
                &lt;/a&gt;&lt;/div&gt;&lt;script&gt;e14.func.queueScripts.add(function(){ e14.func.repositionNavButtons(); })&lt;/script&gt;&lt;/span&gt;&lt;div style="padding:6px 8px;border:1px solid #c6c6c6;background-color:#f9f9f9;display:block;width:212px;float:right;"&gt;&lt;a class="jivecontainerTT-hover-container jive-link-community-small" href="/learn/learning-center/"&gt;element14 Learning Center&lt;/a&gt;&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="padding:8px;clear:both;border:1px solid #c6c6c6;"&gt;&lt;div style="display:inline-block;vertical-align:top;padding-right:16px;"&gt;&lt;a href="/learn/learning-center/online-learning/essentials/"&gt;&lt;img alt="image" src="/e14/assets/legacy/2017/learningess.png" width="175px"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;"&gt;&lt;p class="essTitle" style="margin:0;font-weight:bold;font-size:18px;" title="Programmable Logic"&gt;&lt;span style="color:#007fac;"&gt;Programmable Devices I: &lt;/span&gt; Programmable Logic&lt;/p&gt;&lt;p style="margin:0;padding:8px;"&gt;&lt;span style="font-size:11px;padding-right:10px;"&gt;&lt;em&gt;Sponsored by&lt;/em&gt;&lt;/span&gt;&lt;a href="http://www.xilinx.com/" rel="nofollow ugc noopener" target="_blank"&gt;&lt;img loading="lazy" alt="image" class="essSponsor" height="25px" src="/e14/assets/legacy/2018/xilinxlogoSM.png" style="vertical-align:top;" title="Xilinx"  /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;hr /&gt;&lt;div style="clear:both;line-height:1.5;"&gt;&lt;span style="padding-right:6px;"&gt;&lt;a class="jive-link-anchor-small" href="#intro"&gt;1. Introduction&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#object"&gt;2. Objectives&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec3"&gt;3. Boolean Algebra&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec4"&gt;4. Logic Gates&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec5"&gt;5. Transistor Implementation of a Gate&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec6"&gt;6. Propagation Delay&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec7"&gt;7. Combinatorial Circuit Example&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec8"&gt;8. Arithmetic in Logic&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec9"&gt;9. Sequential Circuits&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec10"&gt;10. Programmable Logic with FPGAs&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-anchor-small" href="#sec11"&gt;11. Hardware Description Languages&lt;/a&gt;&lt;/span&gt; | &lt;span style="padding:0px 6px;"&gt;&lt;a class="jive-link-wiki-small" href="/learn/learning-center/online-learning/essentials/w/documents/3803/related-components-dev-boards-for-element14-essentials-programmable-devices-i"&gt;Related Components &amp;amp; Dev Boards&lt;/a&gt;&lt;/span&gt; | &lt;span style="font-weight:bold;padding:0px 6px;"&gt;&lt;a href="#test"&gt;Test Your Knowledge &lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/LinkArrow.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="float:right;width:155px;border:1px solid #b8d7e5;padding:12px;margin:20px 0px 5px 5px;background-color:#e4f2f8;"&gt;&lt;p style="margin:0;color:#007fac;font-weight:bold;"&gt;Also Available:&lt;/p&gt;&lt;p style="margin:0;padding-top:5px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; &lt;a class="jive-link-wiki-small" href="/learn/learning-center/online-learning/essentials/w/documents/4109/programmable-devices-ii-programmable-socs"&gt;Programmable Devices II: Programmable SoCs&lt;/a&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:5px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; &lt;a class="jive-link-wiki-small" href="/learn/learning-center/online-learning/essentials/w/documents/4501/programmable-devices-iii-fpga-programmable-soc-programming-languages"&gt;Programmable Device III: FPGA / Programmable SoC Programming Languages&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;p style="margin:0;color:#007fac;font-size:15px;padding:8px 0px;"&gt;&lt;a name="intro"&gt;&lt;/a&gt;&lt;strong&gt;1. Introduction&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;The world and our interaction with it is analog. Our surrounding environment, colors in the electromagnetic spectrum, speech, and sound all are represented by continuously changing analog values. When it comes to processing these analog signals, however, digital systems offer several benefits to a traditional analog processing solution. For example, they have higher performance, ease of storage and transmission, and better noise immunity. As such, while the world is analog, it is mainly processed digitally using logic circuits. In this learning module, you will be introduced to the essentials of logic design, and how it can be implemented using programmable logic.&lt;/p&gt;&lt;p style="margin:0;clear:both;"&gt;&lt;a name="object"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="margin:0;color:#007fac;font-size:15px;padding:4px 8px;margin-top:16px;background-color:#e9f6fc;vertical-align:middle;"&gt;&lt;strong&gt;2. Objectives&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding:12px 0px 8px 35px;"&gt;&lt;em&gt;Upon completion of this module, you will be able to:&lt;/em&gt;&lt;/p&gt;&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; Perform some fundamental operations of Boolean algebra&lt;/p&gt;&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; Explain the operation and truth tables of common logic gates&lt;/p&gt;&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; Illustrate how combinatorial circuits are designed&lt;/p&gt;&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; Discuss the differences between combinatorial and sequential circuits&lt;/p&gt;&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; Understand how shift registers, counters, and state machines operate&lt;/p&gt;&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; Explain the basic structures of PLDs&lt;/p&gt;&lt;p style="margin:0;padding:4px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; Describe the role of HDLs&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;a name="sec3"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="color:#007fac;font-size:15px;padding:4px 8px;margin-top:16px;background-color:#e9f6fc;vertical-align:middle;"&gt;&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;3. Boolean Algebra&lt;/strong&gt;&lt;/div&gt;&lt;div style="display:inline-block;vertical-align:top;text-align:right;font-size:11px;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The key foundation of digital logic is Boolean Algebra. Without understanding it we cannot produce effective logic designs or understand the outputs of higher level tools such as synthesis engines.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Boolean algebra is named after its inventor, George Boole, who in 1854 published his work entitled, &amp;quot;An investigation of the laws of thought on which are founded the mathematical theories of logic and probabilities.&amp;quot; This work was later used by Claude Shannon in his 1937 master&amp;#39;s thesis at MIT entitled, &amp;quot;A Symbolic Analysis of Relay and Switching Circuits,&amp;quot; which demonstrated that switching circuits could solve all problems in the same manner as Boolean algebra. Thus, the relationship between switching circuits and Boolean algebra became the foundation of all digital applications.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.1 Boolean Addition and Multiplication&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1+0=1&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0+1=1&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1+1=1&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;As you can see, the result of the SUM is equal to one only when one or more of the literals is one.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Boolean multiplication produces the PRODUCT of the literals:&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;&lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;1.0=0&lt;/strong&gt;&lt;/span&gt; &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;0.1=0&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;1.1=1&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;In this case, you can see the PRODUCT is equal to one only when both literals are equal to one.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Understanding the meaning of the SUM and PRODUCT terms will be important later when we examine logic gates and equations.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.2 Boolean Algebra Laws&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Just as in other areas of mathematics, Boolean algebra has several laws which we must understand, such as:&lt;/p&gt;&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; &lt;strong&gt;Commutative Law:&lt;/strong&gt; The order of literals in Boolean addition does not affect the result: A+B=B+A&lt;/p&gt;&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; &lt;strong&gt;Associative Law:&lt;/strong&gt; When performing Boolean addition of more than two literals, the result is the same regardless of grouping:&amp;nbsp; A+(B+C)=(A+B)+C&lt;/p&gt;&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; &lt;strong&gt;Distributive Law:&lt;/strong&gt; Performing a Boolean addition of two or more literals before performing a Boolean multiplication on the result is the same as performing the Boolean multiplication with each literal before performing the Boolean Addition A(B+C)=AB+AC&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;These laws become very important when we design logic circuits and wish to optimize the number of logic gates we use in our solution.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Along with these laws we also have twelve rules of Boolean Logic with which we must become familiar. They are:&lt;/p&gt;&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;center&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th colspan="2" style="border:1px solid #b8d7e5;color:white;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;12 Boolean Logic Rules&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + 0 = A&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . A = A&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + 1 = 1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . 0 = 0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;a href="/e14/assets/legacy/2018/A2bars.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/A2bars.png"  /&gt;&lt;/a&gt; = A&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A . 1 = A&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + A.B = A&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + A = A&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B = A + B&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;A + &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; = 1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;(A + B).(A+C) = A + B.C&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/center&gt;&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 3.3 DeMorgan&amp;#39;s Theorem&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The final remaining element we need to understand about Boolean Algebra is DeMorgan&amp;#39;s Theorem which states, &amp;quot;The complement of a product of sums is equal to the sum of the complements.&amp;quot;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;This is better shown represented as an equation: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;A good mnemonic device to remember this is: &amp;quot;break the bar, change the sign.&amp;quot;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Of course, now that we understand Boolean algebra, we want to be able to see how it maps to the logic gates we use to implement digital circuits.&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;a name="sec4"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="color:#007fac;font-size:15px;padding:4px 8px;margin-top:16px;background-color:#e9f6fc;vertical-align:middle;"&gt;&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;4. Logic Gates&lt;/strong&gt;&lt;/div&gt;&lt;div style="display:inline-block;vertical-align:top;text-align:right;font-size:11px;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The seven commonly used logic gates in digital design are NOT, AND, OR, XOR, NOR, NAND and XNOR gates. In our designs we use combinations of these logic gates to implement the logic function. In this section, we&amp;#39;ll review these logic gates.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;At the lowest level these logic gates are made from arrangements of transistors; however, each arrangement has its own symbol and truth table, which shows for a given input what its outputs will be. (Note: For simplicity&amp;#39;s sake, except for the NOT gate, all gates are demonstrated with two inputs).&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.1 NOT Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of the logic gates is the NOT gate. This gate simply inverts the logic value presented on the input.&lt;/p&gt;&lt;center&gt;&lt;div style="display:inline-block;width:250px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram1_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;padding:12px 10px 5px 0px;width:150px;vertical-align:top;"&gt;&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NOT symbol &amp;amp; truth table&lt;/strong&gt;&lt;/p&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 1: NOT Gate&lt;/em&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.2 AND Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;One of the most commonly used logic gates is the AND gate, which implements Boolean algebra multiplication and produces the PRODUCT of its inputs as we described earlier in this learning module.&lt;/p&gt;&lt;center&gt;&lt;div style="display:inline-block;width:250px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram2_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram2_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;width:200px;padding:12px 10px 5px 0px;vertical-align:top;"&gt;&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;AND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 2: AND Gate&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.3 OR Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;To implement Boolean addition and generate the SUM of its inputs, we use the OR Gate which uses the symbol as shown in Figure 3.&lt;/p&gt;&lt;center&gt;&lt;div style="display:inline-block;width:250px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram3_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram3_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;width:200px;padding:12px 10px 5px 0px;vertical-align:top;"&gt;&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;OR Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 3: OR Gate&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The remaining logic gates are derivatives of the AND, OR, and NOT functions. However, the NAND and NOR gates have proven to be very popular due to their universality, which allows any logic gate—AND, OR, NOT—to be implemented using these two gates. We will look at exactly how we can do this in an example further on in this learning module.&lt;/p&gt;&lt;p style="margin:0;padding:0px;clear:both;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.4 NAND Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of the gates is the NAND gate, which stands for Not AND. This can be represented by an AND gate followed by a NOT gate. However, it is normally shown as an AND gate with an inversion bubble on its output.&lt;/p&gt;&lt;center&gt;&lt;div style="display:inline-block;width:250px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram4_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram4_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;width:200px;padding:12px 10px 5px 0px;vertical-align:top;"&gt;&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NAND Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 4: NAND Gate&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.5 NOR Gate&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;A similar logic gate is the NOR gate, which is also a universal gate and represents the NOT OR function. We represent the NOR symbol as the OR gate with an inversion bubble.&lt;/p&gt;&lt;center&gt;&lt;div style="display:inline-block;width:250px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram5_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram5_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;width:200px;padding:12px 10px 5px 0px;vertical-align:top;"&gt;&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;NOR Symbol and Truth Table&lt;/strong&gt;&lt;/p&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 5: NOR Gate&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 4.6 XOR and XNOR Gates&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The final two gates are the XOR and XNOR gates, which are constructed from logic gates already introduced. However, they provide very useful functions allowing us to determine if both inputs agree (XNOR) or both inputs differ (XOR).&lt;/p&gt;&lt;center&gt;&lt;div style="display:inline-block;width:250px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram6a_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;width:200px;padding:12px 10px 5px 0px;vertical-align:top;"&gt;&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;XOR Symbol &amp;amp; Truth Table&lt;/strong&gt;&lt;/p&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 6a: XOR Gate&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;center&gt;&lt;div style="display:inline-block;width:250px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram6b_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;width:200px;padding:12px 10px 5px 0px;vertical-align:top;"&gt;&lt;p style="margin:0;padding-bottom:6px;"&gt;&lt;strong&gt;XNOR Symbol &amp;amp; Truth Table &lt;/strong&gt;&lt;/p&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 6b: XNOR Gate&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;a name="sec5"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="color:#007fac;font-size:15px;padding:4px 8px;margin-top:16px;background-color:#e9f6fc;vertical-align:middle;"&gt;&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;5. Transistor Implementation of a Gate&lt;/strong&gt;&lt;/div&gt;&lt;div style="display:inline-block;vertical-align:top;text-align:right;font-size:11px;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;As mentioned earlier in this learning module, each of the logic gates consists of several transistors arranged to implement the desired logic gate.&lt;/p&gt;&lt;div style="float:left;width:280px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram7_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox" src="/e14/assets/legacy/2018/diagram7_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;p style="margin:0;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 7: Transistor Level implementation of a NOT Gate&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The simplest of these is the NOT gate, which uses two complementary transistors to invert the input at its output. When the Input is high, transistor Q1 is turned off thanks to the inversion, while transistor Q2 is turned on pulling the output to ground, which is the opposite of the presented signal. Conversely, when the input is low, transistor Q2 is this time turned off, while Q1 is turned on, pulling the output to the power rail and outputting a logic high.&lt;/p&gt;&lt;p style="margin:0;padding:0px;clear:both;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="float:left;width:280px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram8_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox" src="/e14/assets/legacy/2018/diagram8_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;p style="margin:0;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 8: Transistor level implementation of a AND Gate&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;This NOT structure is also used in more complex gates such as the AND gate. Looking at the transistor level of the AND gate you will first notice the Output stage Q5 and Q6 is the same as for the NOT gate function.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;When inputs A and B are both high, transistors Q1 and Q2 are turned on while Q3 and Q4 are turned off. This pulls the input to Q6 and Q5 low, which due to the inversion means Q5 turns on and Q6 turns off allowing the output to be set high. For all other combinations at least one of Q1, Q2, Q3 and Q4 is turned off ,which pulls the input to Q5 and Q6 high, as such turning on Q6 and off Q5 pulling the output low as would be expected for an AND logic gate.&lt;/p&gt;&lt;p style="margin:0;clear:both;"&gt;&lt;a name="sec6"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="color:#007fac;font-size:15px;padding:4px 8px;margin-top:16px;background-color:#e9f6fc;vertical-align:middle;"&gt;&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;6. Propagation Delay&lt;/strong&gt;&lt;/div&gt;&lt;div style="display:inline-block;vertical-align:top;text-align:right;font-size:11px;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;When we implement logic circuits, using logic gates, we call these combinatorial logic circuits as there is no storage or feedback. To ensure these circuits function as intended we also, need to understand what occurs when an input changes. As just demonstrated, logic gates are made up from arrangements of switching transistors, and as such it takes time for a change at an input to result in a change of the output.&amp;nbsp; We call this delay the PROPAGATION time and it will vary depending upon the logic family used.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;To ensure we are all on the same page, there are several different logic families, each implemented in different underlying technologies such as CMOS (Complementary Metal Oxide Semi-conductor) or TTL (Transistor to Transistor Logic). Each logic family will exhibit a different propagation delay, which will limit the switching frequency of the logic design. If we are testing in the lab, we measure the propagation delay between the mid-point (50%) of the rising and falling edges as shown below.&lt;/p&gt;&lt;center&gt;&lt;div style="display:inline-block;width:250px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram1_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram1_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;width:255px;padding:12px 10px 5px 0px;vertical-align:top;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram9__PrgLogic1.png?v=4"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 9: Timing Diagram of NOT gate&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The propagation time is normally defined within the data sheet for the logic gate selected; however, it will often list two propagation times: one for the high to low transition and another for the low to high transition.&amp;nbsp; Of course, the propagation time will also be affected by the ambient temperature, changes in power supply conditions, resistance of the driver, and the capacitive load on the device output.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;We call the output driving several devices inputs the FANOUT. The higher the fanout, the larger the loading, and, therefore, the slower the output rise and fall times. Typical values of propagation time in logic datasheets range from 5 ns to 35 ns, depending upon the logic family, minimum/maximum behavior, and loading conditions (FANOUT).&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;When we develop our combinatorial circuit, which will typically consist of several levels of logic gates, due to the layer on gates, we need to be careful of the differing propagation delays, as differing propagation delays can lead to glitches in the output value which are not correct. This is one of the reasons that in many applications, combinatorial circuits are used with storage elements like D type flip flops and an associated clock to ensure the output does not glitch and is stable when it is presented to the next processing/decision element.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;However, if we are working purely with combinatorial circuits, we can also take some steps to mitigate these glitches, which are often referred to as RACE Hazards.&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;a name="sec7"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="color:#007fac;font-size:15px;padding:4px 8px;margin-top:16px;background-color:#e9f6fc;vertical-align:middle;"&gt;&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;7. Combinatorial Circuit Example&lt;/strong&gt;&lt;/div&gt;&lt;div style="display:inline-block;vertical-align:top;text-align:right;font-size:11px;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The best way to demonstrate how we can pull together what we have learned so far about Boolean Algebra, Logic Gates, Propagation Delays, and Hazards is to outline a few simple examples.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;For the first example, we will create a system which monitors three motors. Each motor has a health indication output which is high when the motor has a fault. For the overall system to function correctly, at least two of the motors must be working correctly, therefore, we will create a system that outputs a logic high when two out of the three motors have asserted their fault outputs.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The first stage in developing this solution is to create a truth table that shows the possible input combinations and the correct output for each of those input conditions. As we have 3 inputs, then there are 2&lt;sup&gt;3&lt;/sup&gt; or eight possible combinations of the input:&lt;/p&gt;&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="float:left;width:230px;padding:0px 15px 5px 0px;vertical-align:top;"&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;" width="30%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin:0;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 10: Truth Table for the motor monitoring system&amp;#39;s logic function&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;From this truth table we can generate the following logic equations: &lt;strong&gt;OP = (A.B) + (A.C) + (B.C)&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;We call the format of this equation a SUM of PRODUCTS (SOP) equation as the OP is the Boolean SUM (Logical OR) of the Boolean PRODUCTS (AND) equations.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;If we so desired, we could calculate a PRODUCT of SUMS (POS) output by following the approach.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Firstly, we create the SOP logic equation for each entry on the truth table where the output is low: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;OP&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;A.C&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B.C&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="padding-top:12px;"&gt;Next, we apply DeMorgan&amp;#39;s theorem to convert from the SOP to the POS format. The first step is to invert the SOP equation: &lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/PrgmLogicEQ1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;We can then apply DeMorgan&amp;#39;s theorem and the ninth law of logic to create the final POS equation: &lt;strong&gt;OP=(A+B).(A+C).(B+C)&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;clear:both;padding-top:12px;"&gt;For the remainder of this example, however, we will work with the SOP format as that is the most common method for implementing logic functions. As such, we can realize our SOP equation using a two-level logic circuit as below:&lt;/p&gt;&lt;p style="margin:0;padding:0px;padding-top:8px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram11_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox" src="/e14/assets/legacy/2018/diagram11_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;p style="margin:0;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 11: Example Logic Circuit in SOP form&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding-top:12px;"&gt;With this two-level network, we need to consider the propagation delay through the first AND gate level and the impact it might have on the output.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Of course, this implementation uses two logic gate types (AND, OR). But it is possible to implement the same logical function using only NAND gates, as they are universal.&amp;nbsp; Thanks to DeMorgan&amp;#39;s Theorem, the NAND gate also implements the Negative OR function: &lt;strong&gt;&lt;span style="text-decoration:overline;"&gt;A.B&lt;/span&gt; = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt; + &lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;padding-top:8px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram12_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox" src="/e14/assets/legacy/2018/diagram12_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;p style="margin:0;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 12: Example Logic Circuit in SOP form implemented using NAND Gates&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding-top:12px;"&gt;As such, we can redraw the logic circuit above.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;clear:both;"&gt;Let&amp;#39;s look at how we get the same functionality using NAND gates. The output equation can be represented as: &lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ2.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/PrgmLogicEQ2.png" style="vertical-align:middle;"  /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Using DeMorgan&amp;#39;s Theorem, we can iterate through the following steps, changing the sign as we break the bar and applying other rules of Boolean algebra:&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/PrgmLogicEQ3.png?v=2"  /&gt;&lt;/a&gt;&lt;/center&gt;&lt;p style="margin:0;padding-top:12px;"&gt;If we are working with POS logic equations, we can use NOR gates to implement the logic equation and prove the functionality the same way using DeMorgan&amp;#39;s Theorem and Boolean Algebra rules.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;In the example above, we used a truth table to determine the logic equations and it works well for a simple application. However, if we have more complex applications we need a better way of determining the logic equations. This is where the Karnaugh-map (Kmap) comes into play. Kmaps are visual representations of the logic behavior which allow us to use our natural ability for pattern recognition to determine the logic equations.&lt;/p&gt;&lt;div style="float:left;width:170px;padding:12px 10px 5px 0px;"&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/ABBCimg.png"  /&gt;&lt;/a&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin:0;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 13: Example Karnaugh-map used for four variables (A,B,C,D). Note the gray scale count.&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Karnaugh-maps are used by grouping together adjacent 1&amp;#39;s for SOP and adjacent 0&amp;#39;s for POS. These groupings can then be used to determine the logic equation, using the rules of Boolean Algebra to implement the desired functionality.&lt;/p&gt;&lt;p style="margin:0;padding:0px;clear:both;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="float:left;width:170px;padding:12px 10px 5px 0px;"&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/ABBCimg.png"  /&gt;&lt;/a&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;background-color:#d0df89;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;background-color:#d0df89;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;background-color:#d0df89;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;background-color:#d0df89;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;background-color:#bad7fe;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;background-color:#bad7fe;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin:0;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 14: Example of a Karnaugh-map: Grouping the 1s together.&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Often, if we use a Karnaugh-map, we will obtain an equation which uses the minimum number of logic gates to implement. Using the example to the left we can group together the 1&amp;#39;s within the design where they are adjacent to each other.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The example groups together four 1&amp;#39;s within the center of the Karnaugh-map (highlighted green), and from this we can see that the logic equation is D.B as the C and A cancel each other out due to being across not C and C or not A and A, respectively.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The blue elements in the corner can also be grouped together as they are also judged to be adjacent, since the Karnaugh-map is judged to wrap around edge to edge and top to bottom. As such, the second equation to be extracted from the Karnaugh-map is C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;; therefore, the resulting logic equation for the Karnaugh-map is: &lt;strong&gt;OP = C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + D.B&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;We can also use Karnaugh-maps to identify hazards which might result in glitches during operation and help us eliminate them. In the next example, we can extract the logical equation for the green and blue cells as: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;float:left;width:170px;padding:12px 10px 5px 0px;"&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;" width="25%"&gt;&lt;a href="/e14/assets/legacy/2018/ABBCimg.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/ABBCimg.png"  /&gt;&lt;/a&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;00&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;01&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;11&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;00&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;01&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;11&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;border-right:2px solid #D23620;border-left:2px solid #D23620;border-top:2px solid #D23620;background-color:#d0df89;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;background-color:#d0df89;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;10&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;background-color:#bad7fe;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;border-right:2px solid #D23620;border-left:2px solid #D23620;border-bottom:2px solid #D23620;background-color:#bad7fe;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin:0;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 15: Karnaugh-maps: Identifying Potential Hazards&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;However, this leaves the equation highlighted by the red circle as a potential hazard, which occurs when the input D changes from a 1 to a 0. The output is intended to stay high; however, there is not a specific term in the logic equation to address it. To remove the hazard, we should update the logic equation. See in the additional equation where the red text is: &lt;strong&gt;OP = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.C.&lt;span style="text-decoration:overline;"&gt;D&lt;/span&gt; + B.C.D + &lt;span style="color:#d23620;"&gt;&lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B.C.&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;By this point now you should be familiar with Boolean Algebra, logic gates, how they relate to each other, and how they are used with truth tables and Karnaugh-maps to not only determine logic equations but also to identify race conditions. You should also understand how we can use universal gates for implementing logic equations.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;With the basics of Boolean Algebra and logic gates introduced, we can focus now on how to create logical structures which can be used in applications. As such, we are going to explore Half and Full Adders along with the basics of synchronous logic design, using flip flops and their application, to help us create counters, shift registers, and state machines.&lt;/p&gt;&lt;p style="margin:0;clear:both;"&gt;&lt;a name="sec8"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="color:#007fac;font-size:15px;padding:4px 8px;margin-top:16px;background-color:#e9f6fc;vertical-align:middle;"&gt;&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;8. Arithmetic in Logic&lt;/strong&gt;&lt;/div&gt;&lt;div style="display:inline-block;vertical-align:top;text-align:right;font-size:11px;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;There are times in logic design when we want to perform mathematical operations such as Addition, Subtraction, Multiplication, and Division. While how we do this and number systems we use can be a course on its own, the Half and Full Adder are the key logic circuits we use to achieve these and should be introduced here.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.1 Half Adder&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The Half Adder is so called as it adds two input variables, generating a sum and carry outputs; it has no ability to accept a carry-in from a previous adder.&lt;/p&gt;&lt;center&gt;&lt;div style="display:inline-block;width:250px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram16_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram16_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;width:250px;padding:12px 10px 5px 0px;vertical-align:top;"&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" width="100%"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Carry&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 16: Half Adder logic diagram and truth table&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.2 Full Adder&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The Full Adder provides the ability to accept a carry-in and is therefore used more commonly when working with multi-bit buses in logic.&lt;/p&gt;&lt;center&gt;&lt;div style="display:inline-block;width:380px;padding:12px 20px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram17_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram17_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;width:320px;padding:12px 10px 5px 0px;vertical-align:top;"&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" width="100%"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Carry In&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Sum&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Carry Out&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 17: Full Adder logic diagram and truth table&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Of course, like any logic circuits, there are variations optimized for different applications, including Ripple Carry Adder, Carry Look Ahead, and Carry Save Adders.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;We can also use the same adders for subtraction, if we use the twos complement number system to represent signed numbers.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;clear:both;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 8.3 Signed and Unsigned Number Systems&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;For those not familiar with signed and unsigned binary numbers, we&amp;#39;ll very briefly discuss them now. Simply stated, there are several number systems which allow us to represent both signed and unsigned number systems.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Unsigned numbers are the simplest and we can represent a range of 0 to 2&lt;sup&gt;n&lt;/sup&gt;–1, where n is the width of the bus. Unsigned numbers always represent positive numbers.&amp;nbsp; To represent signed numbers, we have a choice of several number systems, the most common being the Sign and Magnitude, Ones Complement, or Twos Complement.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Sign and Magnitude utilizes the left most bit (often called the most significant bit) to represent the sign of the number (0 = positive, 1 = negative), and the remainder of the bits represent the magnitude.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;In the Sign and Magnitude system, both positive and negative numbers have the same magnitude; however, the sign bit differs. Due to this it is possible to have both a positive and negative zero within the Sign and Magnitude system.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Ones Complement uses the same unsigned representation for positive numbers as the Sign and Magnitude representation. However, for negative numbers, the inversion (ones complement) of the positive number is used.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Twos Complement is the most widely used encoding scheme for representing signed numbers. Just like Sign and Magnitude and Ones Complement schemes, positive numbers are represented in the same manner as an unsigned number. While negative numbers are represented as the binary number, you add to a positive number of the same magnitude to get zero. A negative twos complement number is calculated by first taking the ones complement (inversion) of the positive number and then adding one to it. The twos complement number system allows subtraction of one number from another by performing an addition of the two numbers. The range a twos complement number can represent is given by: &lt;strong&gt;-(2&lt;sup&gt;n-1&lt;/sup&gt;) to + (2&lt;sup&gt;n-1&lt;/sup&gt;–1)&lt;/strong&gt;.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;One method we can use to convert a number to its twos complement format is to work right to left, leaving the number the same until the first one is encountered; after this each bit is inverted.&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;a name="sec9"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="color:#007fac;font-size:15px;padding:4px 8px;margin-top:16px;background-color:#e9f6fc;vertical-align:middle;"&gt;&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;9. Sequential Circuits&lt;/strong&gt;&lt;/div&gt;&lt;div style="display:inline-block;vertical-align:top;text-align:right;font-size:11px;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Combinatorial logic circuits are unable to implement functions that require knowledge of their previous inputs or decisions as they contain no memory/storage elements.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;In contrast, sequential circuits&amp;#39; outputs are based upon not only current inputs but also previous inputs and decisions. Sequential logic circuits achieve this by using storage elements called flip flops, the simplest of which is the D Type flip flop. The value stored in the flip flop is updated at a regular interval as indicated by the clock signal.&lt;/p&gt;&lt;div style="float:left;"&gt;&lt;div style="display:inline-block;width:180px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram18_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram18_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;width:160px;padding:12px 10px 5px 0px;vertical-align:top;"&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th colspan="2" style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Inputs&lt;/strong&gt;&lt;/th&gt;&lt;th colspan="2" style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Outputs&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;CK&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;D&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;Q&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;span style="text-decoration:overline;"&gt;Q&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;X&lt;/td&gt;&lt;td colspan="2" style="border:1px solid #b8d7e5;padding:6px;"&gt;No Change&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 18: D Flip-flop and truth table&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;This ability to store states within our logic design allows more complex logic structures to be implemented. It also aids timing as the output of the combinatorial logic circuit must be stable just before the clock is applied to the Flip Flop to store the next value, thereby eliminating glitches. But as we will see this introduces more issues as well, especially when there are multiple layers of logic between flip flops.&lt;/p&gt;&lt;p style="margin:0;clear:both;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.1 Half Adder in a Synchronous Design&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;In this example, you can see the two-clock cycle delay between the application of an input and the generation of the output. The first clock cycle stores the inputs A and B in the first flip flops. The output of these flip flops will then be passed through the combinatorial logic, in this case, the half adder. The output of the half adder is then stored into the second rank of flip flops and output on the second clock cycle.&lt;/p&gt;&lt;center&gt;&lt;div style="display:inline-block;width:350px;padding:12px 25px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram19a_PrgLogic1.png?v=3"  /&gt;&lt;/a&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 19a: Example Half Adder in a synchronous design (clock is shown in orange).&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;div style="display:inline-block;width:350px;padding:12px 10px 5px 0px;vertical-align:top;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram19b_PrgLogic1.png?v=4"  /&gt;&lt;/a&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 19b: Timing Diagram for the example Half Adder in a synchronous design above.&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;/center&gt;&lt;p style="margin:0;clear:both;padding-top:12px;"&gt;&lt;strong&gt;&lt;em&gt;- 9.2 Shift Registers and Counters&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The three most commonly implemented sequential logic design structures are shift registers, counters, and state machines.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Shift registers in their basic form are a collection of Flip Flops where the output of one flip flop feeds the input of the next flip flop. Signals are then progressed through the shift register on each clock. We can use shift registers for a range of things in our logic design from delays (although there are better ways to implement delays) to metastability synchronizers, as well as conversion between serial and parallel and the generation of random numbers using feedback correctly.&lt;/p&gt;&lt;p style="margin:0;padding:0px;padding-top:12px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram20_PrgLogic1.png?v=2"  /&gt;&lt;/a&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 20: Shift Register and associated timing diagram.&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding-top:12px;"&gt;In many designs, we need to time events or introduce delays between the generation or issuing of signals. We do this by using a counter. In this application, we use the flip flops to store the count and combinatorial logic to determine the next value of the count based upon the current value.&lt;/p&gt;&lt;div style="float:left;width:260px;padding:12px 20px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram21_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram21_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 21: Four-bit counter state diagram&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The first stage in the development of a counter is to create a simple state diagram which shows the counter behavior.&lt;/p&gt;&lt;div style="clear:both;float:left;width:260px;padding:12px 20px 5px 0px;"&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" width="100%"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Present A&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Present B&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Next A&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Next B&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 22: Present State, Next State Table for the counter&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Once the state diagram is created, we can then create a present state, next state table and extract from it the logic equations to implement the counter. Of course, while the example counts in sequential binary, if we desired, we could have the counter count in gray code, etc.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;With the present state, next state table (PS, NS) created, we can then create the logic equations needed to create in combinatorial logic. If necessary we can use Karnaugh-maps, etc. However, for this simple example we can work directly from the present state, next state table.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;With the PS, NS table, we create a logic equation for each of the next states, e.g. next A. As such the equations are: &lt;span style="padding-right:15px;"&gt;&lt;strong&gt;Next A = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.B + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;Next B = &lt;span style="text-decoration:overline;"&gt;A&lt;/span&gt;.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt; + A.&lt;span style="text-decoration:overline;"&gt;B&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;clear:both;padding-top:12px;"&gt;From these equations we can generate the logic circuit which contains the D Type flip flops and logic gates.&lt;/p&gt;&lt;center&gt;&lt;div style="display:inline-block;width:300px;padding:12px 25px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram23a_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;width:300px;padding:12px 10px 5px 0px;vertical-align:top;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram23b_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 23: Logic Design for a two-bit counter.&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Along with counters, logic designs are often called upon to perform sequence and control-based actions. These actions and sequences are best addressed using a state machine.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;clear:both;"&gt;&lt;strong&gt;&lt;em&gt;- 9.3 State Machines&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;State machines are logical constructs that transition between a finite number of states, like a counter; however, the path through the states is not sequential. A state machine will only be in one state at a point in time. It will transition between states depending upon several triggers, e.g. inputs or counter values, etc.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Theoretically, state machines are divided into two basic classes: Moore and Mealy. They differ only in how the state machine&amp;#39;s outputs are generated.&lt;/p&gt;&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; &lt;strong&gt;Moore:&lt;/strong&gt; State Machine outputs are a function of the present state only. A classic example is a counter.&lt;/p&gt;&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; &lt;strong&gt;Mealy:&lt;/strong&gt; State Machine outputs are a function of the present state and inputs. A classic example is the &lt;a class="jive-link-external-small" href="http://en.wikipedia.org/wiki/Richards_controller" rel="nofollow ugc noopener" target="_blank"&gt;Richards Controller&lt;/a&gt;.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;When we are faced with the task of defining a state machine, we will develop a state diagram as we would do for a counter. The state diagram shows the states, inputs, and the transitions between the states and the outputs from the state machine. Figure 24 demonstrates the two types of state diagrams: one for a Moore State Machine (left), the other a Mealy State Machine (right).&lt;/p&gt;&lt;center&gt;&lt;div style="display:inline-block;width:200px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram24a_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;width:200px;padding:12px 10px 5px 0px;vertical-align:top;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram24b_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;p style="margin:0;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 24: State Diagrams for a Moore (left) and Mealy (right) State Machine.&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;/center&gt;&lt;p style="margin:0;padding-top:12px;"&gt;If we were to implement these in logic gates and flip flops we would generate a present state, next state table, as we did for the previous counter example, and then create the logic equations for each of the state variables. The only difference is that, along with the current state, the present state, next state table will also have to consider the inputs and outputs for the state machine.&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;a name="sec10"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="color:#007fac;font-size:15px;padding:4px 8px;margin-top:16px;background-color:#e9f6fc;vertical-align:middle;"&gt;&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;10. Programmable Logic with FPGAs&lt;/strong&gt;&lt;/div&gt;&lt;div style="display:inline-block;vertical-align:top;text-align:right;font-size:11px;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;So far, we have looked at how we create logic designs and implement them with discrete logic gates and flip flops. However, the most common way of implementing a logic design is using a programmable logic device (PLD) such as a Complex Programmable Logic Device (CPLD) or a Field Programmable Gate Array (FPGA). These devices enable the implementation of large logic designs and, depending upon the technology of the device used, they can be reprogrammed in the field.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Programmable logic devices are available in three different technologies:&lt;/p&gt;&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; &lt;strong&gt;SRAM:&lt;/strong&gt; The FPGA program is stored in an external memory and loaded into the FPGA each time it is powered.&lt;/p&gt;&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; &lt;strong&gt;FLASH:&lt;/strong&gt; The FLASH architecture of the FPGA also contains the program; no external memory device is needed.&lt;/p&gt;&lt;p style="margin:0;padding:8px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; &lt;strong&gt;One Time Programmable (OTP):&lt;/strong&gt; The FPGA is applied by blowing fuses in the device. Once programmed, it cannot be modified.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Typically, SRAM-based programmable logic is used where high performance is required, while Flash-based devices are used in middle-to-low performance applications. While one time programmable devices are very limited in application, they still remain popular in space applications.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The key to programmable logic is how logic equations are implemented in the device. It is of course very difficult for the device designers to include a range of AND, OR gates, etc. as the number of each gate type will vary with each application. This will result in either many unused gates or a shortage of a needed gate type. Either way it would not be an efficient method for the implementation of a programmable logic device.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Device manufacturers addressed this challenge in a very smart manner. In place of discrete gates, they use a several input look up table (LUT) which is programmed to implement the combinatorial logic equations. In many respects, this LUT is very similar to a multiplexer. Let&amp;#39;s take a quick look at how we can use a LUT to implement logic equations.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Using the same truth table as for the previous example, we can set the LUT inputs to either ground or VCC depending upon the truth table&amp;#39;s needs. We can then use the logic equation inputs (A,B,C) to drive the LUT selection inputs to output the correct value for that particular input combination implementing the desired logic equation.&lt;/p&gt;&lt;center&gt;&lt;div style="display:inline-block;width:250px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram25_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/2018/diagram25_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="display:inline-block;width:240px;padding:12px 10px 5px 0px;vertical-align:top;"&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;" width="100%"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;" width="25%"&gt;&lt;strong&gt;Input A&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input B&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Input C&lt;/strong&gt;&lt;/th&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;OP&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;0&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p style="margin:0;clear:both;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 25: Setting the LUT&amp;#39;s Inputs to the Truth Table&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;clear:both;padding-top:12px;"&gt;Using a LUT inside our programmable device therefore provides the best flexibility to implement a wide range of logic equations.&lt;/p&gt;&lt;p style="margin:0;clear:both;padding-top:12px;"&gt;Of course, we do not want to just implement the combinatorial logic circuits. We also want to implement sequential structures. This means that following the LUT there needs to be a flip flop to act as storage for the combinatorial output such that we can implement sequential structures.&lt;/p&gt;&lt;p style="margin:0;clear:both;padding-top:12px;"&gt;This combination of a LUT and Flip Flop is often called a Configurable Logic Block (CLB). A programmable logic device will consist of many thousands of CLBs. To provide the most flexibility, additional multiplexers will be used to support a wide range of CLB configurations.&lt;/p&gt;&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram26_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox" src="/e14/assets/legacy/2018/diagram26_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;p style="margin:0;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 26: Very Basic Logic Slice&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Obviously, modern devices have very complex CLB structures, which include local memory, fast carry inputs, arithmetic functions, and shift registers.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Of course, these CLB&amp;#39;s need to be interconnected, which is where the device interconnect comes in, which allows the output of one CLB to be connected to the input of another CLB and eventually to the Input/Output of the device.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;This routing can be considered at two elements. First, there is global routing, which distributes global signals such as clocks. These are global specialist routing networks designed to be low skew and support high fan outs. This dedicated clocking network might be further split between truly global routes across the device and several additional regional limited routes to a specific area of the device. For all other signals, the programmable interconnect is used, which connects the CLBs to each other and other specialist functions within the device. To connect CLBs together it uses a switch matrix, which is configured to provide the internal routing between CLBs.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;One of the key drivers of programmable logic technology development was the reduction in the cost of transistors.&amp;nbsp; However, interconnect wires also played a role in enabling much larger devices at reduced cost.&amp;nbsp; When we develop programmable logic applications we spend a lot of time and effort optimizing the performance of the design with regards to its routing to ensure we can operate at the desired clock frequency.&lt;/p&gt;&lt;div style="float:left;width:300px;padding:12px 10px 5px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/diagram27_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox" src="/e14/assets/legacy/2018/diagram27_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;p style="margin:0;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 27: CLB and Routing matrix&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;To get signals on and off the chip, programmable logic devices also provide IO cells, which are configurable. These enable the device to support a range of single-ended logic standards, e.g. LVCMOS2v4, LVCOM 1V5, etc., Stub Series Terminated Logic (SSTL) as used for High Speed DDR interfaces, and a range of differential standards, including Low Swing Differential Voltage Signaling (LVDS).&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Many devices also include complex structures in the IO cells to allow for double data rate signals, source synchronous designs, bus skew correction, and conversion to/from serial. Electrically, the IO can control slew rates, drive strengths and even match the impedance with the transmission line, all of which are controlled by the developer. This means that given the right PHY on the board, using programmable logic, we can achieve any-to-any interconnectivity.&lt;/p&gt;&lt;p style="margin:0;clear:both;"&gt;&lt;a name="sec11"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="color:#007fac;font-size:15px;padding:4px 8px;margin-top:16px;background-color:#e9f6fc;vertical-align:middle;"&gt;&lt;div style="display:inline-block;vertical-align:top;width:75%;"&gt;&lt;strong&gt;11. Hardware Description Languages&lt;/strong&gt;&lt;/div&gt;&lt;div style="display:inline-block;vertical-align:top;text-align:right;font-size:11px;width:24%;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Thanks to the sheer scale of resources offered by programmable logic we cannot any longer design at the gate level like we have done previously. It would simply take too long to develop applications which can leverage the resources provided by the programmable device at the gate level. In the place of developing by using logic equations, we use Hardware Description languages (HDL) such as Verilog or VHDL.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;When we work with these languages, we do not describe the logic equations, but rather the desired behavior at the register transfer level (RTL). This allows us to define the functionality of the programmable logic device.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;How our description gets translated from our HDL file into the logic equations and implemented in the programmable logic device requires several stages.&lt;/p&gt;&lt;p style="margin:0;padding:0px;clear:both;"&gt;&amp;nbsp;&lt;/p&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#007fac;padding:6px;"&gt;&lt;strong&gt;Synthesis&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;The conversion of the HDL file into logic equations often targeted at the specific resources of the programmable logic device.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#f17c0e;padding:6px;"&gt;&lt;strong&gt;Placing&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;Placing of the identified logic cells (LUT, Flip Flops, etc.) into the programmable logic CLBs.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table cellpadding="0" cellspacing="0" style="border:1px solid #b8d7e5;font-size:12px;margin-bottom:12px;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style="border:1px solid #b8d7e5;color:#ffffff;background-color:#003082;padding:6px;"&gt;&lt;strong&gt;Routing&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border:1px solid #b8d7e5;padding:6px;"&gt;Connecting together the placed CLBs to achieve the required performance.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin:0;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 28: Stages to Convert HDL File into Logic Equations&lt;/em&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Each stage often requires addition constraints to ensure the desired timing is achieved or the correct IO standards are used.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;What developers who are used to using VHDL and Verilog will be familiar with is that not all constructs / commands within a language can be synthesized. Therefore, there is only a subset of language commands and coding structures which can be synthesized into a programmable logic device successfully. The remaining elements of the HDL language which are not synthesizable are used in the verification of the design before we implement it in the device.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;This verification is called the development of a test bench which ensures the Unit Under Test (UUT) meets its specification and is suitable for its intended purpose. When it comes to test benching, we have a couple of choices as to how we perform it.&lt;/p&gt;&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; &lt;strong&gt;Functional Simulation only:&lt;/strong&gt; This checks if the design is functionally correct.&amp;nbsp; It does not include internal device timing delays such as propagation delays, which may affect performance when implemented in the device.&lt;/p&gt;&lt;p style="margin:0;padding:12px 0px 0px 45px;"&gt;&lt;a href="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif"&gt;&lt;img loading="lazy" alt="image" src="/e14/assets/legacy/gen/small_square_bullet_oj5x5.gif" style="vertical-align:middle;"  /&gt;&lt;/a&gt; &lt;strong&gt;Gate Level Simulation:&lt;/strong&gt; This verifies the functionality of the design when back annotated with timing information from the final implemented design. This can take considerable time to perform.&lt;/p&gt;&lt;p style="margin:0;padding:0px;clear:both;"&gt;&amp;nbsp;&lt;/p&gt;&lt;center&gt;&lt;a href="/e14/assets/legacy/2018/diagram29_PrgLogic1.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox" src="/e14/assets/legacy/2018/diagram29_PrgLogic1.png"  /&gt;&lt;/a&gt;&lt;p style="margin:0;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 29: Example Test Bench architecture&lt;/em&gt;&lt;/p&gt;&lt;/center&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Let&amp;#39;s look at how we would implement a state machine using the VHDL Language. Learning VHDL itself is a short course; however, we can briefly introduce the basics here.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;A VHDL file is split into two distinct elements, the entity and the architecture. The entity defines the input and outputs of the VHDL module and if it is at the top level of the design. It represents the inputs and outputs of the programmable logic device itself.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;The architecture defines the functionality and consists of either sequential statements, which are all executed in parallel or processes.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;Processes execute sequentially from top to bottom, more like in a traditional programming application. However, there are rules around when signals update during the process. Additionally, each process in the architecture runs in parallel as you are describing logic functions.&lt;/p&gt;&lt;p style="margin:0;padding:0px;clear:both;"&gt;&amp;nbsp;&lt;/p&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="padding-right:15px;"&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state only&lt;/span&gt; &lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;/p&gt;&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; &lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;/p&gt;&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;TYPE&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#a012a8;"&gt;idle&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_on&lt;/span&gt;, &lt;span style="color:#a012a8;"&gt;led_off&lt;/span&gt;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;current_state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;state&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; idle;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;timer&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;unsigned&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;&lt;span style="color:#1e8f81;"&gt;24&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;DOWNTO&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&lt;span style="color:#323cff;"&gt;) := (&lt;/span&gt;&lt;span style="color:#b3191c;"&gt;OTHERS&lt;/span&gt; &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&amp;#39;0&amp;#39;&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;SIGNAL&lt;/span&gt; &lt;span style="color:#a012a8;"&gt;toggle&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:&lt;/span&gt; &lt;span style="color:#1e8f81;"&gt;std_logic&lt;/span&gt; &lt;span style="color:#323cff;"&gt;:=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;PROCESS&lt;/span&gt;&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk,reset&lt;span style="color:#323cff;"&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; reset &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:35px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle; &lt;br /&gt; op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;ELSIF&lt;/span&gt; rising_edge&lt;span style="color:#323cff;"&gt;(&lt;/span&gt;clk&lt;span style="color:#323cff;"&gt;)&lt;/span&gt; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;CASE&lt;/span&gt; current_state &lt;span style="color:#b3191c;"&gt;IS&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; idle &lt;span style="color:#323cff;"&gt;=&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; start &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;; &lt;span style="color:#4aad19;"&gt;--output is a function of the current state and inputs&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_on =&amp;gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_off;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;/p&gt;&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN&lt;/span&gt; led_off =&amp;gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;IF&lt;/span&gt; toggle &lt;span style="color:#323cff;"&gt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39; &lt;span style="color:#b3191c;"&gt;THEN&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:65px;"&gt;current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; led_on;&lt;br /&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;1&lt;/span&gt;&amp;#39;;&lt;/p&gt;&lt;p style="margin:0;padding-left:50px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;WHEN OTHERS&lt;/span&gt; =&amp;gt;&lt;/p&gt;&lt;p style="margin:0;padding-left:50px;"&gt;op &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; &amp;#39;&lt;span style="color:#1e8f81;"&gt;0&lt;/span&gt;&amp;#39;;&lt;br /&gt; current_state &lt;span style="color:#323cff;"&gt;&amp;lt;=&lt;/span&gt; idle;&lt;/p&gt;&lt;p style="margin:0;padding-left:35px;"&gt;&lt;span style="color:#b3191c;"&gt;END CASE&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin:0;padding-left:15px;"&gt;&lt;span style="color:#b3191c;"&gt;END IF&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span style="color:#b3191c;"&gt;END PROCESS&lt;/span&gt;;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin:0;line-height:12px;font-size:11px;padding-top:3px;"&gt;&lt;em&gt;Figure 30: VHDL Architecture which shows the implementation of the state machines in the above example&lt;/em&gt;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;In the above example, the process runs each time the clock or reset is changed. This is defined in the sensitivity list of the process declaration.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;In these examples, the reset is asynchronous and used to reset the current state and the output, while the next actions only occur following the rising edge of the clock. Where the state machine progresses through each state depends upon its inputs and current state, moving if necessary to the next state.&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;"&gt;What this demonstrates is that, using programmable logic and HDL, we can directly code the state machine or counter from the state diagram and without the need to create the logic equations. Indeed, we let the synthesis tool do that for us.&lt;/p&gt;&lt;p style="margin:0;padding:0px;clear:both;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin:0;padding-top:12px;font-size:11px;clear:both;"&gt;*Trademark. &lt;strong&gt;Xilinx is a trademark of Xilinx Inc.&lt;/strong&gt; Other logos, product and/or company names may be trademarks of their respective owners.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="border:1px solid #a9aaaa;background-color:#e9f6fc;padding:12px 12px 0px;"&gt;&lt;a href="/e14/assets/legacy/2018/PrgmLogic_profile.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox essProfile" height="115" src="/e14/assets/legacy/2018/PrgmLogic_profile.png" style="float:left;padding-right:10px;vertical-align:middle;"  /&gt;&lt;/a&gt;&lt;div&gt;&lt;p style="margin:0;font-size:15px;color:#007fac;padding-bottom:10px;"&gt;Shop our wide range of &lt;strong&gt;FPGAs, SoCs, EVMs, application specific kits, embedded development boards, and more.&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-AU_CN_HK_IN_KR_MY_NZ_PH_SG_TH_TW_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" href="http://sg.element14.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" target="_blank" title="Shop Now"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-AT_BE_BG_CZ_DK_EE_FI_FR_DE_HU_IE_IL_IT_LV_LT_NL_NO_PL_PT_RO_RU_SK_SI_ES_SE_CH_TR_UK_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" href="http://uk.farnell.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" target="_blank" title="Shop Now"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-US_BR_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" href="http://www.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" target="_blank" title="Shop Now"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-CA_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" href="http://canada.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" target="_blank" title="Shop Now"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class="e14-conditional-content e14-init-hidden e14-conditional-country-MX_"&gt;&lt;span class="e14-button-large e14-button-primary"&gt;&lt;a class="jive-link-external-small" href="http://mexico.newark.com/w/search/prl/results?brand=xilinx&amp;amp;COM=essentials-prgmdevice1-banlink" target="_blank" title="Shop Now"&gt;Shop Now&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;padding:0px;clear:both;"&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="margin:0;padding-top:20px;"&gt;&lt;a name="test"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="margin:0;color:#007fac;font-size:18px;padding-bottom:8px;"&gt;&lt;strong&gt;Test Your Knowledge&lt;/strong&gt;&lt;span style="font-size:11px;float:right;"&gt;&lt;a class="jive-link-anchor-small" href="#top"&gt;&lt;strong&gt;Back to Top&lt;/strong&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;a href="/e14/assets/legacy/2018/100x100_PrgmDevice1Bdg.png"&gt;&lt;img loading="lazy" alt="image" class="nolightbox" height="80" src="/e14/assets/legacy/2018/100x100_PrgmDevice1Bdg.png" style="vertical-align:top;float:left;padding:0px 10px 5px 0px;"  /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="margin:0;padding-bottom:8px;"&gt;Are you ready to demonstrate your Essentials of Programmable Logic knowledge? &lt;strong&gt;Then take a quick 15-question, multiple-choice quiz to see how much you&amp;#39;ve learned from this Programmable Devices module.&lt;/strong&gt;&lt;/p&gt;&lt;p style="margin:0;"&gt;&lt;strong&gt;To earn the Programmable Devices I Badge&lt;/strong&gt;, read through the module to learn all about Programmable Logic, attain 100% in the quiz at the bottom, leave us some feedback in the comments section, and give the module a star rating.&lt;/p&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-document-metadata e14-init-hidden"&gt; &lt;/div&gt;&lt;div class="e14-quiz-question"&gt;      [QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-question"&gt;  [QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-question"&gt;      [QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-question"&gt;      [QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-question"&gt;      [QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-question"&gt;      [QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-question"&gt;[QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;&lt;p style="margin:0;padding:0px;clear:both;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-question"&gt;      [QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-question"&gt;     [QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-question"&gt;      [QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-question"&gt;  [QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-question"&gt;[QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-question"&gt;      [QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-question"&gt;     [QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;&lt;p style="margin:0;padding:0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;div class="e14-quiz-question"&gt;      [QUIZ QUESTION PLACEHOLDER]&lt;/div&gt;
&lt;div class="migration-injected-attachments"&gt;&lt;div style="font-weight:bold;margin:15px 0 5px 0;"&gt;Attachments:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;table style="border:0;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="160"&gt;&lt;span class="_se_attachment" id="attid_https://www.element14.com/community/api/core/v3/attachments/265862"&gt;&lt;a href="https://community.element14.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-02-50/Programmable-Devices-I-_2D00_-Programmable-Logic.pdf"&gt;community.element14.com/.../Programmable-Devices-I-_2D00_-Programmable-Logic.pdf&lt;/a&gt;&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;span style="font-size:80%;"&gt;Programmable Devices I - Programmable Logic.pdf&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;script&gt;window.top.e14.func.queueScripts.add(function() { window.top.e14.func.e14ConditionalContent();} );&lt;/script&gt;

&lt;div style="font-size: 90%;"&gt;Tags: fpga_essentials, programmable_devices, xilinx_essentials, xilinx, fpga, programmable_device, programmable_logic, ess_module&lt;/div&gt;
</description></item></channel></rss>