Boolean Algebra and Logic Gates

Boolean Algebra and Logic Gates
Boolean Algebra
Boolean Algebra
- Introduced by George Boole in 1854 to solve logic problems
with binary decision variables
- Applied to the design of relay circuits by C. E. Shannon in
1938
- Boolean algebra is also known as switching algebra
- Obeys most rules of ordinary algebra
Formal Definition of Boolean Algebra
Formal Definition of Boolean Algebra
- A Boolean algebra satisfies the following postulates defined
by E. V. Huntington in 1904:
1. Closure
a) Closure with respect to the operator + (Addition Operator . OR)
b) Closure with respect to the operator · (Multiplication Operator . AND)
2. Identity elements
a) An identity element with respect to +, designated by 0: x + 0 = 0 + x = x
b) An identity element with respect to ·, designated by 1: x · 1 = 1 · x = x
3. Commutation
a) Commutative with respect to +: x + y = y + x
b) Commutative with respect to ·: x · y = y · x
Formal Definition of Boolean Algebra
Formal Definition of Boolean Algebra
4. Distribution
a) · is distributive over +: x · (y + z) = (x · y) + (x · z)
b) + is distributive over ·: x + (y · z) = (x + y) · (x + z)
5. Complement
For every element x ∈ B, there exists an element x´ ∈ B (called the complement of
x) such that (a) x + x´ = 1 and (b) x · x´ = 0
6. Two elements
There exists at least two elements x, y ∈ B such that x y
Two
Two
-
-
Valued Boolean Algebra
Valued Boolean Algebra
1. Closure x · y ∈ B, if x ∈ B and y ∈ B
x + y ∈ B, if x ∈ B and y ∈ B
2. Identity elements 0 + x = x , if x ∈ B
1 · x = x, if x ∈ B
3. Commutation x + y = y + x, if x ∈ B and y ∈ B
x · y = y · x, if x ∈ B and y ∈ B
4. Distribution x · (y + z) = (x · y) + (x · z), if x, y, and z ∈ B
x + (y · z) = (x + y) · (x + z), if x, y, and z ∈ B
5. Complement x + x´ = 1, if x ∈ B
x · x´ = 0, if x ∈ B
6. Two elements B = {0,1}
Differences with Ordinary Algebra
Differences with Ordinary Algebra
1. Associative law
2. Distributive law of + over · only applies for Boolean algebra
3 + (2 · 5) (3 + 2) · (3 + 5) in ordinary algebra
1 + (1 · 0) = (1 + 1) · (1 + 0) in Boolean algebra
3. Boolean algebra does not have additive or multiplicative
inverses; therefore, there are no subtraction or division
operations
4. Complement only exists in Boolean algebra
5. Boolean algebra applies to a finite set of elements
Theorems of Two Theorems of Two- -Valued Boolean Algebra Valued Boolean Algebra
Theorem 1(a): x + x = x
Theorem 1(b): x · x = x
Theorem 2(a): x + 1 = 1
Theorem 2(b): x · 0 = 0
Theorem 3: (x´)´ = x
.continued
Theorems of Two Theorems of Two- -Valued Boolean Algebra Valued Boolean Algebra
Theorem 4(a): x + (y + z) = (x + y) + z
Theorem 4(b): x · (y · z) = (x · y) · z
Theorem 5(a): (x + y)´ = x´ · y´
Theorem 5(b): (x · y)´ = x´ + y´
Theorem 6(a): x + xy = x
Theorem 6(b): x(x + y) = x
Duality
Duality
- To determine the dual of an algebraic expression, simply
interchange OR and AND operators and replace 1´s by 0´s and
0´s by 1´s
- Duality is used to derive Theorem 2(b) and Theorem 6(b)
- Duality is an extremely powerful concept, particularly when
proving complex theorems involving constants
- Example:
f = xyz + x´y
dual of f = (x + y + z)(x´ + y)
DeMorgan's
DeMorgan's
Theorem
Theorem
- Theorems 5(a) and 5(b) are commonly referred to as
DeMorgan´s Theorem
- Proof of DeMorgan´s Theorem is too long to produce on a slide
- However, it is possible to show that it works using truth
tables as follows:
0 0 1 1
0 0 0 1
0 0 1 0
1 1 0 0
' · ' ( + )'
Digital Logic Gates
Digital Logic Gates
Buffer Inverter
AND
NAND
f = x · y
f = x
f = x´
f = (x · y)´
f x f x
x
y
f
y
f
x
Digital Logic Gates
Digital Logic Gates
OR NOR
XOR
XNOR
f = (x + y)´
f = (x ⊕ y)´ f = x ⊕ y
f = x + y
x
y
f
x
y
f f
x
y
f
x
y
Digital Logic Gate Truth Tables
Digital Logic Gate Truth Tables
1 0 0 1 0 1 0 1 1 1
0 1 0 1 1 0 0 1 0 1
0 1 0 1 1 0 1 0 1 0
1 0 1 0 1 0 1 0 0 0
XNOR XOR NOR OR NAND AND Inverter Buffer
NOTE:
For the buffer and the inverter, only the input x is
relevant. Thus, the results have been duplicated.
Implementing Boolean Functions with Digital Implementing Boolean Functions with Digital
Logic Gates Logic Gates
- Given a Boolean function f of 1 or more input variables, it is
possible to draw an equivalent logic gate implementation for f
Example: f = x´y + xz
x
z
y
f
Implementing Boolean Functions with Digital Implementing Boolean Functions with Digital
Logic Gates Logic Gates
- It should be noted that the functions f
1
= x´y and f
2
= xz are
both found within the digital logic gate implementation of
function f
Recall: f = x´y + xz = f
1
+ f
2
NOTE:
f
1
and f
2
are examples
of intermediate nodes.
x
z
y
f
f
1
f
2
Truth Tables for Boolean Functions
Truth Tables for Boolean Functions
- Similarly, it is possible to construct a
truth table for the function f
Example: f = x´y + xz
1 1 1 1
0 0 1 1
1 1 0 1
0 0 0 1
1 1 1 0
1 0 1 0
0 1 0 0
0 0 0 0

