Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean Logic.

Slides:



Advertisements
Similar presentations
Chapter 4 Gates and Circuits.
Advertisements

(CSC 102) Discrete Structures Lecture 5.
Sahar Mosleh PageCalifornia State University San Marcos 1 Introductory Concepts This section of the course introduces the concept of digital circuits and.
Types of Logic Circuits
Combinational 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.
Chapter 4 Gates and Circuits.
Section 10.3 Logic Gates.
9/19/06 Hofstra University – Overview of Computer Science, CSC005 1 Chapter 4 Gates and Circuits.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
10/25/2004EE 42 fall 2004 lecture 231 Lecture #23 Synthesis Next week: Converting gates into circuits.
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
Lecture 3. Boolean Algebra, Logic Gates
Propositional Calculus Math Foundations of Computer Science.
Combinational Digital Circuits. Measurement Our world is an analog world. Measurements that we make of the physical objects around us are never in discrete.
Logic Gates Circuits to manipulate 0’s and 1’s. 0’s and 1’s used for numbers Also to make decisions within the computer. In that context, 1 corresponds.
Binary Logic and Gates COE 202 Digital Logic Design Dr. Aiman El-Maleh
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
Chapter 4 Gates and Circuits. 4–2 Chapter Goals Identify the basic gates and describe the behavior of each Describe how gates are implemented using transistors.
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
Chapter 4 Gates and Circuits.
Lecture 3. Error Detection and Correction, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
1 CHAPTER 4: PART I ARITHMETIC FOR COMPUTERS. 2 The MIPS ALU We’ll be working with the MIPS instruction set architecture –similar to other architectures.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
1 Introduction to Abstract Mathematics Applications : Digital Logic Circuits 2.4 and Number Systems 2.5 Instructor: Hayk Melikya
XOR and XNOR Logic Gates. XOR Function Output Y is TRUE if input A OR input B are TRUE Exclusively, else it is FALSE. Logic Symbol  Description  Truth.
Chapter 3.5 Logic Circuits. How does Boolean algebra relate to computer circuits? Data is stored and manipulated in a computer as a binary number. Individual.
Copyright © Curt Hill Using Propositional Logic Several applications.
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
ADDERS Half Adders Recall that the basic rules of binary addition are as indicated below in Table 2-9. A circuit known as the half-adder carries out these.
1 The Chinese University of Hong Kong Faculty of Education Diploma in Education (Part-Time) Winter 1997 Educational Communications and Technology Assignment.
1 © 2015 B. Wilkinson Modification date: January 1, 2015 Designing combinational circuits Logic circuits whose outputs are dependent upon the values placed.
Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7.1 – 7.2 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean.
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.
Course contents Chapter 1 - section 1.6 Chapter 2 - all sections Chapter – 4.7, and 4.12 Chapter , Chapter 6 - all sections.
Copyright © 2004 by Miguel A. Marin1 COMBINATIONAL CIRCUIT SYNTHESIS CLASSIC TWO-LEVEL CIRCUIT SYNTHESIS MULTILEVEL-CIRCUIT SYNTHESIS FACTORIZATION DECOMPOSITION.
Logic Gates Logic gates are electronic digital circuit perform logic functions. Commonly expected logic functions are already having the corresponding.
4. Electrons and electronics 4.5 Digital electronics.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
Digital Logic. 2 Abstractions in CS (gates) Basic Gate: Inverter IO IO GNDI O Vcc Resister (limits conductivity) Truth Table.
How computers calculate How binary operations yield complex capabilities.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
Karnaugh Map and Circuit Design.
BOOLEAN ALGEBRA LOGIC GATES. Introduction British mathematician George Boole( ) was successful in finding the link between logic and mathematics.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean Logic.
WORKING PRINCIPLE OF DIGITAL LOGIC
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Chapter 12. Chapter Summary Boolean Functions Representing Boolean Functions Logic Gates Minimization of Circuits (not currently included in overheads)
Boolean Algebra & Logic Gates
Basics of Logic gates - Part 1
Truth Table to Statement Form
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Computer Science 210 Computer Organization
Unit 2 Boolean Algebra.
Fundamentals & Ethics of Information Systems IS 201
Copyright © Cengage Learning. All rights reserved.
Chapter 4 Gates and Circuits.
Computer Science 210 Computer Organization
Agenda – 2/12/18 Questions? Readings: CSI 4, P
Week 7: Gates and Circuits: PART II
Digital Logic.
Logic Gates.
Digital Logic.
Chapter 10.3 and 10.4: Combinatorial Circuits
Copyright © Cengage Learning. All rights reserved.
XOR Function Logic Symbol  Description  Truth Table 
Introductory Concepts
Copyright © Cengage Learning. All rights reserved.
Presentation transcript:

Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean Logic and Computer Logic

