Minnesota Starvation Experiment: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>Quantumobserver
Principal investigators: These don't need to be bolded
en>Mike Kabinsky
 
Line 1: Line 1:
[[File:K-map 6,8,9,10,11,12,13,14 anti-race.svg|thumb|right|An example Karnaugh map]]
I'm Luther [http://schnitzls-superdudes.de/index/users/view/id/18715 extended car warranty] but I never truly favored that extended [http://muehle-kruskop.de/index.php?mod=users&action=view&id=22344 auto warranty] name. One of the issues I adore most is greeting card collecting but I don't have the time lately. extended auto warranty Her husband and her chose to reside in Delaware but she needs to transfer  extended car warranty because of her family. The [https://Www.costcoauto.com/vpp/about.aspx occupation I've] been occupying for many years is a [https://www.Hyundaiusa.com/assurance/america-best-warranty.aspx bookkeeper] but I've currently utilized for another one.<br><br>Feel free to visit my web site ... [http://phoenixbiofuel.com/ActivityFeed/MyProfile/tabid/60/userId/184800/Default.aspx http://phoenixbiofuel.com/ActivityFeed/MyProfile/tabid/60/userId/184800/Default.aspx]
The '''Karnaugh map,''' also known as the '''K-map''', is a method to simplify [[boolean algebra]] expressions. [[Maurice Karnaugh]] introduced it in 1953 as a refinement of [[Edward Veitch]]'s 1952 '''Veitch diagram'''. The Karnaugh map reduces the need for extensive calculations by taking advantage of humans' pattern-recognition capability. It also permits the rapid identification and elimination of potential [[race condition]]s.
 
The required boolean results are transferred from a [[truth table]] onto a two-dimensional grid where the cells are ordered in [[Gray code]], and each cell position represents one combination of input conditions, while each cell value represents the corresponding output value. Optimal groups of 1s or 0s are identified, which represent the terms of a [[Canonical form (Boolean algebra)|canonical form]] of the logic in the original truth table.<ref name="KMapRulesOfSimplification">{{cite web |url=http://www.ee.surrey.ac.uk/Projects/Labview/minimisation/karrules.html |title=Karnaugh Maps – Rules of Simplification |accessdate=2009-05-30}}</ref> These terms can be used to write a minimal boolean expression representing the required logic.
 
Karnaugh maps are used to simplify real-world logic requirements so that they can be implemented using a minimum number of physical logic gates. A [[Conjunctive normal form|sum-of-products expression]] can always be implemented using [[AND gate]]s feeding into an [[OR gate]], and a [[Disjunctive normal form|product-of-sums expression]] leads to OR gates feeding an AND gate.<ref>{{cite web|title=Simplifying Logic Circuits with Karnaugh Maps|url=http://www.utdallas.edu/~dodge/EE2310/lec5.pdf|publisher=The University of Texas at Dallas|accessdate=7 October 2012}}</ref> Karnaugh maps can also be used to simplify logic expressions in software design. Boolean conditions, as used for example in [[Conditional (programming)|conditional statements]], can get very complicated, which makes the code difficult to read and to maintain. Once minimised, canonical sum-of-products and product-of-sums expressions can be implemented directly using AND and OR logic operators.<ref>{{cite web|last=Cook|first=Aaron|title=Using Karnaugh Maps to Simplify Code|url=http://www.quantumrarity.com/archives/255|publisher=Quantum Rarity|accessdate=7 October 2012}}</ref>
 
==Example==
 
Karnaugh maps are used to facilitate the simplification of [[Boolean algebra (logic)|Boolean algebra]] functions. Take the Boolean or [[Binary numeral system|binary]] function described by the following [[truth table]].
 
{| class="wikitable" style="text-align: center"
|+ Truth table of a function
|-
! &nbsp; !! ''A'' !! ''B'' !! ''C'' !! ''D'' !! ''f(A, B, C, D)''
|-
! scope="row" |  0
| 0 || 0 || 0 || 0 || 0
|-
! scope="row" |  1
| 0 || 0 || 0 || 1 || 0
|-
! scope="row" |  2
| 0 || 0 || 1 || 0 || 0
|-
! scope="row" |  3
| 0 || 0 || 1 || 1 || 0
|-
! scope="row" |  4
| 0 || 1 || 0 || 0 || 0
|-
! scope="row" |  5
| 0 || 1 || 0 || 1 || 0
|-
! scope="row" |  6
| 0 || 1 || 1 || 0 || 1
|-
! scope="row" |  7
| 0 || 1 || 1 || 1 || 0
|-
! scope="row" |  8
| 1 || 0 || 0 || 0 || 1
|-
! scope="row" |  9
| 1 || 0 || 0 || 1 || 1
|-
! scope="row" | 10
| 1 || 0 || 1 || 0 || 1
|-
! scope="row" | 11
| 1 || 0 || 1 || 1 || 1
|-
! scope="row" | 12
| 1 || 1 || 0 || 0 || 1
|-
! scope="row" | 13
| 1 || 1 || 0 || 1 || 1
|-
! scope="row" | 14
| 1 || 1 || 1 || 0 || 1
|-
! scope="column" | 15
| 1 || 1 || 1 || 1 || 0
|}
 
Following are two different notations describing the same function in unsimplified Boolean algebra, using the Boolean variables <math>A</math>, <math>B</math>, <math>C</math>, <math>D</math>, and their inverses.
 
*<math>f(A, B, C, D) = \sum_{}m(6, 8, 9, 10, 11, 12, 13, 14)</math> Note: The values inside <math>\sum_{}</math> are the [[minterm]]s to map (i.e., rows that have output 1 in the truth table).
 
*<math>f(A, B, C, D) = \overline{A}BC\overline{D} + A\overline{B}\,\overline{C}\,\overline{D} + A\overline{B}\,\overline{C}D + A\overline{B}C\overline{D} + A\overline{B}CD + AB\overline{C}\,\overline{D} + AB\overline{C}D + ABC\overline{D}</math>
 
===Karnaugh map===
 
{| style="float:right"
| [[File:Karnaugh6.gif|thumb|x200px|K-map drawn on a torus, and in a plane. The dot-marked cells are adjacent.]]
|}
{| style="float:right"
| [[File:K-map_minterms_A.svg|thumb|x200px|K-map construction.]]
|}
 
In this case, the four input variables can be combined in 16 different ways, so the truth table has 16 rows, and the Karnaugh map has 16 positions. The Karnaugh map is therefore arranged in a 4&nbsp;×&nbsp;4 grid.
 
The row and column values (shown across the top, and down the left side of the Karnaugh map) are ordered in [[Gray code]] rather than binary numerical order. Gray code ensures that only one variable changes between each pair of adjacent cells. Each cell of the completed Karnaugh map contains a binary digit representing the function's output for that combination of inputs.
 
After the Karnaugh map has been constructed it is used to find one of the simplest possible forms—a [[Canonical form (Boolean algebra)|canonical form]]—for the information in the truth table.  Adjacent 1s in the Karnaugh map represent opportunities to simplify the expression. The minterms ('minimal terms') for the final expression are found by encircling groups of 1s in the map. Minterm groups must be rectangular and must have an area that is a power of two (i.e., 1,&nbsp;2,&nbsp;4,&nbsp;8…). Minterm rectangles should be as large as possible without containing any 0s. Groups may overlap in order to make each one larger. The optimal groupings in this example are marked by the green, red and blue lines, and the red and green groups overlap. The red group is a 2&nbsp;×&nbsp;2 square, the green group is a 4&nbsp;×&nbsp;1 rectangle, and the overlap area is indicated in brown.
 
The grid is [[torus|toroidally]] connected, which means that rectangular groups can wrap across the edges (see picture). Cells on the extreme right are actually 'adjacent' to those on the far left; similarly, so are those at the very top and those at the bottom. Therefore <math>A\scriptstyle \overline{D}</math> can be a valid term—it includes cells 12 and 8 at the top, and wraps to the bottom to include cells 10 and 14—as is <math>\scriptstyle\overline{B}\,\overline{D}</math>, which includes the four corners.
 
===Solution===
 
[[File:K-map_6,8,9,10,11,12,13,14.svg|thumb|K-map showing minterms as colored rectangles and squares. The brown region is an overlap of the red 2×2 square and the green 4×1 rectangle.]]
Once the Karnaugh map has been constructed and the adjacent 1s linked by rectangular and square boxes, the algebraic minterms can be found by examining which variables stay the same within each box.
 
For the red grouping:
*The variable ''A'' is the same and is equal to 1 throughout the box, therefore it should be included in the algebraic representation of the red minterm.
*Variable ''B'' does not maintain the same state (it shifts from 1 to 0), and should therefore be excluded.
*''C'' does not change. It is always 0 so its complement, NOT-C, should be included thus, <math>\overline{C}</math>.
*''D'' changes, so it is excluded as well.
Thus the first minterm in the Boolean sum-of-products expression is <math>A\overline{C}</math>.
 
For the green grouping, ''A'' and ''B'' maintain the same state, while ''C'' and ''D'' change. ''B'' is 0 and has to be negated before it can be included. Thus the second term is <math>A\overline{B}</math>.
 
In the same way, the blue grouping gives the term <math>BC\overline{D}</math>.
 
The solutions of each grouping are combined thus <math>A\overline{C} + A\overline{B} + BC\overline{D}</math>.
 
Thus the Karnaugh map has guided a simplification of
:<math>\begin{align}
              f(A, B, C, D) = {} &\overline{A}BC\overline{D} + A\overline{B}\,\overline{C}\,\overline{D} + A\overline{B}\,\overline{C}D + A\overline{B}C\overline{D} + {}\\
                                &A\overline{B}CD + AB\overline{C}\,\overline{D} + AB\overline{C}D + ABC\overline{D}\\
  \Rightarrow f(A, B, C, D) = {} &A\overline{C} + A\overline{B} + BC\overline{D}
\end{align}</math>
 
It would also have been possible to derive this simplification by carefully applying the [[Boolean algebra (logic)#Axioms|axioms of boolean algebra]], but the time it takes to find it grows exponentially with the number of terms.
 
===Inverse===
 
The inverse of a function is solved in the same way by grouping the 0s instead.
 
The three terms to cover the inverse are all shown with grey boxes with different colored borders:
*brown—<math>\overline{A}\,\overline{B}</math>
*gold—<math>\overline{A}\,\overline{C}</math>
*blue—<math>BCD</math>
 
This yields the inverse:
:<math>\overline{F} = \overline{A}\,\overline{B} + \overline{A}\,\overline{C} + BCD</math>
 
Through the use of [[De Morgan's laws]], the [[product of sums]] can be determined:
:<math>\begin{align}
  \overline{\overline{F}} &= \overline{\overline{A}\,\overline{B} + \overline{A}\,\overline{C} + BCD} \\
                        F &= \left(A + B\right)\left(A + C\right)\left(\overline{B} + \overline{C} + \overline{D}\right)
\end{align}</math>
 
===Don't cares===
 
[[File:K-map 6,8,9,10,11,12,13,14 don't care.svg|thumb|The value of ''f(A,B,C,D)'' for ''ABCD'' = 1111 is replaced by a "don't care". This removes the green term completely and allows the red term to be larger. It also allows blue inverse term to shift and become larger]]
 
Karnaugh maps also allow easy minimizations of functions whose truth tables include "[[Don't-care (logic)|don't care]]" conditions. A "don't care" condition is a combination of inputs for which the designer doesn't care what the output is. Therefore "don't care" conditions can either be included in or excluded from any circled group, whichever makes it larger. They are usually indicated on the map with a dash or X.
 
The example on the right is the same as the example above but with the value of ''F'' for ''ABCD'' = 1111 replaced by a "don't care". This allows the red term to expand all the way down and, thus, removes the green term completely.
 
This yields the new minimum equation:
:<math>F = A + BC\overline{D}</math>
 
Note that the first term is just <math>A</math> not <math>A\overline{C}</math>. In this case, the don't care has dropped a term (the green); simplified another (the red); and removed the race hazard (the yellow as shown in a following section).
 
The inverse case is simplified as follows
:<math>\overline{F} = \overline{A}\,\overline{B} + \overline{A}\,\overline{C} + \overline{A}D</math>
 
==Race hazards==
===Elimination===
 
Karnaugh maps are useful for detecting and eliminating [[race hazard]]s. Race hazards are very easy to spot using a Karnaugh map, because a race condition may exist when moving between any pair of adjacent, but disjointed, regions circled on the map.
 
* In the example [[Karnaugh_map#Solution|above]], a potential race condition exists when ''C'' is 1 and ''D'' is 0, ''A'' is 1, and ''B'' changes from 1 to 0 (moving from the blue state to the green state). For this case, the output is defined to remain unchanged at 1, but because this transition is not covered by a specific term in the equation, a potential for a ''glitch'' (a momentary transition of the output to 0) exists.
* There is a second potential glitch in the same example that is more difficult to spot: when ''D'' is 0 and ''A'' and ''B'' are both 1, with C changing from 1 to 0 (moving from the blue state to the red state). In this case the glitch wraps around from the top of the map to the bottom.
 
[[File:K-map 6,8,9,10,11,12,13,14 anti-race.svg|thumb|Above ''k''-map with the <math>A\overline{D}</math> term added to avoid race hazards]]
 
Whether these glitches will actually occur depends on the physical nature of the implementation, and whether we need to worry about it depends on the application.
 
In this case, an additional term of <math>A\overline{D}</math> would eliminate the potential race hazard, bridging between the green and blue output states or blue and red output states: this is shown as the yellow region (which wraps around from the bottom to the top of the right half) in the diagram to the right.
 
The term is [[logic redundancy|redundant]] in terms of the static logic of the system, but such redundant, or [[consensus theorem|consensus terms]], are often needed to assure race-free dynamic performance.
 
Similarly, an additional term of <math>\overline{A}D</math> must be added to the inverse to eliminate another potential race hazard. Applying De Morgan's laws creates another product of sums expression for ''F'', but with a new factor of <math>\left(A + \overline{D}\right)</math>.
 
===2-variable map examples===
 
The following are all the possible 2-variable, 2&nbsp;×&nbsp;2 Karnaugh maps. Listed with each is the minterms as a function of <math>\sum m()</math> and the race hazard free (''see [[#Race hazards|previous section]]'') minimum equation.
<gallery>
File:K-map 2x2 none.svg | <math>\sum_{}</math>m(0); ''K'' = 0
File:K-map 2x2 1.svg | <math>\sum_{}</math>m(1); ''K'' = ''A''′''B''′
File:K-map 2x2 2.svg | <math>\sum_{}</math>m(2); ''K'' = ''AB''′
File:K-map 2x2 3.svg | <math>\sum_{}</math>m(3); ''K'' = ''A''′''B''
File:K-map 2x2 4.svg | <math>\sum_{}</math>m(4); ''K'' = ''AB''
File:K-map 2x2 1,2.svg | <math>\sum_{}</math>m(1,2); ''K'' = ''B''′
File:K-map 2x2 1,3.svg | <math>\sum_{}</math>m(1,3); ''K'' = ''A''′
File:K-map 2x2 1,4.svg | <math>\sum_{}</math>m(1,4); ''K'' = ''A''′''B''′ + ''AB''
File:K-map 2x2 2,3.svg | <math>\sum_{}</math>m(2,3); ''K'' = ''AB''′ + ''A''′''B''
File:K-map 2x2 2,4.svg | <math>\sum_{}</math>m(2,4); ''K'' = ''A''
File:K-map 2x2 3,4.svg | <math>\sum_{}</math>m(3,4); ''K'' = ''B''
File:K-map 2x2 1,2,3.svg | <math>\sum_{}</math>m(1,2,3); ''K'' = ''A''′ + ''B''′
File:K-map 2x2 1,2,4.svg | <math>\sum_{}</math>m(1,2,4); ''K'' = ''A'' + ''B''′
File:K-map 2x2 1,3,4.svg | <math>\sum_{}</math>m(1,3,4); ''K'' = ''A''′ + ''B''
File:K-map 2x2 2,3,4.svg | <math>\sum_{}</math>m(2,3,4); ''K'' = ''A'' + ''B''
File:K-map 2x2 1,2,3,4.svg | <math>\sum_{}</math>m(1,2,3,4); ''K'' = 1
</gallery>
 
==See also==
 
* [[Circuit minimization]]
* [[Espresso heuristic logic minimizer]]
* [[List of boolean algebra topics]]
* [[Quine&ndash;McCluskey algorithm]]
* [[Venn diagram]]
 
==References==
 
{{reflist}}
 
==Further reading==
 
{{refbegin}}
*{{cite journal
| last = Karnaugh
| first = Maurice
| authorlink = Maurice Karnaugh
| title = The Map Method for Synthesis of Combinational Logic Circuits
| journal = [[Transactions of the American Institute of Electrical Engineers]] part I
| volume = 72
| issue = 9
| pages = 593–599
| date = November 1953
| doi = 10.1109/TCE.1953.6371932}}
*{{cite book
| last = Katz
| first = Randy
| authorlink = Randy Katz
| title = Contemporary Logic Design
| origyear = 1994
| publisher = The Benjamin/Cummings
|isbn= 0-8053-2703-7
| doi = 10.1016/0026-2692(95)90052-7
| pages = 70–85
| year = 1998}}
*{{cite journal
| last = Veitch
| first = Edward W.
| authorlink = Edward Veitch
| title = A Chart Method for Simplifying Truth Functions
| journal = ACM Annual Conference/Annual Meeting: Proceedings of the 1952 ACM Annual Meeting (Pittsburg)
| publisher = ACM, NY
| pages = pp. 127–133
| year = 1952
| doi = 10.1145/609784.609801}}
*{{cite book
| last = Vingron
| first = Dr. Shimon Peter
| title = Switching Theory: Insight Through Predicate Logic
| origyear = 2004
| publisher = [[Springer-Verlag]]
| location = Berlin, Heidelberg, New York
| isbn = 3-540-40343-4
| pages = 57–76
| chapter = Karnaugh Maps
| year = 2004}}
*{{cite book
| last = Wickes
| first = William E.
| title = Logic Design with Integrated Circuits
| year = 1968
| publisher = John Wiley & Sons
| location = New York
|id= Library of Congress Catalog Number: 68-21185
| pages = 36–49
| quote = A refinement of the [[Venn diagram]] in that circles are replaced by squares and arranged in a form of matrix. The Veitch diagram labels the squares with the minterms. Karnaugh assigned 1s and 0s to the squares and their labels and deduced the numbering scheme in common use.
}}
{{refend}}
 
== External links ==
{{sisterlinks}}
* [http://frederic.carpon.perso.sfr.fr/Quine-McCluskey_%28frederic_carpon_implementation%29.php Quine–McCluskey algorithm implementation with a search of all solutions], by Frédéric Carpon.
* [http://gandraxa.com/detect_overlapping_subrectangles.xml Detect Overlapping Rectangles], by Herbert Glarner.
* [http://www.sccs.swarthmore.edu/users/06/adem/engin/e15/lab1/ Using Karnaugh maps in practical applications], Circuit design project to control traffic lights.
*[http://fullchipdesign.com/kmap2v.htm K-Map Tutorial for 2,3,4 and 5 variables ]
* [http://www.generalnumbers.com/karnaugh_application1.html Karnaugh Map Example]
 
 
[[Category:Boolean algebra]]
[[Category:Logic in computer science]]
[[Category:Diagrams]]
[[Category:Electronics optimization]]

Latest revision as of 08:27, 10 October 2014

I'm Luther extended car warranty but I never truly favored that extended auto warranty name. One of the issues I adore most is greeting card collecting but I don't have the time lately. extended auto warranty Her husband and her chose to reside in Delaware but she needs to transfer extended car warranty because of her family. The occupation I've been occupying for many years is a bookkeeper but I've currently utilized for another one.

Feel free to visit my web site ... http://phoenixbiofuel.com/ActivityFeed/MyProfile/tabid/60/userId/184800/Default.aspx