Lecture 2-1 Boolean Algebra (I)
Lecture 2-1 Boolean Algebra (I)
Kyeongha Kwon
School of EE, KAIST
Review
Digital Systems
Number Systems
− Decimal numbers, Binary numbers,… Base-r numbers
− Number-base conversions
Digital Logics
− Logical operation: AND, OR, NOT
3
Review: Logical Operation
Symbols
2-input AND gate 2-input OR gate NOT gate
(inverter)
Truth tables
z = 1 only if x = y = 1 z = 0 only if x = y = 0; z = 0 if x = 1;
otherwise z = 0 otherwise z = 1 z = 1 if x = 0 4
Boolean Algebra
In 1854, George Boole introduced Boolean Algebra, defined with
A set of element (S)
− Used to represent proposition (true or false) or digital signals (high or low)
Binary operators: + (OR) and ∙ (AND)
− Used to assign each pair of elements from S to an element from S
− For example, a + b = c for a, b, c ∈ S
5
Huntington’s Postulates (I)
1. Closure with respect to the operators:
− any logical operation yields a value in the set {0,1}
2. Distinct elements : 0 ≠ 1
3. Identity element with respect to the operators:
− x+0=x x∙1=x
4. Commutative law
− x+y=y+x x∙y=y∙x
5. Distributive law
− x ∙ (y + z) = (x ∙ y) + (x ∙ z) x + (y ∙ z) = (x + y) ∙ (x + z)
6
Huntington’s Postulates (II)
1. Closure with respect to the operators:
− The results of OR and AND must be in the same set, which has the input of the operations
− Any logical operation yields a value in the set {0,1}
2. Distinct elements
− Boolean algebra is a set with at least two, distinct elements 0 and 1.
− There exist at least two elements 0, 1 ∈ S such that 0 ≠ 1.
7
Huntington’s Postulates (III)
3. Identity element with respect to the operators:
− Identify element is an element (e) such that when a binary operation (*) is performed
on it (e) and any other given element (x), the result is the given element (x)
: “x * e = x” for every x in S
− For OR (+), 0 is an identity element: x + 0 = x
− For AND (∙), 1 is an identity element: x ∙ 1 = x
9
Does a Boolean Algebra satisfy Huntington’s Postulates?
1. Closure with respect to +, ∙:
− Yes, both operations produce 0 or 1 for all input combinations.
2. Distinct elements
− Yes, by definition: 0 ≠ 1.
5. Distributive law
− Yes (proof to follow).
6. Complement
− Yes, 0' = 1, 1' = 0. 10
Duality Principle
Let’s review Huntington’s postulates.
− Identity element: a + 0 = a ↔ a ∙ 1 = a
− Commutative property: a + b = b + a ↔ a ∙ b = b ∙ a
− Distributive property: a ∙ (b + c) = (a ∙ b) + (a ∙ c) ↔ a + (b ∙ c) = (a + b) ∙ (a + c)
− Complement: a + a’ = 1 ↔ a ∙ a’ = 0
Dual expression
− The expression one obtains by interchanging AND and OR, and interchanging 0's and 1's
Duality principle
− If a binary expression is valid, its dual expression is also valid.
11
Some Simple Theorems
Theorem 1: a + a = a (Dual: a ∙ a = a)
− Proof: a + a = (a + a) ∙ 1 Identity element
= (a + a) ∙ (a + a’) Complement
= a + a ∙ a’ Distributive property
=a+0 Complement
=a Identity element
Theorem 2: a + 1 = 1 (Dual: a ∙ 0 = 0)
− Proof: a + 1 = 1 ∙ (a + 1) Identity element
= (a + a’) (a + 1) Complement
= a + a’ ∙ 1 Distributive property + Theorem 1
= a + a’ Complement
=1 Identity element
12
Involution and Absorption Theorems
Involution theorem: (a’)’ = a
− Recall the complement postulate:
• a + a’ = 1, a ∙ a’ = 0
• a’ = complement of a, a = complement of a’
− Applying double inverse on a value will give the initial value: (a’)’=a
14
Venn Diagram
Visualizing logic relations
15
DeMorgan’s Theorem: Ex1
Find the complement of a + b’c’
− Let x = b’c’, the original expression becomes a + x.
− Then, the complement of a+x = (a + x)’
= a’ x’ DeMorgan’s theorem
= a’ (b’c’)’
= a’ (b + c) DeMorgan’s theorem
= a’b + a’c
16
DeMorgan’s Theorem: Ex2
Simplify (a(b + c(b + a)))’
− Solution: (a(b + c(b + a)))’ = a’ + (b + c(b + a))’ DeMorgan’s theorem
= a’ + b’(c(b + a))’ DeMorgan’s theorem
17
Boolean Functions
Described by an Boolean-algebra expression
− Consists of binary variables (x, y, z..), constants (0 or 1), and logic operation symbols (+, ∙).
− Results in binary 0 or 1 for given value of binary variables
− e.g. F1 = x + y’z
18
Boolean Functions
Why Boolean algebra?
− The Boolean expression decides the interconnection of gates in the logic circuit.
− There can be many different expressions that have essentially the same truth table.
− Simplifying the expression using Boolean algebra = Reducing the cost of a logic circuit!
2 inverters
2 AND gates
1 OR gate
Boolean Easy
Circuit
Expression
Easy Difficult
Truth
Table
21
Terms and Literals
In a Boolean function
− Each term requires a gate
− Each variable within the term designates an input to the gate (a literal)
= x’z(y’ + y) + xy’
= x’z + xy’ 2 terms and 4 literals
23
Minterms
For 3 variables, which have 23 minterms
− Binary numbers from 0 to 23-1
− A symbol for each minterm, mj
• The subscript j denotes the decimal equivalent of the binary number of the minterm designated.
Prime for 0
Itself for 1
24
Maxterms
Maxterms: OR terms or standard sums (2n combinations)
− Each maxterm is obtained from an OR term of the n variables,
• With each variable being primed if the corresponding bit of the binary number is a 1 (not 0).
A truth table
x y z F Boolean Expressions can be represented
0 0 0 0 in Sum-of-Products form!
0 0 1 0 - Each row with output of 1 becomes a product term (minterm)
0 1 0 0 Minterms (prime for 0) - Sum all those minterms (maxterm of minterms)
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1
F = xyz + xyz’ + x’yz 26
Converting to Circuit
x’ → Inverter (of x)
Minterm (or product) → AND
Maxterm (or sum) → OR
x y z F xyz
0 0 0 0
0 0 1 0
0 1 0 0 Minterms xyz’
0 1 1 1
1 0 0 0 x’yz
1 0 1 0
1 1 0 1
1 1 1 1
F = xyz + xyz’ + x’yz 27
Reducing Boolean Expressions
Let’s simplify F = xyz + xyz’ + x’yz
− Step 1: Use Theorem 1 (a + a = a)
F = xyz + xyz + xyz’ + x’yz
− Step 2: Use distributive property, a(b + c) = ab + ac
F = xy(z + z’) + yz(x + x’)
− Step 3: Use complement postulate (a + a’ = 1)
F = xy·1 + yz·1
− Step 4: Use identity postulate (a · 1 = a)
F = xy + yz
28
Optimized Hardware Implementation
Simplified equation
Simplified hardware = Less gates, less inputs.
x y z F xy
0 0 0 0
0 0 1 0
0 1 0 0 Minterms
0 1 1 1
1 0 0 0
1 0 1 0 yz
1 1 0 1
1 1 1 1
F = xyz + xyz’ + x’yz = xy + yz 29
Summary
Boolean algebra
− Huntington’s postulates, Duality principle, DeMorgan’s theorem…
Boolean functions
− Simplifying the expression using Boolean algebra
= Reducing the cost of a logic circuit
Representation Conversion
− between truth table, circuit, and Boolean expression that are equivalent
− Minterms and maxterms
30