Chapter 2: Boolean Algebra and Logic Functions

Slides:



Advertisements
Similar presentations
Boolean Algebra and Logic Gates
Advertisements

Logical Systems Synthesis.
Chapter 2 Logic Circuits.
ECE C03 Lecture 21 Lecture 2 Two Level Minimization Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
ECE 331 – Digital System Design Boolean Algebra (Lecture #3) The slides included herein were taken from the materials accompanying Fundamentals of Logic.
ECE 301 – Digital Electronics Minterm and Maxterm Expansions and Incompletely Specified Functions (Lecture #6) The slides included herein were taken from.
ECE 331 – Digital System Design
Logic Gate Level Part 2. Constructing Boolean expression from truth table First method: write nonparenthesized OR of ANDs Each AND is a 1 in the result.
Chapter 2 – Combinational Logic Circuits Part 1 – Gate Circuits and Boolean Equations Logic and Computer Design Fundamentals.
CS 151 Digital Systems Design Lecture 6 More Boolean Algebra A B.
EECC341 - Shaaban #1 Lec # 5 Winter Switching Algebra: Principle of Duality Any theorem or identity in switching algebra remains true if.
Boolean Algebra and Logic Gates
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
Canonical Forms and Logic Miniminization
بهينه سازي با نقشة کارنو Karnaugh Map. 2  Method of graphically representing the truth table that helps visualize adjacencies 2-variable K-map 3-variable.
CSCE 211: Digital Logic Design
1 Why study Boolean Algebra? 4 It is highly desirable to find the simplest circuit implementation (logic) with the smallest number of gates or wires. We.
Lecture 4 Logic gates and truth tables Implementing logic functions
1 Logic Gates Digital Computer Logic Kashif Bashir WWW:
1 COMBINATIONAL LOGIC One or more digital signal inputs One or more digital signal outputs Outputs are only functions of current input values (ideal) plus.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Boolean Algebra and Digital Circuits
Switching functions The postulates and sets of Boolean logic are presented in generic terms without the elements of K being specified In EE we need to.
Combinational Logic 1.
Boolean Logic and Circuits ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
LOGIC GATES & BOOLEAN ALGEBRA
ECE 301 – Digital Electronics Basic Logic Operations, Boolean Expressions, and Boolean Algebra (Lecture #3)
Logic Functions: XOR, XNOR
1 Boolean Algebra  Digital circuits Digital circuits  Boolean Algebra Boolean Algebra  Two-Valued Boolean Algebra Two-Valued Boolean Algebra  Boolean.
05 BA2 Page 1 ECEn/CS 224 Boolean Algebra – Part 2.
1 BOOLEAN ALGEBRA Basic mathematics for the study of logic design is Boolean Algebra Basic laws of Boolean Algebra will be implemented as switching devices.
Chap 2. Combinational Logic Circuits
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
A. Abhari CPS2131 Chapter 2: Boolean Algebra and Logic Gates Topics in this Chapter: Boolean Algebra Boolean Functions Boolean Function Simplification.
1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression.
Module –I Switching Function
Binary Logic and Gates Boolean Algebra Canonical and Standard Forms Chapter 2: Boolean Algebra and Logic Gates.
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
Lecture 18: Boolean Algebra Boolean Functions. w = Chris is allowed to watch television x = Chris's homework is finished y = it is a school night z =
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 4 Dr. Shi Dept. of Electrical and Computer Engineering.
ECE DIGITAL LOGIC LECTURE 8: BOOLEAN FUNCTIONS Assistant Prof. Fareena Saqib Florida Institute of Technology Spring 2016, 02/11/2016.
ECE 301 – Digital Electronics Minimizing Boolean Expressions using K-maps, The Minimal Cover, and Incompletely Specified Boolean Functions (Lecture #6)
Chapter 3 Simplification of Switching Functions. Simplification Goals Goal -- minimize the cost of realizing a switching function Cost measures and other.
CSE 461. Binary Logic Binary logic consists of binary variables and logical operations. Variables are designated by letters such as A, B, C, x, y, z etc.
CHAPTER 2 Boolean algebra and Logic gates
ECE 301 – Digital Electronics
© Copyright 2004, Gaetano Borriello and Randy H. Katz
Chapter 2: Boolean Algebra and Logic Functions
ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2 Instructor: Andrew B. Kahng (lecture)
CS 105 Digital Logic Design
Princess Sumaya University
ECE 331 – Digital System Design
Boolean Algebra.
CSE 311 Foundations of Computing I
Boolean Algebra.
Boolean Algebra.
Boolean Algebra & Logic Circuits
Lecture 14: Boolean Algebra
Chapter 2 Boolean Algebra and Logic Gate
ECE 331 – Digital System Design
CSE 370 – Winter Combinational Logic - 1
January 19 W’05 Yutao He 4532B Boelter Hall CSM51A/EEM16-Sec.1 W’05
Chapter 2 Introduction to Logic Circuits
Spring Combinational Logic - 1
Chapter #2: Two-Level Combinational Logic
Logic Circuits I Lecture 3.
ECE 331 – Digital System Design
Presentation transcript:

Chapter 2: Boolean Algebra and Logic Functions CS 3402-- Digital Logic Design CS 3402:A.Berrached

Boolean Algebra Algebraic structure consisting of: a set of elements B operations {AND, OR} Notation: X AND Y X • Y XY X OR Y X+Y B contains at least two elements a & b such that a  b Note: switching algebra is a subset of Boolean algebra where B={0, 1} Axioms of Boolean Algebra 1. Closure a,b in B, (i) a + b in B (ii) a • b in B 2. Identities: 0, 1 in B (i) a + 0 = a (ii) a • 1 = a 3. Commutative Laws: a,b in B, (i) a + b = b + a (ii) a • b = b • a 4. Associative Laws: (i) a + (b+c) = (a+b)+c = a+b+c (ii) a. (b.c) = (a.b).c = a.b.c 5. Distributive Laws: (i) a + (b • c) = (a + b) • (a + c) (ii) a • (b + c) = (a • b) + (a • c) 6. Existence of the Complement: exists a’ unique in B (i) a + a’ = 1 (ii) a • a’ = 0 a’ is complement of a CS 3402:A.Berrached

Principle of Duality Definition of duality: a dual of a Boolean expression is derived by replacing AND operations by ORs, OR operations by ANDs, constant 0s by 1s, and 1s by 0s (everything else is left unchanged). Principle of duality: if a statement is true for an expression, then it is also true for the dual of the expression Example: find the dual of the following equalities 1) XY+Z = 0 2) a(b+c) = ab + ac CS 3402:A.Berrached

Boolean Functions A Boolean function consists of an algebraic expression formed with binary variables, the constants 0 and 1, the logic operation symbols, parenthesis, and an equal sign. Example: F(X,Y,Z) = X + Y’ Z or F = X + Y’ Z X, Y and Z are Boolean variables A literal: The appearance of a variable or its complement in a Boolean expression A Boolean function can be represented with a truth table A Boolean function can be represented with a logic circuit diagram composed of logic gates. CS 3402:A.Berrached

From Boolean Expression to Gates More than one way to map an expression to gates E.g., Z = A' • B' • (C + D) = (A' • (B' • (C + D))) A Z B T 1 C T 2 D A B Z C D For each Boolean function, there is only one unique truth table representation =>Truth table is the unique signature of a Boolean function CS 3402:A.Berrached

Boolean Functions Possible Boolean Functions of Two variables NAND NOR Description Z = 1 if X is 0 or Y Gates T ruth T able NAND X X 1 Y 1 Z 1 Z Y Description Z = 1 if both X and Y are 0 Gates T ruth T able NOR X X 1 Y 1 Z 1 Z Y CS 3402:A.Berrached

Basic Logic Functions: NAND, NOR NAND, NOR gates far outnumber AND, OR in typical designs easier to construct in the underlying transistor technologies they are functionally complete Functionally Complete Operation Set: A set of logic operations from which any Boolean function can be realized (also called universal operation set) E.g. {AND, OR, NOT} is functionally complete The NAND operation is also functionally complete => any Boolean function can be realized with one type of gate (the NAND gate). The NOR operation is also functionally complete CS 3402:A.Berrached

Basic Logic Functions: XOR, XNOR XOR: X or Y but not both ("inequality", "difference") XNOR: X and Y are the same ("equality", "coincidence") CS 3402:A.Berrached

Logic Functions: Rationale for Simplification Logic Minimization: reduce complexity of the gate level implementation reduce number of literals (gate inputs, circuit inputs) reduce number of gates reduce number of levels of gates fewer inputs implies faster gates in some technologies fan-ins (number of gate inputs) are limited in some technologies Fewer circuit inputs implies fewer I/O pins fewer levels of gates implies reduced signal propagation delays number of gates (or gate packages) influences manufacturing costs In general, need to make tradeoff between circuit delay and reduced gate count. CS 3402:A.Berrached

Simplification Using Boolean Algebra Useful Theorems of Boolean Algebra: 1. Idempotency Theorem a. X + X = X b. X • X = X 2. Null elements for + and • operators a. X + 1 = 1 b. X . 0 = 0 3. Involution Theorem (X’)’ = X 4. Absorption Theorem a. X + XY = X b. X.(X+Y) = X 5. Simplification Theorem a. XY + XY’ = X b. (X+Y).(X+Y’) = X 6. Another Simplification Theorem a. X + X’Y = X + Y b. X.(X’ + Y) = X.Y CS 3402:A.Berrached

DeMorgan's Theorems 7. DeMorgan’s Theorem a. (X+Y)’ = X’ . Y’ b. (X.Y)’ = X’ + Y’ The complement of the sum is the product of the complements The complement of the product is the sum of the complements In general a. (A+B+….+Z)’ = A’ . B’ . … .Z’ b. (A.B.C….Z)’ = A’ + B’ + ….+Z’ CS 3402:A.Berrached

DeMorgan's Theorem (X + Y)' = X' • Y' NOR is equivalent to AND with inputs complemented (X • Y)' = X' + Y' NAND is equivalent to OR with inputs complemented DeMorgan’s Law can be used to get the complement of an expression {F(X1,X2,...,Xn,0,1,+,•)}' = {F(X1',X2',...,Xn',1,0,•,+)} Example: F = A B' C' + A' B' C + A B' C + A B C' F' = (A' + B + C) • (A + B + C') • (A' + B + C') • (A' + B' + C) CS 3402:A.Berrached

Function Representations Truth Table (Unique representation) Boolean Expressions Logic Diagrams From TO Boolean Expression ==> Logic Diagram Logic Diagram ==> Boolean Expression Boolean Expression ==> Truth Table Truth Table ==> Boolean Expression CS 3402:A.Berrached

Function Representations F(X,Y,Z) = X + Y’Z + X’Y’Z + X’Y’Z’ CS 3402:A.Berrached

Deriving Boolean Expression from Truth Table CS 3402:A.Berrached

Product and Sum Terms --Definitions Literal: A boolean variable or its complement X X’ A B’ Product term: A literal or the logical product (AND) of multiple literals: X XY XYZ X’YZ’ A’BC Note: X(YZ)' Sum term: A literal or the logical sum (OR) of multiple literals: X X’+Y X+Y+Z X’+Y+Z’ A’+B+C Note: X+(Y+Z)' CS 3402:A.Berrached

SOP & POS -- Definitions Sum of products (SOP) expression: The logic sum (OR) of multiple product terms: AB + A’C + B’ + ABC AB’C + B’D’ + A’CD’ Product of sums (POS) expression: The logic product (AND) of multiple sum terms: (A+B).( A’+C).B’.( A+B+C) (A’ + B + C).( C’ + D) Note: SOP expressions ==> 2-level AND-OR circuit POS expressions ==> 2-level OR-AND circuit CS 3402:A.Berrached

Minterms & Maxterms -- Definitions A Minterm: for an n variable function, a minterm is a product term that contains each of the n variables exactly one time in complemented or uncomplemented form. Example: if X, Y and Z are the input variables, the minterms are: X’Y’Z’ X’Y’Z X’YZ’ X’YZ XY’Z’ XY’Z XYZ’ XYZ A Maxterm: for an n variable function, a maxterm is a sum term that contains each of the n variables exactly one time in complemented or uncomplemented form Example: if X, Y and Z are the input variables, the maxterms are: X’+Y’+Z’ X’+Y’+Z X’+Y+Z’ X’+Y+Z X+Y’+Z’ X+Y’+Z X+Y+Z’ X+Y+Z CS 3402:A.Berrached

Minterms For functions of three variables: X, Y, and Z The bit combination associated with each minterm is the only bit combination for which the minterm is equal to1. Example: X'Y'Z' = 1 iff X=0, Y=0, and Z=0 Each bit represents one of the variables ( order is important) : Un-complemented variable ==> 1 Complemented variable ==> 0 CS 3402:A.Berrached

Maxterms The bit combination associated with each Maxterm is the only bit combination for which the Maxterm is equal to 0. Note: The ith Maxterm is the complement of the ith minterm; That is Mi = mi CS 3402:A.Berrached

Standard (Canonical) forms of an expression A switching function can be represented by several different, but equivalent, algebraic expressions. The standard form is a unique algebraic representation of each function. Standard SOP: sum of minterm form of a switching function Standard POS: the product of maxterm form ofa switching function Each switching function has a unique standard SOP and a unique standard POS. CS 3402:A.Berrached

Deriving Boolean Expression from Truth Table Input Output Minterm A B C F term designation 0 0 0 1 A’B’C’ m0 0 0 1 0 A’B’C m1 0 1 0 0 A’BC’ m2 0 1 1 1 A’BC m3 1 0 0 0 AB’C’ m4 1 0 1 0 AB’C m5 1 1 0 0 ABC’ m6 1 1 1 0 ABC m7 F is 1 iff (A=0 AND B=0 AND C=0) or (A=0 AND B=1 AND C=1) F is 1 iff (A’=1 AND B’=1 AND C’=1) or (A’=1 AND B=1 AND C=1) F is 1 iff A’.B’.C’ = 1 OR A’.B.C= 1 F is 1 iff A’B’C’ + A’BC = 1 => F = A’B’C’ + A’BC => F = m0 + m3 Short-hand notation: F =  m ( 0, 3) CS 3402:A.Berrached

Sum of minterms form A Boolean function is equal to the sum of minterms for which the output is one. => the sum of minterms (also called the standard SOP) form Example: F =  m ( 0, 3) CS 3402:A.Berrached

Deriving Boolean Expression from Truth Table Input Output Minterm Maxterm A B C F term Designation term Designation 0 0 0 1 A’B’C’ m0 A + B + C M0 0 0 1 0 A’B’C m1 A + B + C’ M1 0 1 0 0 A’BC’ m2 A + B’ + C M2 0 1 1 1 A’BC m3 A + B’ + C’ M3 1 0 0 0 AB’C’ m4 A’ + B + C M4 1 0 1 0 AB’C m5 A ‘ + B + C’ M5 1 1 0 0 ABC’ m6 A’ + B’ + C M6 1 1 1 0 ABC m7 A’ + B’ + C’ M7 F is 0 iff (A+B+C’) = 0 AND (A+B’+C)=0 AND (A’+B+C)=0 AND (A’+B+C’) =0 AND (A’+B’+C) = 0 AND (A’+B’+C’) = 0 => F = (A+B+C’) . (A+B’+C) . (A’+B+C) AND (A’+B+C’) . (A’+B’+C) . (A’+B’+C’) => F = M1.M2.M4.M5.M6.M7 ==> F =  M(1,2,4,5,6,7) CS 3402:A.Berrached

Product of Maxterms A Boolean function is equal to the product of Maxterms for which the output is 0. => the product of Maxterms (also called the standard Product of Sums) form Example: F =  M(1,2,4,5,6,7) CS 3402:A.Berrached

Examples: Find the truth table for the following switching functions: F(A,B,C) = ABC’ + AB’C F(A,B,C) = AB + A’B’ + AC F(X, Z) = X + Z’ F(A,B,C,D) = A(B’ + CD’) + A’BC’ For each of the above functions, find their Standard SOP and POS. CS 3402:A.Berrached

Getting Standard Forms of a Switching Function F(A,B,C) = AB + A’B’ + AC get standard SOP and POS forms of F Method 1: 1. Derive Truth Table for F 2. Get SOP and POS from truth table Method 2: Use Shannon’s Expansion Theorem CS 3402:A.Berrached

Shannon’s Expansion Theorem a) f(x1,x2,…,xn) = x1.f(1,x2,….,xn) + x1.f(0,x2,…,xn) b) f(x1,x2,…,xn) = [ x1+ f(0,x2,….,xn)] . [ x1.f(1,x2,…,xn)] CS 3402:A.Berrached

Incompletely Specified Functions The output for certain input combination is not important (I.e. we don't care about it). Certain input combinations never occur Example: Design a circuit that takes as input a BCD digit and outputs a 1 iff the parity of the input is even. Note: A BCD digit consists of 4 bits CS 3402:A.Berrached

Incompletely Specified Functions Block Diagram W X F Y Z CS 3402:A.Berrached

Incompletely Specified Functions Truth Table F =  m ( 0, 3, 5, 6, 9)+d(10…15) F =  M(1,2,4,7, 8)+ d(10…15) CS 3402:A.Berrached