Section 7.2Logic Networks1 Combinational Networks Basic logic elements Imagine that the electrical voltages carried along wires fall into one of two ranges, high or low, which we shall represent by 1 and 0, respectively. Voltage fluctuations within these ranges are ignored, so we are forcing a discrete, indeed binary, mask on an analogue phenomenon. Also suppose that switches can be wired so that a signal of 1 causes the switch to be closed and a signal of 0 causes the switch to be open as seen in figure below. Combine two such switches, controlled by lines x 1 and x 2, in parallel. The figure below illustrates the various cases.

Section 7.2Logic Networks2 Basic Logic Elements The OR gate, Figure (a), behaves like the Boolean operation. The AND gate, Figure (b), represents the Boolean operation. Figure (c) shows an inverter, corresponding to the unary Boolean operation. Because of the associativity property for and, the OR and AND gates can have more than two inputs.

Section 7.2Logic Networks3 Boolean Expressions DEFINITION: BOOLEAN EXPRESSION A Boolean expression in n variables, x 1, x 2,..., x n, is any finite string of symbols formed by applying the following rules: 1. x 1, x 2,..., x n are Boolean expressions. 2. If P and Q are Boolean expressions, so are (P + Q), (P  Q), and (P). x 3, (x 1 + x 2 )x 3, (x 1 x 3 + x 4 )x 2, and (x 1 x 2 )x 1 are all Boolean expressions. In propositional logic, the logical connectives , , and are instances of the operations of a Boolean algebra.

Section 7.2Logic Networks4 Truth Functions DEFINITION: TRUTH FUNCTION A truth function is a function f such that f:{0,1} n  {0,1} for some integer n  1. The notation {0,1} n denotes the set of all n-tuples of 0s and 1s. A truth function thus associates a value of 0 or 1 with each such n-tuple. Example: The Boolean expression x 1 x 2 + x 3 defines the truth function given in Table 7.3 below:

Section 7.2Logic Networks5 Networks and Expressions By combining AND gates, OR gates, and inverters, we can construct a logic network representing a given Boolean expression that produces the same truth function as that expression. Example: Logic network for Boolean expression x 1 x 2 + x 3 is shown in the figure below: Example: Logic network for Boolean expression (x 1 x 2 + x 3 ) + x 3 is shown in the figure below:

Section 7.2Logic Networks6 Class Exercise Write a Boolean expression for the logic network in the figure below: (x 1 + x 2 ) x 3

Section 7.2Logic Networks7 Combinational Networks Logic networks constructed of AND gates, OR gates, and inverters are also called combinational networks. Combinational networks have several features of note: 1. Input or output lines are not tied together, except by passing through gates. 2. Lines can be split, however, to serve as input to more than one device. 3. There are no loops where the output of an element is part of the input to that same element. 4. Finally, the output of a network is an instantaneous function of the input; there are no delay elements that capture and remember input signals. Notice also that the picture of any network is, in effect, a directed graph.

Section 7.2Logic Networks8 Canonical Form Arrows in the following statement indicate a procedure that we can carry out: truth function  Boolean expression  logic network We can write a unique truth function from either a network or an expression. Given an expression, one can find a network with the same truth function. The converse is also true. The last part of the puzzle concerns how to get from an arbitrary truth function to an expression (and hence a network) having that truth function.

Section 7.2Logic Networks9 Algorithm: Sum-of-Products A sum-of-products expression to represent any truth function. For this algorithm, the input is a truth table representing a truth function on n variables x 1, x 2,..., x n. The output is a Boolean expression in disjunctive normal form with the same truth function. A pseudocode description of the algorithm is given in the next slide.

