boolean logic, de morgan’s laws,computing.ermysteds.co.uk/.../booleanlogicnoanswers_0_0.pdf ·...
TRANSCRIPT
Boolean logic, De Morgan’s laws, and lots of other mind-bending
stuff
You need your brain for this. Also I can’t believe that I used Paint to make some images.
You should shoot me now.
De Morgan came up with two rules
(NOT A) AND (NOT B) = NOT (A OR B)
&
NOT (A AND B) = (NOT A) OR (NOT B)
We have a logic circuit, it uses 2 gates
A
B
A.B A.B
We could replace two gates with a single NAND gate and know that our
program’s logic would not change
So what?
When designing programs or logic gates (chips) we can use De Morgan’s laws to save some logic gates, and to make our logic operations simpler
Using only NAND and NOR gates and with the aid of De Morgan’s laws, draw
circuits for:
i) Q = A + B
ii) Q = A . B
A rule to remember:
Borrowed from http://www.csus.edu/indiv/p/pangj/class/cpe64/ademo/L1_Demo_Demorgan.pdf - It’s probably worth you grabbing that as it’s another person’s take on this lesson
Other Boolean laws to remember (0 = False, 1 = True)
1. X AND 0 = 0 2. X AND 1 = X 3. X AND X = X 4. X AND (NOT X) = 0 5. X OR 0 = X 6. X OR 1 = 1 7. X OR X = X 8. X OR (NOT X) = 1 9. NOT (NOT X) = X
Commutative Law: X+Y = Y+X X.Y = Y.X
(the order of AND or OR operations doesn’t matter)
Associative Law: X.(Y.Z) = (X.Y).Z
X+(Y+Z) = (X+Y)+Z (the order of AND or OR operations for several variables doesn’t matter)
Distributive Law:
X.(Y+Z) = (X.Y) + (X.Z)
(X + Y) . (W + Z) = X.W + X.Z + Y.W + Y.Z
Want some more confusion?
A.B
Is the same as
AB And as geeks are lazy the . often goes walkies but you need to remember that AB is A AND B
AB + A + B BREAK THE LINE, CHANGE THE SIGN reversed is
JOIN THE LINE CHANGE THE SIGN
= AB + A . B
= AB + AB
=1 (i.e. it’s always true!)
Simplify
A + B + (A + B)
= A.B + (A + B) (lhs join line / flip sign)
= (A.B).(A+B) (swap sign / join line)
=(A.B.A)+(A.B.B) (distributive a(b+c)=ab+ac)
=A.B + A.B (basic rules a and a = a)
= A.B (basic rules a or a = a )
(= AB (or A NAND B))
Other ways you may see online when you Google to see what on earth was
being talked about today
NOT A is also A’ and also ¬A and also ~A and known as the complement of A
A OR B is also A \/ B and also A | B and known as A union B
A AND B is and also A /\ B and also A & B
The nice thing about standards is that there are so many to choose from – Andrew Tannenbaum
links
http://www.electrical4u.com/boolean-algebra-theorems-and-laws-of-boolean-algebra/
http://www.csus.edu/indiv/p/pangj/class/cpe64/ademo/L1_Demo_Demorgan.pdf
And use Wolfram Alpha to evaluate any Boolean expressions and check your simplification