Logi Gtes nd Properties We will e using logil opertions to uild mhines tht n do rithmeti lultions. It s useful to think of these opertions s si omponents tht n e hooked together into omplex networks. To help visulize these networks, we ll use digrms to represent eh opertion. For the logil opertion AND, we ll use the following digrm, lled n AND gte: For the logil opertion OR, we use n OR gte: + Finlly, for the logil opertion NOT, we use NOT gte: Now we n digrm omplited logil expressions s logi networks. For exmple, the logil expression + n e digrmmed like so: + This logi network indites tht we tke AND, then NOT the result nd omine with using n OR. Here re some more exmples
Logil expression Logi network + d d To uild omplited logi network we hook the outputs of some logi gtes to the inputs of other logi gtes. We n extend this digrmmti nottion y llowing more inputs for AND nd OR: Words Symols Digrm AND AND AND d AND e de d e OR OR OR d OR e + + + d + e d e
We n now exmine some si properties of logil opertions nd how these properties pper when digrmmed. First, rell the tle of omintions for AND: AND 0 1 0 0 0 1 0 1 From this tle we see tht 0 AND 1 gives the sme truth vlue s 1 AND 0, so the order in whih we write the piees of the omintion doesn t mtter. Tht is, for sttements nd the truth vlue of AND will e the sme s the truth vlue for AND. In symols, this is Lw of Commuttivity for AND: Similrly, the tle of omintions for OR: OR 0 1 0 0 1 1 1 1 Indites tht 0 OR 1 hs the sme truth vlue s 1 OR 0, so generlly for sttements nd we hve the Lw of Commuttivity for OR:. + + For logi gtes, these Lws of Commuttivity sy tht it doesn t mtter wht order we use to drw the inputs into the AND nd OR gtes:
These properties re similr to wht we hve seen for numers. For numers, we lso hd Lw of Identity whih sid tht multiplition y 1 doesn t hnge numer. In logi, there is lso n identity for AND: Lw of Identity for AND: 1 Even though this Lw looks fmilir from numers, we hve to e reful to hek tht it is still true for logi (where is sttement nd 1 mens AND 1 ). To see tht the Lw of Identity holds for AND, look t the truth tle for AND 1. Here 1 mens vrile tht is lwys true, so to nlyze 1 we only need to see wht hppens when we hnge. With only one vrile, the truth tle for 1 hs 2 1 2 rows: 1 0 0 1 1 Sine the two olumns re the sme, 1. Digrmmtilly, we drw 1 this wy 1 Another wy to think of this is tht if we hve logi network with gte tht looks like the one ove, we n remove tht gte. We lso hve the Lw of Identity for OR: + 0 This follows from the truth tle for + 0 (here 0 mens vrile tht is lwys flse). Anlyzing OR FALSE, we hve + 0 0 0 1 1 And gin the two olumns re the sme, so + 0.
We lso hve nother property tht is similr to wht we hd for numers: Distriutive Lw for AND nd OR: ( + ) + To see tht the Distriutive Lw holds, we ompre the lst olumns of the following truth tles; noting tht the truth vlues of the lst two olumns re the sme. + (+) + 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0 0 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 1 1 1 1 0 1 0 1 1 1 1 0 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 Digrmmtilly, this looks like So fr we hve seen lws tht re similr to wht we hd for numers. Even though our ojets re not numers ut rther sttements, this similrity is helpful when mnipulting logil expressions; we n use our intuition for the lger of numers to work with the lger of sttements. This is the gret power of Boole s nottion. But there re other properties of logi whih not like the properties of numers. For exmple, in logi 1 + 1 1 (this sys tht two true sttements ORed together mke true sttement). We lso hve the following property: Lw of Doule Negtion for NOT:
Whih sys tht doing two NOTs in row is the sme s doing nothing. This should e ler euse if the first NOT hnges 0 to 1 then the seond NOT will hnge tht 1 k to 0 (nd vie vers). Digrmmtilly, this sys We hve different sort of nelltion for AND. Cnelltion Lw for AND: 0 This sys tht AND NOT is flse, whih is intuitively ler (you n t elieve sttement nd its negtion t the sme time!) nd whih we n lso hek using the truth tle 0 1 0 1 0 0 Finlly, we hve property whih we will soon find to e very useful when simplifying logi networks: Cnelltion Lw for OR: + 1 Intuitively, this just sys tht either sttement is true or its negtion is true; tht is, either or NOT hs to e true, so when we OR these two piees together to get + it hs to e true. We n write this out with truth tle + 0 1 1 1 0 1
Digrmmtilly this sys 1 This mens tht if we hve logi network tht hs portion like the little network on the left, we n remove the little network, repling the vrile with onstnt vlue of 1.