Professional Documents
Culture Documents
Week 2 - Boolean Algebra
Week 2 - Boolean Algebra
1
Boolean Algebra
• Boolean Algebra:
– algebra over 2 elements: {0,1}
– 3 operators: AND (), OR (), NOT ()
• AND Operation: a b a&b a|b
– a b = 1 iff a=1 and b=1 0 0 0 0
• OR Operation: 0 1 0 1
– a b = 1 if a=1 or b=1 1 0 0 1
1 1 1 1
• NOT Operation:
– a = 1 iff a=0
a ~a
0 1
2
Axioms of Boolean Algebra
3
Boolean Algebra - Theorems
4
Useful Boolean Properties
(all can be derived from the axioms)
Associative x (y z) = (x y) z x (y z) = (x y) z
Distributive x (y z) = (x y) (x z) x (y z) = (x y) (x z)
5
Useful Boolean Properties
(all can be derived from the axioms)
Absorption x (x y) = x x (x y) = x
6
DeMorgan’s Law
• (x y) = x y (x y) = x y
x y (x y) x y
0 0 1 1
0 1 1 1
1 0 1 1
1 1 0 0
7
DeMorgan Graphically
8
Applying Boolean Properties
f(a,b,c) = (a c) (a b c)
(a b c) (a b c)
(a b c) (a b c) Apply Absorption Property
f(a,b,c) = (a c)
(a b c) (a b c)
(a b c) (a b c) Apply Combining Property
f(a,b,c) = (a c) (b c) (a b)
9
Boolean Algebra – Dual function
10
Dual Functions
11
Example: Finding the dual of a function
f(x, y) = (1 x) (0 y)
12
Summary
13
Boolean Algebra – Normal forms
14
Normal Form
f(a, b, c) = (a c) (b c) (a b)
f(a, b, c) =
Shannon expansion
15
Example
f(a, b, c) = a (b c)
16
Boolean Algebra – Logic diagram
17
From Equations to Gates
18
Exclusive-or function
19
NAND and NOR gates
20
From Gates to Equations
21
Example: From equation to schematic
Draw the schematic for a three-input majority function that only uses
NAND gates:
22
Boolean Algebra – Verilog expression
23
Boolean Expressions in Verilog
24
Summary
• Normal forms
• Logic diagram
• Verilog using assign statement
26