x
z
y
f

!! "# \$ % & ' .

7 + 1 7 1 7 % ! . -+ . . \$ + * -.7 1+ 1 7 1 . -6 16 *+ ."() !! ! . . 0 / 3 . 4 5! . 1 .2 ' ' /' .* 7 * . .

1 . 7 . 7 . 1 . 1 . . 1 : 7* :∈ . 1+ . 1 . .:7 9 .. . .. . ! 8 . ... -+ 1 . .. . ∈ 6 .!4 . 1 . !< < 9 6 ∈ .

..1 ! *1 " 1 # ∈ ∈ 7 7 7 7 6 6 ∈ ∈ ∈ ∈ ∈ ∈ 6 6 6 6 ∈ ∈ ∈ ∈ ∈ ∈ ∈ ∈ 1 1 . 7 . 7 . .6 \$ % . ..6 .. 1 .. . 1 . 1 . 1 .:7 6 1 : 7 *6 & 7= > *6 . .

1 .%. 7 .'( ! 5!4 %. .. ...%. 1 . % ! ? 6 ! ! 9 .5 1 .*. 1 *. ! - 1 . ..5.

+ .+ 5.' < < . :. .+ 1 7 7 < < 5.+ - 7 1 * 7* < % + .: 7 . . . .

+ .. 1 . .: 7 : 1 : . 1 < < . 1 . . .+ . .+ . . .: < < . 1 . .+ .. 7..+ . .+ . ..7 .. 1 . 7.' < < . . - 7 . .: 7 : .

! < ' 0 *: 4 4 9 9 + . : < 5. .: 7. . 3 4 9 6 : *: " 9 7 . . . : ... 6 < ..

* * * * *+ * * * * . . . * * * * . : < 42 6 + . * ' : < & .) < 42 @ ) ..

Buffer f=x Inverter 7 AND 7 1 NAND 7. 1 .

OR 7 - NOR 7. - / (0 7 ⊕ / 1(0 7. ⊕ .

' 2 1 1 1 (0 1(0 / (0 / 1(0 * * * * * * * * 1( 3 4 8 !< 6 * * * * * * * * * * * * 6 ! .

% ' 6 A " 9 + 7 : - .

5 .% 7 : ' 7 5 NOTE: 0 + 7 : - 5 f1 and f2 are examples of intermediate nodes.

' # 6 * * * * * * " 9 + 7 : - * * * * * * * * * * .