S2 - Cse231 - Summer 2024 - Muu

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 81

CSE231 Digital Logic

Prof. Dr. Muhammad Shahin Uddin


Email: muhammad.uddin@northsouth.edu
Boolean Algebra
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
George Boole
• Father of Boolean Algebra
• He came up with a type of linguistic algebra, the three most
basic operations of which were (and still are) AND, OR and
NOT. It was these three functions that formed the basis of
his premise, and were the only operations necessary to
perform comparisons or basic mathematical functions.
• Boole’s system (detailed in his 'An Investigation of the Laws
of Thought, on Which Are Founded the Mathematical
Theories of Logic and Probabilities', 1854) was based on a
binary approach, processing only two objects - the yes-no,
true-false, on-off, zero-one approach. George Boole (1815 - 1864)
• Surprisingly, given his standing in the academic community,
Boole's idea was either criticized or completely ignored by
the majority of his peers.
• Eventually, one bright student, Claude Shannon (1916-
2001), picked up the idea and ran with it
Binary Logic and Gates
Binary variables take on one of two values.
Logical operators operate on binary values and binary variables.
Basic logical operators are the logic functions AND, OR and NOT.
Logic gates implement logic functions.
Boolean Algebra: a useful mathematical system for specifying and
transforming logic functions.
We study Boolean algebra as foundation for designing and analyzing
digital systems!
Binary Variables
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.
Variable identifier examples:
• A, B, y, z, or X1 for now
• RESET, START_IT, or ADD1 later
Logical Operations
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.
Boolean Functions
A Boolean function
• Binary variables
• Binary operators OR and AND
• Unary operator NOT
• Parentheses
Examples
• F1= x. y. z'
• F2 = x + y’.z
• F3 = x' .y’ .z + x' .y .z + x .y'
• F4 = (x. y' + x' .z)
Properties of Boolean Algebra

Property AND OR
Commutative AB=BA A+B=B+A
Associative (AB)C=A(BC) (A+B)+C=A+(B+C)
Distributive A(B+C)=AB+AC A+(BC)=(A+B)(A+C)
Identity A1=A A+0=A
Complement A(A’)=0 A+A’=1
DeMorgan’s Law (AB)’=A’ + B’ (A+B)’=A’B’
Boolean Algebra: Basic Theorems
 The theorems and postulates listed are the most basic relationships in Boolean algebra.
 Postulates and Theorems of Boolean Algebra are:
Proof
Proof
Proof
Proof
Example:
Simplify the following Boolean functions to a minimum number of literals.

1. x(x + y) = xx + xy = 0 + xy = xy.
2. x + xy = (x + x)(x + y) = 1(x + y) = x + y.
3. (x + y)(x + y) = x + xy + xy + yy = x(1 + y + y) = x.
4. xy + xz + yz = xy + xz + yz(x + x) = xy + xz + xyz + xyz = xy(1 + z) + xz(1 + y) = xy
+ xz.
5. (x + y)(x + z)(y + z) = (x + y)(x + z), by duality from function 4.
Example:
Simplify the following Boolean functions to a minimum number of literals.

1. x(x + y) = xx + xy = 0 + xy = xy.
2. x + xy = (x + x)(x + y) = 1(x + y) = x + y.
3. (x + y)(x + y) = x + xy + xy + yy = x(1 + y + y) = x.
4. xy + xz + yz = xy + xz + yz(x + x) = xy + xz + xyz + xyz = xy(1 + z) + xz(1 + y) = xy
+ xz.
5. (x + y)(x + z)(y + z) = (x + y)(x + z), by duality from function 4.
Complement of a 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.
 DeMorgan’s theorems can be extended to three or more variables. The three‐
variable form of the first DeMorgan’s theorem is derived as follows:

(A+B+C)’=(A+x)’=A’x’=A’(B+C)’= A’B’C’

DeMorgan’s theorems can be generalized as follows:


(A + B + C + D + G + F)’ = A’B’C’D’…..F’
(ABCDF)’ = A’+ B’+ C’+D’+G’+F’
The generalized form of DeMorgan’s theorems states that the complement of a function
is obtained by interchanging AND and OR operators and complementing each literal.
The operators and postulates have the following meanings:
Notation Examples

• Examples:
• Y =A.B is read “Y is equal to A AND B.”
• Z=X+Y is read “Z is equal to X OR Y.”
• X=A’ is read “X is equal to NOT A.”

 Note: The statement:


1 + 1 = 2 (read “one plus one equals two”)
is not the same as
1 + 1 = 1 (read “1 or 1 equals 1”).
Logic Gates
Gate
A device that performs a basic operation on electrical signals
Boolean Expressions
Uses Boolean algebra, a mathematical notation for expressing two-valued logic
Logic Diagrams
A graphical representation of a circuit; each gate has its own symbol
Truth Tables
A table showing all possible input value and the associated output values
Timing Diagram
Logic Gates
 Logic gates:
• NOT
• AND
• OR
• EX-OR
• EX-NOR
• NAND
• NOR
Typically, logic diagrams are black and white with gates distinguished only
by their shape
Types of Logic Gates
Logic Gates
NOT Gate
 A NOT gate accepts one input signal (0 or 1) and returns the opposite signal as output
 The output of NOT gate is high (‘1’) if its input is low (‘0’).
 The output of NOT gate is low (‘0’) if its input is high (‘1’).
 It is clear that NOT gate simply inverts the given input.
 Since NOT gate simply inverts the given input, therefore it is also known as Inverter Gate.
Truth Table Timing Diagram-
Truth Table for NOT Gate is as shown The timing diagram for NOT Gate is as
below- shown below-
AND Gate
 An AND gate accepts two/ more than two input signals
 The output of AND gate is high (‘1’) if all of its inputs are high (‘1’).
 The output of AND gate is low (‘0’) if any one of its inputs is low (‘0’).
Truth Table- Timing Diagram-
The truth table for AND Gate is as The timing diagram for AND Gate is as
shown below- shown below-
OR Gate
The output of OR gate is high (‘1’) if any one of its inputs is high (‘1’).
The output of OR gate is low (‘0’) if all of its inputs are low (‘0’).

Logic Symbol-
The logic symbol for OR Gate is as shown below-
Truth Table- Timing Diagram-
The truth table for OR Gate is as shown The timing diagram for OR Gate is as shown
below- below-
Universal Logic Gates-
 Universal logic gates are the logic gates that are capable of implementing any Boolean
function without requiring any other type of gate.

 They are called as “Universal Gates” because- They can realize all the binary operations.
 All the basic logic gates can be derived from them.
 They have the following properties-
 Universal gates are not associative in nature.
 Universal gates are commutative in nature.
 There are following two universal logic gates-
Universal Logic Gates: NAND Gate-

 A NAND Gate is constructed by connecting a NOT Gate at the output terminal of


the AND Gate.
 The output of NAND gate is high (‘1’) if at least one of its inputs is low (‘0’).
 The output of NAND gate is low (‘0’) if all of its inputs are high (‘1’).
 Logic Symbol-
 The logic symbol for NAND Gate is as shown below-
Truth Table- Timing Diagram-
The truth table for NAND Gate is as The timing diagram for NAND Gate is as shown
shown below- below-
Universal Logic Gates: NOR Gate
 A NOR Gate is constructed by connecting a NOT Gate at the output
terminal of the OR Gate.
 The output of OR gate is high (‘1’) if all of its inputs are low (‘0’).
 The output of OR gate is low (‘0’) if any of its inputs is high (‘1’).

Logic Symbol-
The logic symbol for NOR Gate is as shown below-
Truth Table- Timing Diagram-
The truth table for NOR Gate is as shown below- The timing diagram for NOR Gate is as shown below-
XOR Gate
An XOR gate accepts two input signals
If both are the same, the output is 0; otherwise, the output is 1
EX-OR Gate
Note the difference between the XOR gate
and the OR gate; they differ only in one input situation
When both input signals are 1, the OR gate produces a 1 and the XOR produces a 0
XOR is called the exclusive OR
EX-NOR Gate
EXNOR gate means exclusive NOR gate and is
a combination of X-OR and NOT gate. It also
has two inputs and one output. When both the
inputs are at 0, the output of the EXNOR gate
will be high i.e.1. If one of the input is 0 and the
other is 1 the output will be 0, and the gate is
known as Coincidence gate.
 Draw a circuit diagram for f= (xy' + x'y)z.

38
 Draw a circuit diagram for f= (xy' + x'y)z.

39
 Find the Boolean expression for the following circuit

40
 The Boolean expression that represent the circuit in the following
Figure is yz+x(yz’+y’z)

41
Example:

42
A circuit for two light switches

EXAMPLE
F(x,y)=1 when the light is on
• F(x,y)=0 when the light is off
• When both switches are closed, the light is on:
F(1,1)=1, this implies
• When we open one switch, the light is off:
F(1,0)=F(0,1)=0
• When the other switch is also open, the light is on:
F(0,0)=1

43
Thus, we get:

x y F(x,y)
Which Boolean expression is given by F?
1 1 1
1 0 0 F(x,y) = xy + x'y'

0 1 0
0 0 1
Draw a circuit for F,
i.e., a circuit to control two light switches.

44
EXAMPLE:

45
EXAMPLE:

46
47
48
49
50
51
52
53
Logical Gates and Combinatorial Circuits
• A NOT gate can
be implemented
using a NAND
gate (a).

• An AND gate can


be implemented
using NAND gates
(b).

• An OR gate can be
implemented
using NAND gates
(c).

54
Canonical and Standard Form : Minterms and Maxterms
 A binary variable may appear either in its normal form (x) or in its complement form
(x).
 Now consider two binary variables x and y combined with an AND operation.
 Since each variable may appear in either form, there are four possible combinations:
xy, x’y, xy’, and x’y’.
 Each of these four AND terms is called a minterm, or a standard product.
 In a similar manner, n variables can be combined to form 2n minterms.
 The 2n different minterms may be determined by a method similar to the one shown in
a Table (next slide) for three variables.
Canonical and Standard Form : Minterms and Maxterms
 The binary numbers from 0 to 2n - 1 are listed under the n variables.
 Each minterm is obtained from an AND term of the n variables, with each variable
being primed if the corresponding bit of the binary number is a 0 and unprimed if a 1.
 A symbol for each minterm is also shown in the table and is of the form mj , where the
subscript j denotes the decimal equivalent of the binary number of the minterm
designated.
 A Boolean function can be expressed algebraically from a given truth table by
forming a minterm for each combination of the variables that produces a 1 in the
function and then taking the OR of all those terms.
Canonical and Standard Form : Minterms and Maxterms

Boolean functions expressed as a sum of minterms or product of maxterms are


said to be in canonical form.
Canonical and Standard Form : Minterms and Maxterms
Canonical and Standard Form : Minterms and Maxterms
Sum of Minterms
 The minterms whose sum defines the Boolean function are those which give the 1’s
of the function in a truth table.
 Function can be either 1 or 0 for each minterm, and since there are 2 n minterms
 Convenient to express a Boolean function in its sum‐of‐minterms form.
 If the function is not in this form, it can be made so by first expanding the
expression into a sum of AND terms.
 Each term is then inspected to see if it contains all the variables.
 If it misses one or more variables, it is ANDed with an expression such as x + x,
where x is one of the missing variables.
 The next example clarifies this procedure.
Example

It is sometimes convenient to express the function in the following brief notation.


Alternative procedure for deriving the minterms
Consider the Boolean function given in previous Example
F = A + B’C
The truth table can be derived directly from the algebraic expression by listing the eight
binary combinations under variables A, B, and C and inserting 1’s under F for those
combinations for which A = 1 and BC = 01.
From the truth table, we can then read the five minterms of the function to be 1, 4, 5, 6,
and 7.
Alternative procedure for deriving the minterms
Consider the Boolean function given in previous Example
F = A + B’C
The truth table can be derived directly from the algebraic expression by listing the eight
binary combinations under variables A, B, and C and inserting 1’s under F for those
combinations for which A = 1 and BC = 01.
From the truth table, we can then read the five minterms of the function to be 1, 4, 5, 6,
and 7.
Alternative procedure for deriving the minterms
Consider the Boolean function given in previous Example
F = A + B’C
The truth table can be derived directly from the algebraic expression by listing the eight
binary combinations under variables A, B, and C and inserting 1’s under F for those
combinations for which A = 1 and BC = 01.
From the truth table, we can then read the five minterms of the function to be 1, 4, 5, 6,
and 7.
Example of Maxterms
Conversion between Canonical Forms
Conversion between Canonical Forms
 We now state a general conversion procedure:
 To convert from one canonical form to another, interchange the symbols ΣandΠ

and list those numbers missing from the original form.


 In order to find the missing terms, one must realize that the total number of
minterms or maxterms is 2n , where n is the number of binary variables in the
function.
 A Boolean function can be converted from an algebraic expression to a product of
maxterms by means of a truth table and the canonical conversion procedure.
 Consider, for example, the Boolean expression F = xy + x’z
 First, we derive the truth table of the function
 The 1’s under F in the table are determined from the combination of the variables
for which xy = 11 or xz = 01.
 The minterms of the function are read from the truth table to be 1, 3, 6, and 7.
 The function expressed as a sum of minterms is
Conversion between Canonical Forms

Since there is a total of eight minterms or maxterms in a function of three


variables, we determine the missing terms to be 0, 2, 4, and 5. The function
expressed as a product of maxterms is

the same answer as obtained in Previous Example.


Conversion between Canonical Forms
Canonical Form: Sum of Minterms
F(X,Y,Z) = X’Y’+Z
= X’Y’(Z+Z’)+Z(X+X’)(Y+Y’)
= X’Y’Z+X’Y’Z’+(ZX+ZX’)(Y+Y’)
= X’Y’Z’+X’Y’Z+X’YZ+XY’Z+XYZ
= m0+m1+m3+m5+m7
= ∑(m0+m1+m3+m5+m7)
= ∑m(0,1,3.5,7)

Product of minterms 0,1,3.5.7


Canonical Form: Product of Maxterms
F(X,Y,Z) =X’Y’+Z
=Z+X’Y’
= (Z+X’)(Z+Y’) Using Distributed law
=(X’+YY’+Z)(XX’+Y’+Z)
=(X’+Y+Z)(X’+Y’+Z) (X+Y’+Z)(X’+Y+Z)
=(X’+Y+Z)(X’+Y’+Z) (X+Y’+Z)

=M4M6M2

=∏(M4M6M2)
=∏M (2,4,6)

Product of Maxterm 2, 4, 6
Canonical Forms
 Example in slide 3 and 4 ∑m(0,1,3.5,7) =∏M (2,4,6)
In general ∑m({x}) =∏M ({y})
Where

 A function expressed as a sum of minterms can also be expressed as the product


of the opposite maxterms
Canonical Forms: Minterms and Maxterms
 A sum of minterms equals the inverse of the product of the same maxterms

Proof:
Canonical/Standard Forms
 There are two types of standard forms:
• Sum of products (SOP) and
• Products of sums (POS).
Sum of Product (SOP)

0
1 SOP form POS form Directly written
0 from Truth Table
1
Each minterm is having all the
1 Canonical/ Standard form variable or complemented form
F=x’yz’+xy’z’+xy’z+xyz’+xyz
= x’yz’+xy’[z’+z]+xy[z’+z]
=x’yz’+xy’+xy
Each minterm does not have all the variables
=x’yz’+x[y’+y]
in normal or complemented form = x’yz’+x
Minimal SOP form = x+yz’ [Distributed law A+A’B=A+B)]
Standard Forms: Two‐level implementation

y’+x’yz’+xy
Standard Forms: Conversion from other form
 A Boolean function may be expressed in a nonstandard form
 Example: F3 = AB + C(D + E)
 Neither in sum‐of‐products nor in product‐of‐sums form.
Sum of Product

3-> 2 level

 Two-level produces the least amount of delay through the gates when the
signal propagates from the inputs to the output.
Constructing Gates
Transistor
 A device that acts either as a wire that conducts electricity or as a resistor that
blocks the flow of electricity, depending on the voltage level of an input signal
 A transistor has no moving parts, yet acts like a switch
 It is made of a semiconductor material, which is neither a particularly good
conductor of electricity nor a particularly good insulator
How is the behavior implemented

B
E
Circuits
 Combinational Circuit
• The input values explicitly determine the output
 Sequential Circuit
• The output is a function of the input values and the existing state of the circuit
THANKS

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy