0% found this document useful (0 votes)
6 views71 pages

discrete module 1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 71

Discrete Mathematics and Grap

Theory

By
Neelam Patidar
SASL – Mathematics
VIT , Bhopal University.
Properties of Relations
1.Reflexive
2.Symmetric and Antisymmetric
Lattice
Lattices – A Poset in which every pair of elements has both, a least upper
bound and a greatest
lower bound is called a lattice.
There are two binary operations defined for lattices –

1.Join – The join of two elements is their least upper bound. It is denoted by
, not to be confused with disjunction.
2.Meet – The meet of two elements is their greatest lower bound. It is denoted
by , not to be confused with conjunction.
 Least Upper Bound (SUPREMUM):
 Let A be a subset of a partially ordered set S. An element M in S is
called an upper bound of A if M succeeds every element of A, i.e. if,
for every x in A, we have x <=M
 If an upper bound of A precedes every other upper bound of A, then it
is called the supremum of A and is denoted by Sup (A)
 Greatest Lower Bound (INFIMUM):
 An element m in a poset S is called a lower bound of a subset A of S if
m precedes every element of A, i.e. if, for every y in A, we have m
<=y
 If a lower bound of A succeeds every other lower bound of A, then it
is called the infimum of A and is denoted by Inf (A)
Properties of Lattice

Let L be a non-empty set closed under two binary operations called meet
and join, denoted by ∧ and ∨. Then L is called a lattice if the following
axioms hold where a, b, c are elements in L:

1) Commutative Law: -

(a) a ∧ b = b ∧ a (b) a ∨ b = b ∨ a

2) Associative Law:-

(a) (a ∧ b)∧ c = a ∧(b∧ c) (b) (a ∨ b) ∨ c = a ∨ (b ∨ c)

3) Absorption Law: -

(a) a ∧ ( a ∨ b) = a (b) a ∨ ( a ∧ b) = a
Boolean Algebra

• We can interpret high or low voltage as representing


