Module #23 – Boolean Algebra 1 Chapter 11 Boolean Algebra Rosen 6 th ed., ch. 11.

Slides:



Advertisements
Similar presentations
Techniques for Combinational Logic Optimization
Advertisements

Boolean Algebra and Logic Gates
Lecture 5 EGRE 254 1/28/09. 2 Boolean algebra a.k.a. “switching algebra” –deals with Boolean values -- 0, 1 Positive-logic convention –analog voltages.
Chapter 2 Logic Circuits.
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.
1 Section 10.1 Boolean Functions. 2 Computers & Boolean Algebra Circuits in computers have inputs whose values are either 0 or 1 Mathematician George.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
Logic Gate Level Combinational Circuits, Part 1. Circuits Circuit: collection of devices physically connected by wires to form a network Net can be: –
Lecture 3. Boolean Algebra, Logic Gates
Propositional Calculus Math Foundations of Computer Science.
Chapter 2: Boolean Algebra and Logic Functions
11.1 Boolean Functions. Boolean Algebra An algebra is a set with one or more operations defined on it. A boolean algebra has three main operations, and,
Boolean Algebra Computer Organization 1 © McQuain Boolean Algebra A Boolean algebra is a set B of values together with: -two binary operations,
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.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
1 Logic Gates Digital Computer Logic Kashif Bashir WWW:
IKI a-Boolean Algebra Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture Notes at UIUC,
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Boolean Algebra and Digital Circuits
ECE 331 – Digital System Design
Digital Logic Basics Chapter 2 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer, 
F = ∑m(1,4,5,6,7) F = A’B’C+ (AB’C’+AB’C) + (ABC’+ABC) Use X’ + X = 1.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
CS1502 Formal Methods in Computer Science
Combinational Logic 1.
Discrete Mathematics and Its Applications.  The English mathematician George Boole ( ) sought to give symbolic form to Aristotle's system of.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Logic Gates Shashidhara H S Dept. of ISE MSRIT. Basic Logic Design and Boolean Algebra GATES = basic digital building blocks which correspond to and perform.
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
LOGIC GATES & BOOLEAN ALGEBRA
Discrete Mathematics CS 2610 February 12, Agenda Previously Finished functions Began Boolean algebras And now Continue with Boolean algebras.
1 Boolean Algebra  Digital circuits Digital circuits  Boolean Algebra Boolean Algebra  Two-Valued Boolean Algebra Two-Valued Boolean Algebra  Boolean.
June 11, 2002© Howard Huang1 Boolean algebra Last time we talked about Boolean functions, Boolean expressions, and truth tables. Today we’ll learn.
Discrete Mathematics CS 2610 September Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n )  B.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Lecture 4 Boolean Algebra. Logical Statements °A proposition that may or may not be true: Today is Monday Today is Sunday It is raining °Compound Statements.
1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
Boolean Functions and Boolean Algebra Laxmikant Kale.
Lecture 3 Boolean algebra Topics Error Correcting Codes Boolean algebra Combinational circuits Algebraic analysis, Truth tables, Logic Diagrams Sums-of-Products.
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.
Boolean Algebra.
CHAPTER 2 Boolean algebra and Logic gates
Chapter 12. Chapter Summary Boolean Functions Representing Boolean Functions Logic Gates Minimization of Circuits (not currently included in overheads)
Boolean Algebra & Logic Gates
Digital Logic.
CS2100 Computer Organisation
Chapter 11 (Part 1): Boolean Algebra
Chapter 2: Boolean Algebra and Logic Functions
14:332:231 DIGITAL LOGIC DESIGN Boolean Algebra
CS 105 Digital Logic Design
… and now for the Final Topic:
ECE 331 – Digital System Design
EEL 3705 / 3705L Digital Logic Design
CSE 311 Foundations of Computing I
Boolean Algebra.
EEL 3705 / 3705L Digital Logic Design
ICS 241 Discrete Mathematics II
EEL 3705 / 3705L Digital Logic Design
Discrete Mathematics CS 2610
Boolean Algebra.
Boolean Algebra & Logic Circuits
Chapter 2 Boolean Algebra and Logic Gate
CSE 370 – Winter Combinational Logic - 1
Functions Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways: We can represent.
Representing Boolean functions
January 19 W’05 Yutao He 4532B Boelter Hall CSM51A/EEM16-Sec.1 W’05
Chapter 2 Introduction to Logic Circuits
From now on: Combinatorial Circuits:
Logic Circuits I Lecture 3.
Presentation transcript:

Module #23 – Boolean Algebra 1 Chapter 11 Boolean Algebra Rosen 6 th ed., ch. 11

