http://en.wikipedi.org/wiki/elementry_boolen_lger Boolen lger www.tudorgir.com Computer science is not out computers, it is out computtion nd informtion. computtion informtion computer informtion Turing mchines model computtions with unounded stte. They llow us to reson out wht prolems re computle or not. The Hlting prolem is the cnonicl exmple of n uncomputle prolem: It is impossile to write progrm tht cn nlyze n ritrry progrm nd decide in finite time whether tht progrm will hlt. Figure from http://en.wikipedi.org/wiki/turing_mchine Aln Turing, 937
Boolen lger ws developed in 854 y George Boole in his ook An Investigtion of the Lws of Thought. Clude Shnnon founded oth digitl computer nd digitl circuit design theory in 937 through his Mster thesis (t MIT) demonstrting tht electricl ppliction of Boolen lger could construct nd resolve ny logicl, numericl reltionship. http://en.wikipedi.org/wiki/george_boole http://en.wikipedi.org/wiki/clude_shnnon George Boole 85 864 Clude Shnnon 96 2 When the switch is open, the output y is without voltge. This corresponds to vlue, or flse. When the switch is closed, the output y is under voltge. This corresponds to vlue, or true. = y = = y = nd re the domin vlues of oolen lger. = = y =
= = y = = = y = = = y =
= = x y = x = = x y = x x x x = x = x y = x x x x x x x
= = y = = = y = = = y =
= = y = = = x y = x x x = = x y = x x x
= x = x y = x x x x x x x = y = y = = y = y =
Conjunction (AND) Disjunction (OR) Negtion (NOT) = y Bsic oolen opertors: - Conjunction (AND): : = if nd only if = nd = - Disjunction (OR): : = if nd only if = or = - Negtion (NOT): : = if nd only if = These tles re clled the truth vlues for these opertions. As n exercise, construct the truth tle of the oolen function: f= ( c) Vrious nottions nd representtions of sic oolen opertions. http://en.wikipedi.org/wiki/logic_gte * & AND OR -! NOT Neutrl elements = = Zero elements = = Idempotence = = Commuttivity = = Associtivity ( c) = ( ) c ( c) = ( ) c Distriutivity ( c) = ( ) ( c) ( c) = ( ) ( c) Every xiom hs dul one: replce, with, nd you will get the sme set of lws. This is clled the dulity principle of oolen lger. http://en.wikipedi.org/wiki/elementry_boolen_lger Idempotence sys tht n opertion cn e pplied multiple times without chnging the result. http://en.wikipedi.org/wiki/idempotence Negtion = =
DeMorgn s lws ( ) = ( ) ( ) NAND DeMorgn s Theorems for negting oolen function: - Negte oolen vriles; - Chnge to nd to ; ( ) = ( ) ( ) NOR ( ) ( ) ( ) DeMorgn s xioms: ( ) = ( ) ( ) clled NAND ( ) = ( ) ( ) clled NOR http://en.wikipedi.org/wiki/de_morgn%27s_lws De Morgn (86 87) Neutrl elements = = Zero elements = = Commuttivity = = Associtivity ( c) = ( ) c ( c) = ( ) c Exercises. Determine the results of: ( ) (( ) ( )) =? ( ) =? (nmed the sorption xiom) ( ) =? (nmed the sorption xiom) Idempotence = = Distriutivity ( c) = ( ) ( c) ( c) = ( ) ( c) Negtion = = DeMorgn s ( ) = ( ) ( ) ( ) = ( ) ( ) Specil oolen opertors: - Exclusive OR (XOR): y is if exctly one of the vriles nd is. y= = - Impliction: y is if nd only if is or is. y = = Exclusive OR (XOR) = y Impliction = y Euivlence = y - Euivlence: y = = ( ) ( ) Exercise: Represent these opertions using Venn Digrms
4 3 3 Negtion (NOT) = y Exclusive OR (XOR) = y Conjunction (AND) 3 2 Impliction = y Disjunction (OR) Euivlence = y Opertors precedence: Negtion 4 Conjunction 3 Disjunction 3 Impliction 2 Euivlence Exmple: c d e = ( ) ((c ( d)) e) Tutology f = ( ( )) Contrdiction f = ( ) Stisfile f = sometimes - f is tutology if: f = in ll situtions (f is lwys ) Exmple: ( ( )) (Modus Ponens Axiom) - f is contrdiction if: f = in ll situtions (f is lwys ) Exmple: - f is stisfile (vlid, erfüllr) if: f = in some sitution Exmples: ( ) ( c) ( c) is tutology nd thus stisfile. ( ) c is stisfile, ut is not tutology Stisfiility is difficult to prove. How mny sic oolen functions with 2 prmeters re possile? In generl, we hve 2^2^n possile functions for n input prmeters. y = y = y 2 = y3 = y4 = y5 = y6 = y7 = y5 = y 4 = y3 = y 2 = y = y = y9 = y8 =
How to crete hlf dder? = co XOR AND co Wht is oolen lger good for? An dder is n exmple of prcticl usefulness. A hlf dder is logicl circuit tht performs n ddition opertion on two one-it inry numers nd : s = ( = ) (sum it) c = ( ) (crry out it) Exercise: redesign the circuit to stisfy the conditions: - use only sic gtes (nd, or, not) - use the lest mount of gtes / connections http://en.wikipedi.org/wiki/adder_(electronics) How to crete full dder? A full dder lso tkes crry-in it into ccounts from possile previous dditions. Thus, the result depends on 3 its (, nd ci) nd represents the result of ddition in two its: co nd. ci = co Exercise: design the gtes of Full Adder ci Full dder co How to crete full dder? We otin full dder of multiple its y linking multiple dders. ci Full dder coci Full dder coci Full dder co
Tudor Gîr www.tudorgir.com cretivecommons.org/licenses/y/3./