true or false.
• A variable whose value can be either 1 or 0 is called a
Boolean
variable.
• AND, OR, and NOT are the basic Boolean operations.
• We can express Boolean functions with either an
expression or a
truth table.
• Every Boolean expression can be converted to a circuit.
• Now, we’ll look at how Boolean algebra can help
simplify expressions, which in turn will lead to
2
simpler circuits.
Definition of Boolean Algrbra
A complemented distributive lattice is known as a Boolean Algebra. It is
denoted by (B, ∧,∨,',0,1), where B is a set on which two binary
operations ∧ (*) and ∨(+) and a unary operation (complement) are
defined. Here 0 and 1 are two distinct elements of B.

Since (B,∧,∨) is a complemented distributive lattice, therefore each


element of B has a unique complement.
Boolean Algebra Summary
• Recall that the two binary values have different
names:
– True/False
– On/Off
– Yes/No
– 1/0
• We use 1 and 0 to denote the two values.
• The three basic logical operations are:
– AND
– OR
– NOT
• AND is denoted by a dot (·).
• OR is denoted by a plus (+).
• NOT is denoted by an overbar ( ¯ ), a single quote
mark (') after, or (~) before the variable

3
Boolean Algebra
Summary
• Examples:
– is read “Y is equal to A AND
– B.”
– is read “z is equal to x OR y.”
is read “X is equal to NOT A.”
Tabular listing of the values of a function for all
possible
combinations of values on its arguments
Example: Truth tables for the basic logic
AND
operations: OR NOT
X Y Z = X·Y X Y Z = X+Y X Z
0 0 0 0 0 0 X
0 1 0 0 1 1 0 1
1 0 0 1 0 1 1 0
1 1 1 1 1 1 4
Boolean Operator Precedence

 The order of evaluation


is:
1. Parentheses
2. NOT
3. AND
4. OR
 Consequence: Parentheses
appear around OR
expressions
 Example: F = A(B + C)(C +
Switching Circuit
Boolean Functions
• A Boolean function is a function whose arguments, as
well as the function itself, assume values from a two-
element set ({0, 1)}).
• Example: F(x, y) = x’y’ + xyz + x’y

• After finding the circuit inputs and outputs, you can come up with
either an expression or a truth table to describe what the circuit
does.
• You can easily convert between expressions and truth tables.
Find the circuit’s
inputs and
outputs

Find a
Find a truth
Boolean
table
expression
for the circuit
for the circuit

1
2
De-Moprgan’s Theorem
Logic Gates
• In the earliest computers, switches
were opened and closed by
magnetic fields produced by
energizing coils in relays. The
switches in turn opened and closed
the current paths.

• Later, vacuum tubes that open and


close current paths electronically
replaced relays.

• Today, transistors are used as


• Logic gates have special
symbols:
X X
X·Y Z=X+Y X Z= X
Y Z= Y
AND gate OR gate NOT gate or
inverter
AND Gage

 The AND gate is so named because, if 0 is called "false" and 1 is called "true,"
the gate acts in the same way as the logical "and" operator. The following
illustration and table show the circuit symbol and logic combinations for an AND
gate. (In the symbol, the input terminals are at left and the output terminal is at
right.) The output is "true" when both inputs are "true." Otherwise, the output is
"false." In other words, the output is 1 only when both inputs one AND two are
1.
Boolean
Functions

• Boolean
Expression/Function x y z F
Example: F (x, y) = x
0 0 0 0
+ y’ z
0 0 1 1
• Truth Table
0 1 0 0
All possible
0 1 1 0
combinations
x of input
1
variables
y F0 0 1
1 0 1 1
• Logic Circuit
z 1 1 0 1
1 1 1 1
13 /
28
Logic Diagrams and
Expressions
Truth Logic Equation/Boolean
XTable
YZ F  X  Y ×Z Function
000 0
001 1
010 0
F X Y Z
011 0 X
Logic Circuit
100 1
Y F
101 1
110 1 Z
111 1
• Boolean equations, truth tables and logic
diagrams
• describe the same function!
Truth tables are unique, but expressions
and logic diagrams are not. This gives
Boolean Functions Exercise

• The truth table for the


function:
F (X, Y, Z ) = X Y + Y Z
X Y Z XY Y YZ F=XY+YZ
0 0 0 0 1
is: 0 0
0 0 1 0 1 1 1
0 1 0 0 0 0 0
0 1 1 0 0 0 0
1 0 0 0 1 0 0
1 0 1 0 1 1 1
1 1 0 1 0 0 1
1 1 1 1 0 0 1
Draw the logic circuit for the boolean function
Converting from Truth Table to Boolean
Function

• In designing digital circuits, the designer often begins with a truth


table describing what the circuit should do.
• The design task is largely to determine what type of circuit will
perform the function described in the truth table.
• While some people seem to have a natural ability to look at a truth
table and immediately envision the necessary logic gate or relay
logic circuitry for the task, there are procedural techniques
available for the rest of us.
• Here, Boolean algebra proves its utility in a most dramatic
way!
Converting from Truth Table to Boolean
Function

• This problem will be solved by showing that


any Boolean function can be represented by a
Boolean sum of Boolean products of the
variables and their complements or the
product of sums.

• There are two ways to convert from truth


tables to Boolean functions:
1. Using Sum of Products /Minterms
2. Using Product of Sums /Maxterms
Normal form of Boolean Expression
(Standard form)
 In standard SOP and POS each term of
Boolean expression must contain all the
literals (with and without bar) that has
been used in Boolean expression.
 If the above condition is satisfied by the
Boolean expression, that expression is
called Canonical form of Boolean
expression.
Normal form of Boolean Expression (Standard
form) Contd..

Convert AB+AC in Canonical


SOP (Standard SOP)

Sol. AB + AC
AB(C+C’) + AC(B+B’)
ABC+ABC’+ABC+AB’ Distributive law

C ABC+ABC’+AB’C
Canonical form of Boolean Expression
(Standard form) Contd..

Convert (A+B)(A+C) in
Canonical POS

Sol. (A+B).(A+C)
(A+B)+(C.C’) . (A+C)+(B.B’) (A+B+C).(A+B+C’).
(A+B+C)(A+B’+C) Distributive law
(A+B+C).(A+B+C’)(A+B’+C) Remove duplicates
Canonical form of Boolean Expression
(Standard form) Contd..

Minterm and Maxterm


Individual term of Canonical Sum of Products
(SOP) is called Minterm. In otherwords minterm
is a product of all the literals (with or without
bar) within the Boolean expression.

Individual term of Canonical Products of Sum


(POS) is called Maxterm. In otherwords
maxterm is a sum of all the literals (with or
without bar) within the Boolean expression.
Minterms & Maxterms for 2
variables (Derivation of Boolean
function from Truth Table)

x y Index Minterm Maxterm


0 0 0 m0 = x’ y’ M0 = x + y
0 1 1 m1 = x’ y M1 = x + y’
1 0 2 m2 = x y’ M2 = x’ + y
1 1 3 m3 = x y M3 = x’ + y’
The minterm mi should evaluate to 1 for
each combination of x and y.
The maxterm is the complement of
the minterm
Converting from Truth Table to Boolean
Function

• Minterm A B C Minterm
– Product (AND function) 0 0 0 0 m0 A BC
– Contains all variables 1 0 0 1 m1 A BC
– Evaluates to ‘1’ for 2 0 1 0 m2 A BC
a specific 3 0 1 1 m3 A BC
combination
4 1 0 0 m4 A BC
A =
Example A B C
0 5 1 0 1 m5 A BC
(0) • (0) •
B= (0) 6 1 1 0 m6 A BC
0 1 • 1 • 1=
7 1 1 1 m7 ABC
1
C=
18 /
0 28
Converting from Truth Table to Boolean
Function

• Maxterm A B C Maxterm
– Sum (OR function) 0 0 0 0 M0 A B 
– Contains all variables C
– Evaluates to ‘0’ for 1 0 0 1 M1 A  B 
a specific C
combination 2 0 1 0 M2 AB
A =
Example A B C C
1 3 0 1 1 M3 AB
(1) • (1) •
B= (1) C
1 4 1 0 0 M4 AB
0 • 0 • 0=
0 C
C=
5 1 0 1 M5 A  B 19
 /
1 28
Converting from Truth Table to Boolean
Function

• Truth Table to Boolean Function


A B C F
0 0 0 0 F  ABC  ABC
0 0 1 1
 ABC  ABC
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1
Using
Minterms 20 / 28
Converting from Truth Table to Boolean
Function

• Truth Table to Boolean Function


F  ( A  B  C) ( A  B  C ) ( A  B  C ) ( A  B 
A B C F
0 0 0C ) 1
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 0 Using
Maxterms 21 /
28

You might also like