Module #23 – Boolean Algebra 2 What is Boolean Algebra? A minor generalization of propositional logic.A minor generalization of propositional logic. –In general, an algebra is any mathematical structure satisfying certain standard algebraic axioms. Such as associative/commutative/transitive laws, etc.Such as associative/commutative/transitive laws, etc. –General theorems that are proved about an algebra then apply to any structure satisfying these axioms. Boolean algebra just generalizes the rules of propositional logic to sets other than {T,F}.Boolean algebra just generalizes the rules of propositional logic to sets other than {T,F}. –E.g., to the set {0,1} of base-2 digits, or the set {V L, V H } of low and high voltage levels in a circuit. We will see that this algebraic perspective lends itself to the design of digital logic circuits.We will see that this algebraic perspective lends itself to the design of digital logic circuits. Claude Shannon’s Master’s thesis!

Module #23 – Boolean Algebra 3 Boolean Algebra Sections of chapter 11:Sections of chapter 11: §1 – Boolean Functions §2 – Representing Boolean Functions §3 – Logic Gates §4 – Minimization of Circuits

Module #23 – Boolean Algebra 4 §11.1 – Boolean Functions Boolean complement, sum, product.Boolean complement, sum, product. Boolean expressions and functions.Boolean expressions and functions. Boolean algebra identities.Boolean algebra identities. Duality.Duality. Abstract definition of a Boolean algebra.Abstract definition of a Boolean algebra.

Module #23 – Boolean Algebra 5 Complement, Sum, Product Correspond to logical NOT, OR, and AND.Correspond to logical NOT, OR, and AND. We will denote the two logic values as 0:≡F and 1:≡T, instead of False and True.We will denote the two logic values as 0:≡F and 1:≡T, instead of False and True. –Using numbers encourages algebraic thinking. New, more algebraic-looking notation for the most common Boolean operators:New, more algebraic-looking notation for the most common Boolean operators: Precedence order→

Module #23 – Boolean Algebra 6 Boolean Functions Let B = {0, 1}, the set of Boolean values.Let B = {0, 1}, the set of Boolean values. For all n  Z +, any function f:B n →B is called a Boolean function of degree n.For all n  Z +, any function f:B n →B is called a Boolean function of degree n. There are 2 2 ⁿ (wow!) distinct Boolean functions of degree n.There are 2 2 ⁿ (wow!) distinct Boolean functions of degree n. –B/c  2 n rows in truth table, w. 0 or 1 in each. Degree How manyDegree How many , ,294,967, ,446,744,073,709,551,

Module #23 – Boolean Algebra 7 Boolean Expressions Let x 1, …, x n be n different Boolean variables.Let x 1, …, x n be n different Boolean variables. –n may be as large as desired. A Boolean expression (recursive definition) is a string of one of the following forms:A Boolean expression (recursive definition) is a string of one of the following forms: –Base cases: 0, 1, x 1, …, or x n. –Recursive cases: E 1, (E 1 E 2 ), or (E 1 +E 2 ), where E 1 and E 2 are Boolean expressions. A Boolean expression represents a Boolean function.A Boolean expression represents a Boolean function. –Furthermore, every Boolean function (of a given degree) can be represented by a Boolean expression.

Module #23 – Boolean Algebra 8 Hypercube Representation A Boolean function of degree n can be represented by an n-cube (hypercube) with the corresponding function value at each vertex.A Boolean function of degree n can be represented by an n-cube (hypercube) with the corresponding function value at each vertex. (0,0,0)(0,0,1) (0,1,0) (0,1,1) (1,0,0) (1,0,1) (1,1,0) (1,1,1) (a, b, c)

Module #23 – Boolean Algebra 9 Boolean equivalents, operations on Boolean expressions Two Boolean expressions e 1 and e 2 that represent the exact same function f are called equivalent. We write e 1  e 2, or just e 1 =e 2.Two Boolean expressions e 1 and e 2 that represent the exact same function f are called equivalent. We write e 1  e 2, or just e 1 =e 2. –Implicitly, the two expressions have the same value for all values of the free variables appearing in e 1 and e 2. The operators ¯, +, and · can be extended from operating on expressions to operating on the functions that they represent, in the obvious way.The operators ¯, +, and · can be extended from operating on expressions to operating on the functions that they represent, in the obvious way.