Section 7.2Logic Networks10 Algorithm: Sum-of-Products Sum-of-Products (truth table; integer n) //the truth table represents a truth function with n arguments; result is the //canonical sum-of-products expression for this truth function Local variables: sum //sum-of-products expression product //single term in sum, a product i //index for the columns of the table row //index for the rows of the table sum = empty

Section 7.2Logic Networks11 Algorithm: Sum-of-Products for row = 1 to 2 n do if truth value for row is 1 then initialize product; for i = 1 to n do if x i = 1 then put x i in product else put x i in product end if end for sum = sum + product end if end for if sum is empty then sum = x 1 x 1 end if write (“The canonical sum-of-products expression for this truth function is,” sum) end Sum-of-Products

Section 7.2Logic Networks12 Example: Canonical Form The network for the canonical sum-of-products form for the table shown below is shown in the figure below. We have drawn the inputs to each AND gate separately because it looks neater, but actually a single x 1, x 2, or x 3 input can be split as needed.

Section 7.2Logic Networks13 Equivalent Boolean Expressions DEFINITION: EQUIVALENT BOOLEAN EXPRESSIONS Two Boolean expressions are equivalent if they have the same truth functions. The expressions x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 and x 1 x 3 + x 2, for example, are equivalent Boolean expressions. They share the same truth table. Boolean algebra rules can be used to prove that these expressions are equivalent.

Section 7.2Logic Networks14 Boolean Algebra Using the properties of Boolean algebra, we can reduce: x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 to x 1 x 3 + x 2 x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 = x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 (idempotent property) = x 1 x 3 x 2 + x 1 x 3 x 2 + x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 + x 1 x 2 x 3 (1b) = x 1 x 3 (x 2 + x 2 ) + x 1 x 2 (x 3 + x 3 ) + x 1 x 2 (x 3 + x 3 )(3b) = x 1 x x 1 x x 1 x 2 1 (5a) = x 1 x 3 + x 1 x 2 + x 1 x 2 (4b) = x 1 x 3 + x 2 x 1 + x 2 x 1 (1b) = x 1 x 3 + x 2 (x 1 + x 1 ) (5a) = x 1 x 3 + x 2 1 (3b) = x 1 x 3 + x 2 (4b)

Section 7.2Logic Networks15 Useful Networks: Adder Designing a network that adds binary numbers, basic operation for a computer. We can express the sum as a single sum digit s (the right-hand digit of the actual sum) together with a single carry digit c; this gives us the two truth functions of Tables 7.7 and 7.8, respectively. The canonical sum-of-products form for each truth function is: s = x 1 x 2 + x 1 x 2 c = x 1 x 2 An equivalent Boolean expression for s is: s = (x 1 + x 2 )(x 1 x 2 )

Section 7.2Logic Networks16 Half-Adder Figure below shows a network with inputs x 1 and x 2 and outputs s and c. This device, for reasons that will be clear shortly, is called a half-adder.

Section 7.2Logic Networks17 Full-Adder To add two n-digit binary numbers, we add column by column from the low-order to the high-order digits. The i th column (except for the very first column) has as input its two binary digits x 1 and x 2 plus the carry digit from the addition of column i  1 to its right. A device is needed to incorporate the previous carry digit as input. This can be accomplished by adding x 1 and x 2 with a half- adder and then adding the previous carry digit c i - 1 (using another half-adder) to the result. Again, a sum digit sand final carry digit c i are output, where c i is 1 if either half-adder produces a 1 as its carry digit. The full- adder is shown in figure (b) in the next slide.

Section 7.2Logic Networks18 Full-Adder The full-adder is thus composed of two half-adders and an additional OR gate.

Section 7.2Logic Networks19 Other Logic Elements The figure to the right shows the standard symbol for the NAND gate (the NOT AND gate) and its truth function. The NAND gate alone is sufficient to realize any truth function because networks using only NAND gates can do the job of inverters, OR gates, and AND gates as seen in the figures (a), (b) and (c).

Section 7.2Logic Networks20 Other Logic Elements The NOR gate (the NOT OR gate) and its truth function appear in this Figure. A NAND network for a truth function can be constructed by replacing AND gates, OR gates, and inverters in the canonical form or a minimized form with the appropriate NAND networks, one can often obtain a simpler network by using the properties of NAND elements directly.