Professional Documents
Culture Documents
CH 2 DLD (Nouman) Boolean Algebra Logical Gates
CH 2 DLD (Nouman) Boolean Algebra Logical Gates
CH 2 DLD (Nouman) Boolean Algebra Logical Gates
Boolean Algebra
Logical Gates
a set of elements
a set of operators, and
a number of unproved axioms or postulates.
Set of Elements
A set of elements is any collection of objects having a common property. If S is a set, and x and y are
certain objects, then x ∈ S denotes that x is a member of the set S, and y ∉S denotes that y is not an
element of S. A set with a number of elements is specified by braces: A = {1, 2, 3, 4), i.e., the elements of
set A are the numbers 1, 2, 3, and 4.
Binary Operators
A binary operator defined on a set S of elements is a rule that as signs to each pair of elements from S a
unique element from S. As an example, consider the relation a * b = c. We say that * is a binary operator
if it specifies a rule for finding c from the pair (a, b) and also if a, b, c ∈ S. However, is not a binary
operator if a, b ∈S, whereas the rule finds c ∉ S.
Postulates
The postulates of a mathematical system form the basic assumptions from which it is possible to deduce
the rules, theorems, and properties of the system. The most common postulates used to formulate
various algebraic structures are:
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, the set of natural
numbers N = {1, 2, 3, 4,...} is closed with respect to the binary operator plus (+) by the rules of
arithmetic addition, since for any a , b ∈N we obtain a unique c ∈N by the operation a + b = c.
The set of natural numbers is not closed with respect to the binary operator minus (-) by the
rules of arithmetic subtraction because 2-3-1 and 2, 3 ∈ N, while −1 ∉ N.
2. Associative law.
A binary operator on a set S is said to be associative whenever
3. Commutative law.
Boolean algebra
Boolean algebra is an algebraic structure defined on a set of elements B together with two binary
operators + and . provided the following (Huntington) postulates are satisfied:
1. Closure with respect to the operator + and .
2. An identity element with respect to
a. + is designated by 0 such that x+ 0= 0+x = x.
b. . is designated by 1 such that x . 1 = 1. x = x
3. Commutative with respect to
a. + such that x + y = y + x
b. . such that x . y = y . х
4. Distributive
a. . is distributive over + such that x . ( y + z ) = ( x . y ) + ( x . z)
b. + is distributive over . such that x + ( y . z )= ( x + y ) . ( x + z)
5. For every element x ∈ B. there exists an element x ' ∈ B (called the complement of x) such that x
x + x ' = 1 and x . x ' = 0.
6. There exists at least two elements x, y ∈ B such that x ≠ y
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
These rules are exactly the same as the AND, OR, and NOT operations, respectively. We must now show
that the Huntington postulates are valid for the set B = {0, 1} and the two binary operators + and .
1. Closure is obvious from the tables since the result of each operation is either 1 or 0 and 1,0 ∈ B.
2. From the tables we see that
(a) 0 + 0=0 and 1+ 0=1 so 0 is identity element with respect to + operator
(b) 0 . 1 = 0 and 1 . 1 = 1 so 1 is identity element with respect to . operator
3. The commutative laws are obvious from the symmetry of the binary operator tables.
4. The distributive law x . ( y + z ) = ( x. y ) + ( x .z) can be shown to hold true from the operator
tables by forming a truth table of all possible values of x, y, and z. For each combination, we
derive x . (y + z) and show that the value is the same as (x . y) + ( x . z)
BASIC THEOREMS
BOOLEAN FUNCTIONS
A binary variable can take the value of 0 or 1.
A Boolean function is an expression formed with:
binary variables
the two binary operators OR and AND
unary operator NOT
parentheses, and an equal sign.
For a given value of the variables, the function can be either 0 or 1.
For example, consider the Boolean Function F₁ = xyz' and function F2 = x'yz
The function F1 is equal to 1 if x = 1 and y=1 and z' = 1; otherwise F₁ = 0.
F2 will be equal to 1 when x=0, y=1 and z=1 otherwise F2 will be 0;
The above is an example of a Boolean function represented as an algebraic expression.
A Boolean function may also be represented in a truth table. To represent a function in a truth table, we
need a list of the 2n combinations of 1's and 0's of the n binary variables, and a column showing the
combinations for which the function is equal to 1 or 0.
Consider the following functions expressed as algebraic expression.
F1 = xyz'
F2 = x + y'z
F3 = x'y'z + x'yz + xy'
F4 = xy' + xz'
The above functions can be expressed in the truth table as below
x y z F1 F2 F3 F4
0 0 0 0 0 0 0
0 0 1 0 1 1 1
0 1 0 0 0 0 0
0 1 1 0 0 1 1
1 0 0 0 1 1 1
1 0 1 0 1 1 1
1 1 0 1 1 0 0
1 1 1 0 1 0 0
Two functions of n variables are said to be equal if they have same values for all 2n combinations of n
variables e.g. F3 and F4 are equal.
A Boolean function may be transformed from an algebraic expression into logical diagram composed of
AND, OR and NOT Gates.
ALGEBRIC MANIPULATION
Each Boolean function consists of Terms and each Term contains Literals. Literal is a primed or unprimed
variable. When Boolean function is implemented with logical Gates,
Each Term designate a Gate and
Each Literal designate input to a Gate.
The minimization of number of Literals and numbers of Terms results in circuit with less equipment.
There are following three ways to simplify Boolean function so that it contains fewer Literals and fewer
Terms:
1. Simplification by Boolean Algebra
2. Simplification by Karnaugh Map
3. Simplification by Tabulation Method
1) x + x’y
= ( x + x’ )( x + y ) Distributive Law
=1.(x+y) x + x’=1
=x+y x.1=x
2) x ( x’ + y )
= x.x’ + xy Distributive Law
= 0 + xy x.x’=0
= xy x+0=x
=x’z’ . 1 + xy’ x + x’ = 1
=x’z’ + xy’ x.1=x
4) xy + x’z + yz
=xy + x’z + yz.1 x.1=x
=xy +x’z + yz( x + x’) x+x’=1
=xy +x’z + xyz + x’yz Distributive Law
=xy + xyz + x’z + x’yz Commutative Law
=xy(1 + z) + x’z( 1 + y) Distributive Law
=xy + x’z x + 1=1
5) (x+y)(x’+z)(y+z)
=xy + x’z +yz by Duality Principal
=xy + x’z from Question 4
=(x+y)(x’+z) by Duality Principal
COMPLEMENT OF A FUNCTION
Complement of a function is obtained by interchanging the AND and OR operator and complementing
each Literal. E.g. if F1= A + B + C then F1’ = A’B’C’ similarly if F2=x’yz then F2’= x + y’ + z’
CANONICAL FORM
Boolean function expressed in sum of product or product of sum form is said to be in its canonical form.
Note 1.
n
Number of possible functions that can be formed for n variables are 22 .
2
If n=2 then MINTERMS will be 22=4 and total possible functions will be 22 =16
Boolean function can be expressed as algebraic expression directly from truth table as:
Example
Consider the following table and write each function in SOP and POS form and also write complement
of each function in SOP and POS form.
x y z F1 F2
0 0 0 0 0
0 0 1 1 0
0 1 0 0 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Note: - Taking complement of function by De Morgan’s Theorem convert the function in sum of product
form to product of sum form and vice versa.
SUMMARY
Example
Express the following in sum of product form.
F= A+B’C n=3
Variables are three i.e. A,B,C so each Term should contain 3 variables.
First Term A misses two variables B and C so we will include missing Variable B and C as follow:
A = A.1 x.1=x
= A.(B+B’) x+x’=1
= AB + AB’ Distributive Law
= AB.1 + AB’.1 x.1=x
C h a p t e r 1 | 10 M.Nouman Abid
DIGITAL LOGIC AND DESIGN
Example
Express the following in product of sum form.
F= xy + x’z n=3
= (xy + x’). (xy +z) x+yz=(x+y)(x+z)
=(x+x’)(x’+y).(x+y)(y+z) x+yz=(x+y)(x+z)
=1.(x’+y).(x+z)(y+z’) x+x’=1
=(x’+y).(x+z)(y+z) x+1=x
Each MAXTERM should contains 3 variables
1) x’+y= x’+y + 0 x+0=x
=x’+y + z.z’ x.x’=0
=(x’+y+z)(x’+y+z’) x+yz=(x+y)(x+z)
2) x+z = x+z +0
= x+z + y.y’
= (x+y+z)(x+y’+z)
3) y+z= y+z + 0
=y+z +x.x’
=(x+y+z)(x’+y+z)
Combining all and writing once those MAXTERMS which appears more than one time we get
F= (x’+y+z)(x’+y+z’)(x+y+z)(x+y’+z)
= (1 0 0)(1 0 1) (0 0 0) (0 1 0)
= M4 .M5 .M0 .M2
=M0.M2.M4.M5
F(x,y,z)=∏ (0 , 2 , 4 , 5)
C h a p t e r 1 | 11 M.Nouman Abid
DIGITAL LOGIC AND DESIGN
GATES
A Gate is an electronic circuit that allows or disallows current to flow. Gates are building blocks of binary
circuits. Logical Gates are circuits/block of hardware that produce a logical 1 or logical 0 output signal
based on one or more logical inputs signals. Each logical Gate perform one logical/ Boolean operation
(Boolean/logical Operators are (AND, OR, NOT etc.). Gates are made up of resistors, diodes and
transistors arranged in different ways to perform different operations. Four different names are used for
same circuit
Digital circuit
Switching circuit
logic circuits
Gales.
Logic gates can be made of resistors, transistors or diodes. These components are wired together in
specific configurations to ensure they transform the inputs in expected ways. Resistors, for example, can
commonly be used as a pull-up or pull-down resistor. Pull-up and pull-down resistors are used when
there are any logic gate inputs to connect to a logic level 1 or 0. Pull-up resistors are connected to (+5 V),
and pull-down resistors are connected to ground (0 V).
Likewise, transistors provide switching i.e. turning on or off in response to input signals. while diodes
ensure current flows in only one direction to stabilize the circuit.
Commonly used logic gates are transistor-transistor logic (TTL) and complementary metal-oxide-
silicon (CMOS).
AND GATE
The AND gate is named so because, if 0 is false and 1 is 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 on the left, and the output terminal is on the 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 are 1.
C h a p t e r 1 | 12 M.Nouman Abid
DIGITAL LOGIC AND DESIGN
OR GATE
The OR gate gets its name from behaving like the logical inclusive "or." The output is true if one or both
of the inputs are true. If both inputs are false, then the output is false. In other words, for the output to
be 1, at least one input must be 1.
C h a p t e r 1 | 13 M.Nouman Abid
DIGITAL LOGIC AND DESIGN
C h a p t e r 1 | 14 M.Nouman Abid
DIGITAL LOGIC AND DESIGN
Complex operations can be performed using combinations of these logic gates. In theory, there is no
limit to the number of gates that can be arrayed together in a single device. But in practice, there is a
limit to the number of gates that can be packed into a given physical space.
Arrays of logic gates are found in digital ICs. As IC technology advances, the required physical volume for
each individual logic gate decreases, and digital devices become capable of performing more
complicated operations at increasing speeds.
UNIVERSAL GATES:
A universal gate is a gate which can implement any Boolean function without need to use any other
gate type. The NAND and NOR gates are universal gates. In practice, this is advantageous since NAND
and NOR gates are economical and easier to fabricate and are the basic gates used in all IC digital logic
families.
1. All NAND input pins connect to the input signal A gives an output A’.
2.
Implementing AND Using only NAND Gates
An AND gate can be replaced by NAND gates as shown in the figure (The AND is replaced by a NAND
gate with its output complemented by a NAND gate inverter).
C h a p t e r 1 | 15 M.Nouman Abid
DIGITAL LOGIC AND DESIGN
Thus, the NAND gate is a universal gate since it can implement the AND, OR and NOT functions.
An OR gate can be replaced by NOR gates as shown in the figure (The OR is replaced by a NOR gate with
its output complemented by a NOR gate inverter)
C h a p t e r 1 | 16 M.Nouman Abid
DIGITAL LOGIC AND DESIGN
An AND gate can be replaced by NOR gates as shown in the figure (The AND gate is replaced by a NOR
gate with all its inputs complemented by NOR gate inverters)
Thus, the NOR gate is a universal gate since it can implement the AND, OR and NOT functions.
C h a p t e r 1 | 17 M.Nouman Abid