Chapter2 Boolean Algebra and Logic Gates PDF
Chapter2 Boolean Algebra and Logic Gates PDF
Chapter2 Boolean Algebra and Logic Gates PDF
OUTLINE OF CHAPTER 1
BASIC DEFINITIONS
• 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”
BASIC DEFINITIONS
• Example: arithmetic on natural numbers
– Set of elements: N = {1,2,3,4,…}
– Operator: +, –, *
– Axioms: associativity, distributivity, closure, identity elements, etc.
BASIC DEFINITION
• A set is collection of having the same property.
– S : set, x and y : element or event
• If y = 5, then y ∉S.
BASIC DEFINITIONS
• A binary operator defines on a set S of elements is a rule that assigns, to
each pair of elements from S, a unique element from S.
– For example: given a set S, consider x*y = z.
• * is a binary operator.
BASIC DEFINITION
The most common postulates used to formulate various algebraic structures are as
1. Closure. A set S is closed with respect to a binary operator if,
follows:
• For every pair of elements of S, the binary operator specifies a rule for
obtaining a unique element of S.
• x+y=z
• But operator – is not closed for N, because 2-3 = -1 and 2, 3∈N, but
• (-1)∉N.
BASIC DEFINITIONS
2. Associative law. A binary operator * on a set S is said to be associative
whenever
BASIC DEFINITIONS
4. Identity element. A set S is said to have an identity element with
respect to a binary operation * on S if there exists an element e∈S with
the property that
– e * x = x * e = x for every x∈S
• 0 + x = x + 0 = x for every x∈I. I = {…, -3, -2, -1, 0, 1, 2, 3, …}.
BASIC DEFINITION
5. Inverse. A set S is having the identity element e with respect to the
binary operator to have an inverse whenever, for every x∈S, there
exists an element y∈S such that
– x*y=e
• In the set of integers, I, the operator + over I with e = 0, the inverse of an
element x is (-x) since x+(-x) = 0.
BASIC DEFINITION
6. Distributive law. If * and .are two binary operators on a set S, * is
said to be distributive over . whenever
– x * (y.z) = (x * y).(x * z)
BASIC DEFINITION
• The field of real numbers is the basis for arithmetic and ordinary
algebra. The operators and postulates have the following meanings:
– The binary operator + defines addition.
– The additive identity is 0.
– The additive inverse defines subtraction.
– The binary operator .defines multiplication.
– The multiplicative identity is 1.
– The multiplicative inverse of x = 1/x defines division, i.e., x .1/x = 1.
– The only distributive law applicable is that of . over +:
• x .(y+z) = (x . y) + (x . z)
• Terminology:
X Y X Y X+Y X
0 0 0 0 0 0 1 0
0 1 0 0 1 1 0 1
1 0 0 1 0 1
1 1 1 1 1 1
28 July, 2018 INTRODUCTION TO LOGIC DESIGN
18
• Note
– A set of two elements
– + : OR operation; .: AND operation
– A complement operator: NOT operation
– Binary logic is a two-valued Boolean algebra
BOOLEAN ALGEBRA
• Duality Principle says that:
– if an expression is valid in Boolean algebra, then
BOOLEAN ALGEBRA
• Form the dual of the expression
x + (yz) = (x + y)(x + z)
• Take care not to alter the location of the parentheses if they are present.
BOOLEAN ALGEBRA
Postulates and Theorems of Boolean Algebra
Postulate 2, identity (a) x + 0 = x (b) x · 1 = x
Postulate 5, complementarity (a) x + x’ = 1 (b) x · x’ = 0
Theorem 1, idempotent (a) x + x = x (b) x · x = x
Theorem 2, involution (a) x + 1 = 1 (b) x · 0 = 0
Theorem 3, involution (x’)’ = x
Postulate 3, commutative (a) x + y = y + x (b) xy = yx
Theorem 4, associative (a) x + (y + z) = (x + y) + z (b) x(yz) = (xy)z
Postulate 4, distributive (a) x (y + z) = xy + xz (b) x + yz = (x + y) (x + z)
Theorem 5, DeMorgan (a) (x + y)’ = x’ y’ (b) (xy)’ = x’ + y’
Theorem 6, absorption (a) x + xy = x (b) x(x+y) = x
BOOLEAN ALGEBRA
• Need more rules to modify algebraic expressions
– Theorems that are derived from postulates
• What is a theorem?
– A formula or statement that is derived from postulates (or other proven
theorems)
BOOLEAN ALGEBRA
• Theorem 1 (a) show that x+x = x. • Post. 2: (a) x+0=x, (b) x·1=x
• x+x = (x+x) ·1 by 2(b) • Post. 3: (a) x+y=y+x, (b) x·y=y·x
=x by 2(a)
BOOLEAN ALGEBRA
• Theorem 1 (b) show that x·x = x. • Post. 2: (a) x+0=x, (b) x·1=x
• x·x = xx+0 by 2(a) • Post. 3: (a) x+y=y+x, (b) x·y=y·x
BOOLEAN ALGEBRA
• Theorem 2 (a) show that x+1 = 1. • Post. 2: (a) x+0=x, (b) x·1=x
• x + 1 = 1.(x + 1) by 2(b) • Post. 3: (a) x+y=y+x, (b) x·y=y·x
BOOLEAN ALGEBRA
• Theorem 2(b): x.0 = 0 by duality • Post. 2: (a) x+0=x, (b) x·1=x
• Theorem 3: (x')' = x • Post. 3: (a) x+y=y+x, (b) x·y=y·x
– Postulate 5 defines the • Post. 4: (a) x(y+z) = xy+xz,
complement of x, (b) x+yz = (x+y)(x+z)
▪ x + x' = 1
• Post. 5: (a) x+x’=1, (b) x·x’=0
▪ x . x' = 0
• Th. 1: (a) x+x=x, (b) x.x=x
– The complement of x' is x is also
(x')' • Th. 2: (a) x+1=1
BOOLEAN ALGEBRA
• Absorption Property (Covering) • Post. 2: (a) x+0=x, (b) x·1=x
Theorem 6(a): x + xy = x
• Post. 3: (a) x+y=y+x, (b) x·y=y·x
• x + xy = x.1 + xy by 2(b)
• Post. 4: x(a) x(y+z) = xy+xz,
= x (1 + y) by 4(a) y xy x+xy
0 1 0 0
= x.1 by Th. 2(a) • Post. 5: (a) x+x’=1, (b) x·x’=0
1 0 0 1
=x by 2(b)
• Th. 1: (a) x+x=x,
1 1 (b)1 x·x=x1
• Theorem 6(b): x (x + y) = x by duality
• Th. 2: (a) x+1=1, (b) x·0=0
• By means of truth table (another
way to proof )
BOOLEAN ALGEBRA
• DeMorgan’s Theorem
• Theorem 5(a): (x + y)’ = x’y’
• Theorem 5(b): (xy)’ = x’ + y’
By means of truth table
BOOLEAN ALGEBRA
Consensus Theorem
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
BOOLEAN ALGEBRA
• The operator precedence for evaluating Boolean Expression is
– Parentheses
– NOT
– AND
– OR
• Examples
– x y' + z
– (x y + z)'
BOOLEAN FUNCTIONS
• A Boolean function consists of:
– Binary variables
– Binary operators OR and AND
– Unary operator NOT
– Parentheses
– The constants 0 and 1
• Examples
– F1= x y z'
– F2 = x + y'z
– F3 = x' y' z + x' y z + x y'
– F4 = x y' + x' z
BOOLEAN FUNCTIONS
• For a given value of the binary variables, the function can be equal to
either 1 or 0.
• Consider as an example the following Boolean function:
– F1 = x + y’ z
– F1 = 0 otherwise.
BOOLEAN FUNCTIONS
• A Boolean function expresses the logical relationship between binary
variables.
• It is evaluated by determining the binary value of the expression for all
possible values of the variables.
• A Boolean function can be represented in a truth table.
BOOLEAN FUNCTIONS
• The truth table of 2n entries
• F1= x y z‘, F2 = x + y'z, F3 = x' y' z + x' y z + x y‘, F4 = x y' + x' z
• Two Boolean expressions may specify the same function F3 = F4
x y z x’ y’ z’ y’z x’y’z x’yz xy’ x’z F1 F2 F3 F4
0 0 0 1 1 1 0 0 0 0 0 0 0 0 0
0 0 1 1 1 0 1 1 0 0 1 0 1 1 1
0 1 0 1 0 1 0 0 0 0 0 0 0 0 0
0 1 1 1 0 0 0 0 1 0 1 0 0 1 1
1 0 0 0 1 1 0 0 0 1 0 0 1 1 1
1 0 1 0 1 0 1 0 0 1 0 0 1 1 1
1 1 0 0 0 1 0 0 0 0 0 1 1 0 0
1 1 1 0 0 0 0 0 0 0 0 0 1 0 0
BOOLEAN FUNCTION
• Implementation with logic gates
• F4 is more economical
BOOLEAN FUNCTION
Algebraic Manipulation
BOOLEAN FUNCTION
• Example:
– F1= x y z‘ 1 term and 3 literals
– F2 = x + y'z 2 terms and 3 literals
– F3 = x' y' z + x' y z + x y‘ 3 terms and 8 literals
– F4 = x y' + x' z 2 terms and 4 literals
• Manipulation of Boolean algebra consists mostly of reducing an
expression by reducing the number of terms, the number of
literals, or both in a Boolean expression, it is often possible to
obtain a simpler, less area, cheaper circuit.
BOOLEAN FUNCTION
Simplify the following functions to a minimum number of
• x(x’+y)
literals. • (x + y) (x + y’)
I. = (x x’) + (x y) by post (4a) I. = x + y y’ post (4b)
II. =0+xy by post (5b) II. =x+0 post (5b)
III. =xy by post (2a) III. =x post (2a)
• x+x’y • (x + y) (x’ + z) (y + z) = (x + y) (x’ + z)
I. = (x + x’) (x + y) by post (4b) – consesus theorem with duality.
II. = 1 (x + y) by post (5a)
III. =x+y by post (2b)
BOOLEAN FUNCTION
Simplify the following functions to a minimum number of
• x y + x’ z + y z
literals.
I. = x y + x’ z + 1 y z
II. = x y + x’ z + (x + x’) y z post (5a)
III. = x y + x’ z + x y z + x’ y z post (4a)
IV. = x y + x y z + x’ z + x’ y z post (3a)
V. = x y (1 + z) + x’z (1 + y) post (4a)
VI. = x y 1 + x’ z 1 Theo(2a)
VII. = x y + x’ z post (2b)
BOOLEAN FUNCTION
• The complement of a function F is F’ and is obtained from
– An interchange of 0’s for 1’s and 1’s for 0’s in the value of F.
BOOLEAN FUNCTION
• (A + B + C)’ = (A + x)’ let B + C = x
= A’ x’ by theorem (5a) De Morgan
BOOLEAN FUNCTION
• Generalizations:
– Function is obtained by interchanging AND and OR operators and
complementing each literal.
• (A+B+C+D+ ... +F)' = A'B'C'D'... F'
BOOLEAN FUNCTION
Find the complement of the function F1 by applying De Morgan’s theorem as
many times as necessary
• F1’ = (x‘ y z' + x‘ y‘ z)' . • F2’ = x (y’ z' + y z).
• = (x’ y z’)’ (x’ y’ z)’ • = [x(y’ z’ + y z)]’
BOOLEAN FUNCTION
• Simpler procedure:
– Take the dual of the function and complement each literal
BOOLEAN FUNCTION
• Find the complement of the function F2
– F2 = x (y’ z' + y z).
– = x (y’ z’) + (y z)
– The dual of F2 = x + (y’ + z’) (y + z)
– Complement each literal = x’ + (y + z) (y’ + z’) = F2'
– Sum of minterms
– Each of these minterms results in f1 = 1.
f1 = = m1 + m4 +m7 (Minterms)
f2 = = m3 + m5 +m6 + m7 (Minterms)
– = 1 (x’ + y) (x + z) (y + z)
– = (x’ + y) (x + z) (y + z)
– (x + z) = x + z + y y’ = (x + y + z) (x + y’ +z)
– (y + z) = y + z + x x’ = (x + y + z) (x’ + y + z)
• Combine all the terms and remove the ones that appear twice
F1 = x y AND x and y
F3 = x Transfer x’
F5 = y Transfer y
F7 = x + y x+y OR x or y
AND F=xy 0 1 0
1 0 0
1 1 1
x y F
0 0 0
OR F=x+y 0 1 1
1 0 1
1 1 1
x y
INVERTER F=x’ 0 1
1 0
BUFFER F=x 0 0
1 1
x y F
0 0 1
NAND F = (x y) ’ 0 1 1
1 0 1
1 1 0
x y F
0 0 1
NOR F = ( x + y) ‘ 0 1 0
1 0 0
1 1 0
XOR F=x⊕y 0 1 1
1 0 1
1 1 0
x y F
0 0 1
XNOR F=(x⊕y)‘ 0 1 0
1 0 0
1 1 1
– (x ↓ y) ↓z ≠ x (y ↓ z)
• (x ↓ y) ↓ z = [ (x + y)’ + z]’
= (x + y) z’ = x z’ + y z’
• x (y ↓ z) = [ x + (y + z)‘ ]’
= x‘ (y + z) = x’ y + x’ z
• To overcome this;
– Define the multiple NOR (or NAND) gate as complemented OR (or AND) gate.
• x ↓ y ↓ z = (x + y + z) ’
• x ↑ y ↑ z = (x y z) ’
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
• The higher signal level is designated by H and the lower signal level by L.
L L L
L H L
H L L
H H H
(a) Truth table with H and L (b) Gate block diagram
x y x
0 0 0
0 1 0
1 0 0
1 1 1
(c) Truth table for positive logic (d) Positive logic AND gate
INTEGRATED CIRCUITS
Level of Integration
• An IC (a chip)
• Examples:
– Small-scale Integration (SSI): < 10 gates
INTEGRATED CIRCUITS
• VLSI
– Small size (compact size)
– Low cost
– Low power consumption
– High reliability
– High speed
INTEGRATED CIRCUITS
• Digital logic families: circuit technology
– TTL: transistor-transistor logic (dying?)
INTEGRATED CIRCUITS
• The characteristics of digital logic families
– Fan-out: the number of standard loads that the output of a typical
gate can drive.
– Power dissipation.
– Propagation delay: the average transition delay time for the signal to
propagate from input to output.
– Noise margin: the minimum of external noise voltage that caused an
undesirable change in the circuit output.
INTEGRATED CIRCUITS
• CAD – Computer-Aided Design
– Millions of transistors
– Computer-based representation and aid
– Automatic the design process
– Design entry
• Schematic capture
• HDL – Hardware Description Language
– Verilog, VHDL
– Simulation
– Physical realization
• ASIC, FPGA, PLD
INTEGRATED CIRCUITS
• Why is it better to have more gates on a single chip?
– Easier to build systems
– Lower power consumption
– Higher clock frequencies
INTEGRATED CIRCUITS
• Need tools to help develop integrated circuits
– Computer Aided Design (CAD) tools