Lect 2 Boolean Algebra and Logic Gates
Lect 2 Boolean Algebra and Logic Gates
1
October 30, 2022 NAGIA ALI
Algebras
• What is an algebra?
• Mathematical system consisting of
• Set of elements
• Set of operators
• Axioms or postulates
• Why is it important?
• Defines rules of “calculations”
• Example: arithmetic on natural numbers
• Set of elements: N = {1,2,3,4,…}
• Operator: +, –, *
• Axioms: associativity, distributivity, closure, identity elements, etc.
• Note: operators with two inputs are called binary
• Does not mean they are restricted to binary numbers!
• Operator(s) with one input are called unary
1.Closure: a set S is closed with respect to a binary operator if, for every pair of
elements of S, the binary operator specifies a rule for obtaining a unique
element of S.
• For example, natural numbers N={1,2,3,...} is closed w.r.t. the binary operator
+ by the rule of arithmetic addition, since, for any a, bN, there is a unique
cN such that
• a+b = c
• But operator – is not closed for N, because 2-3 = -1 and 2, 3N, but (-
1)N.
• Terminology:
• Literal: A variable or its complement
• Product term: literals connected by •
• Sum term: literals connected by +
AND OR NOT
x y x.y x y x+y x x'
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1
1.Closure (+ and‧)
2.The identity elements
(1) +: 0
(2) . : 1
y+ x. x. (x . y)+
x y z x.z
z (y+z) y (x . z)
0 0 0 0 0 0 0 0
0 0 1 1 0 0 0 0
0 1 0 1 0 0 0 0
0 1 1 1 0 0 0 0
1 0 0 0 0 0 0 0
1 0 1 1 1 0 1 1
1 1 0 1 1 1 0 1
1 1 1 1 1 1 1 1
October 30, 2022 NAGIA ALI 10
Postulates of Two-Valued Boolean
Algebra
5. Complement
• x+x'=1 → 0+0'=0+1=1; 1+1'=1+0=1
• x . x'=0 → 0 . 0'=0 . 1=0; 1 . 1'=1 . 0=0
6. Has two distinct elements 1 and 0, with 0 ≠ 1
• Note
• A set of two elements
• + : OR operation; . : AND operation
• A complement operator: NOT operation
• Binary logic is a two-valued Boolean algebra
x y xy x+x
y
0 0 0 0
0 1 0 0
1 0 0 1
1 1 1 1
October 30, 2022 NAGIA ALI
18
DeMorgan’s Theorem
• Theorem 5(a): (x + y)’ = x’y’
• Theorem 5(b): (xy)’ = x’ + y’
• By means of truth table
1. xy + x’z + yz = xy + x’z
2. (x+y)•(x’+z)•(y+z) = (x+y)•(x’+z) -- (dual)
• Proof:
xy + x’z + yz = xy + x’z + (x+x’)yz
= xy + x’z + xyz + x’yz
= (xy + xyz) + (x’z + x’zy)
= xy + x’z
QED (2 true by duality).
F2 = x + y'z
F4 = x y' + x' z
• All the new symbols except for the exclusive-OR symbol are not in
common use by digital designers.