Module #23 – Boolean Algebra 10 Some popular Boolean identities Double complement:Double complement: x = x Idempotent laws:Idempotent laws: x + x = x, x · x = x Identity laws:Identity laws: x + 0 = x, x · 1 = x Domination laws:Domination laws: x + 1 = 1, x · 0 = 0 Commutative laws:Commutative laws: x + y = y + x, x · y = y · x Associative laws:Associative laws: x + (y + z) = (x + y) + z x · (y · z) = (x · y) · z Distributive laws:Distributive laws: x + y·z = (x + y)·(x + z) x · (y + z) = x·y + x·z De Morgan’s laws:De Morgan’s laws: (x · y) = x + y, (x + y) = x · y Absorption laws:Absorption laws: x + x·y = x, x · (x + y) = x ← Not true in ordinary algebras. also, the Unit Property: x + x = 1 and Zero Property: x · x = 0

Module #23 – Boolean Algebra 11 Duality The dual e d of a Boolean expression e representing function f is obtained by exchanging + with ·, and 0 with 1 in e.The dual e d of a Boolean expression e representing function f is obtained by exchanging + with ·, and 0 with 1 in e. –The function represented by e d is denoted f d. Duality principle: If e 1  e 2 then e 1 d  e 2 d.Duality principle: If e 1  e 2 then e 1 d  e 2 d. –Example: The equivalence x(x+y) = x implies (and is implied by) x + xy = x.

Module #23 – Boolean Algebra 12 Boolean Algebra, in the abstract A general Boolean algebra is any set B having elements 0, 1, two binary operators  and a unary operator  that satisfies the following laws:A general Boolean algebra is any set B having elements 0, 1, two binary operators  and a unary operator  that satisfies the following laws: –Identity laws: x  0 = x, x  1 = x –Complement laws: x   x = 1, x   x = 0 –Associative laws:(x  y)  z = x  (y  z), (x  y)  z = x  (y  z) –Commutative laws: x  y = y  x, x  y = y  x –Distributive laws: x  (y  z) = (x  y)  (x  z), x  (y  z)=(x  y)  (x  z). Note that B may generally have other elements besides 0, 1, and we have not fully defined any of the operators!

Module #23 – Boolean Algebra 13 §11.2 – Representing Boolean Functions Sum-of-products ExpansionsSum-of-products Expansions –A.k.a. Disjunctive Normal Form (DNF) Product-of-sums ExpansionsProduct-of-sums Expansions –A.k.a. Conjunctive Normal Form (CNF) Functional CompletenessFunctional Completeness –Minimal functionally complete sets of operators.

Module #23 – Boolean Algebra 14 Sum-of-Products Expansions Theorem: Any Boolean function can be represented as a sum of products of variables and their complements.Theorem: Any Boolean function can be represented as a sum of products of variables and their complements. –Proof: By construction from the function’s truth table. For each row that is 1, include a term in the sum that is a product representing the condition that the variables have the values given for that row. Show an example on the board.

Module #23 – Boolean Algebra 15 Literals, Minterms, DNF A literal is a Boolean variable or its complement.A literal is a Boolean variable or its complement. A minterm of Boolean variables x 1,…,x n is a Boolean product of n literals y 1 …y n, where y i is either the literal x i or its complement x i.A minterm of Boolean variables x 1,…,x n is a Boolean product of n literals y 1 …y n, where y i is either the literal x i or its complement x i. –Note that at most one minterm can have the value 1. The disjunctive normal form (DNF) of a degree-n Boolean function f is the unique sum of minterms of the variables x 1,…,x n that represents f.The disjunctive normal form (DNF) of a degree-n Boolean function f is the unique sum of minterms of the variables x 1,…,x n that represents f. –A.k.a. the sum-of-products expansion of f.

Module #23 – Boolean Algebra 16 Conjunctive Normal Form A maxterm is a sum of literals.A maxterm is a sum of literals. CNF is a product-of-maxterms representation.CNF is a product-of-maxterms representation. To find the CNF representation for f,To find the CNF representation for f, take the DNF representation for complement  f,take the DNF representation for complement  f,  f = ∑ i ∏ j y i,j  f = ∑ i ∏ j y i,j and then complement both sides & apply DeMorgan’s laws to get:and then complement both sides & apply DeMorgan’s laws to get: f = ∏ i ∑ j  y i,j Can also get CNF more directly, using the 0 rows of the truth table.

Module #23 – Boolean Algebra 17 Functional Completeness Since every Boolean function can be expressed in terms of ·,+,¯, we say that the set of operators {·,+,¯} is functionally complete.Since every Boolean function can be expressed in terms of ·,+,¯, we say that the set of operators {·,+,¯} is functionally complete. There are smaller sets of operators that are also functionally complete.There are smaller sets of operators that are also functionally complete. –We can eliminate either · or + using DeMorgan’s law. NAND | and NOR ↓ are also functionally complete, each by itself (as a singleton set).NAND | and NOR ↓ are also functionally complete, each by itself (as a singleton set). –E.g.,  x = x|x, and xy = (x|y)|(x|y).

Module #23 – Boolean Algebra 18 §11.3 – Logic Gates Inverter, Or, And gate symbols.Inverter, Or, And gate symbols. Multi-input gates.Multi-input gates. Logic circuits and examples.Logic circuits and examples. Adders, “half,” “full,” and n-bit.Adders, “half,” “full,” and n-bit.

Module #23 – Boolean Algebra 19 Logic Gate Symbols Inverter (logical NOT, Boolean complement).Inverter (logical NOT, Boolean complement). AND gate (Boolean product).AND gate (Boolean product). OR gate (Boolean sum).OR gate (Boolean sum). XOR gate (exclusive-OR, sum mod 2).XOR gate (exclusive-OR, sum mod 2). x x y x·y x y x+y y x x⊕yx⊕y

Module #23 – Boolean Algebra 20 Multi-input AND, OR, XOR Can extend these gates to arbitrarily many inputs.Can extend these gates to arbitrarily many inputs. Two commonly seen drawing styles:Two commonly seen drawing styles: –Note that the second style keeps the gate icon relatively small. x1x1 x1x2x3x1x2x3 x2x2 x3x3 x1⋮x5x1⋮x5 x 1 …x 5

Module #23 – Boolean Algebra 21 NAND, NOR, XNOR Just like the earlier icons, but with a small circle on the gate’s output.Just like the earlier icons, but with a small circle on the gate’s output. –Denotes that output is complemented. The circles can also be placed on inputs.The circles can also be placed on inputs. –Means, input is complemented before being used. x y x y y x

Module #23 – Boolean Algebra 22 Buffer What about an inverter symbol without a circle?What about an inverter symbol without a circle? This is called a buffer. It is the identity function.This is called a buffer. It is the identity function. It serves no logical purpose, but…It serves no logical purpose, but… It represents an explicit delay in the circuit.It represents an explicit delay in the circuit. –This is sometimes useful for timing purposes. All gates, when physically implemented, incur a non-zero delay between when their inputs are seen and when their outputs are ready.All gates, when physically implemented, incur a non-zero delay between when their inputs are seen and when their outputs are ready. x x

Module #23 – Boolean Algebra 23 Combinational Logic Circuits Note: The correct word to use here is “combinational,” NOT “combinatorial!”Note: The correct word to use here is “combinational,” NOT “combinatorial!” –Many sloppy authors get this wrong. These are circuits composed of Boolean gates whose outputs depend only on their most recent inputs, not on earlier inputs.These are circuits composed of Boolean gates whose outputs depend only on their most recent inputs, not on earlier inputs. –Thus these circuits have no useful memory. Their state persists while the inputs are constant, but is irreversibly lost when the input signals change.Their state persists while the inputs are constant, but is irreversibly lost when the input signals change.

Module #23 – Boolean Algebra 24 Combinational Circuit Examples Draw a few examples on the board:Draw a few examples on the board: –Majority voting circuit. –XOR using OR / AND / NOT. –3-input XOR using OR / AND / NOT. Also, show some binary adders:Also, show some binary adders: –Half adder using OR/AND/NOT. –Full adder from half-adders. –Ripple-carry adders.

Module #23 – Boolean Algebra 25 §11.4 – Minimizing Circuits Karnaugh MapsKarnaugh Maps Don’t care conditionsDon’t care conditions The Quine-McCluskey MethodThe Quine-McCluskey Method

Module #23 – Boolean Algebra 26 Goals of Circuit Minimization (1) Minimize the number of primitive Boolean logic gates needed to implement the circuit.(1) Minimize the number of primitive Boolean logic gates needed to implement the circuit. –Ultimately, this also roughly minimizes the number of transistors, the chip area, and the cost. Also roughly minimizes the energy expenditureAlso roughly minimizes the energy expenditure –among traditional irreversible circuits. –This will be our focus. (2) It is also often useful to minimize the number of combinational stages or logical depth of the circuit.(2) It is also often useful to minimize the number of combinational stages or logical depth of the circuit. –This roughly minimizes the delay or latency through the circuit, the time between input and output.

Module #23 – Boolean Algebra 27 Minimizing DNF Expressions Using DNF (or CNF) guarantees there is always some circuit that implements any desired Boolean function.Using DNF (or CNF) guarantees there is always some circuit that implements any desired Boolean function. –However, it may be far larger than needed! We would like to find the smallest sum-of- products expression that yields a given function.We would like to find the smallest sum-of- products expression that yields a given function. –This will yield a fairly small circuit. –However, circuits of other forms (not CNF or DNF) might be even smaller for complex functions.