Boolean Algebra. Boolean Algebra. Boolean Algebra. Boolean Algebra



Similar documents
BOOLEAN ALGEBRA & LOGIC GATES

Boolean Algebra Part 1

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

Logic in Computer Science: Logic Gates

Switching Algebra and Logic Gates

Unit 3 Boolean Algebra (Continued)

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012

CSEE 3827: Fundamentals of Computer Systems. Standard Forms and Simplification with Karnaugh Maps

Karnaugh Maps. Circuit-wise, this leads to a minimal two-level implementation

Basic Logic Gates Richard E. Haskell

Logic Reference Guide

CHAPTER 3 Boolean Algebra and Digital Logic

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

CH3 Boolean Algebra (cont d)

Gates, Circuits, and Boolean Algebra

Chapter 2: Boolean Algebra and Logic Gates. Boolean Algebra

CSE140: Midterm 1 Solution and Rubric

exclusive-or and Binary Adder R eouven Elbaz reouven@uwaterloo.ca Office room: DC3576

Combinational circuits

Simplifying Logic Circuits with Karnaugh Maps

2.0 Chapter Overview. 2.1 Boolean Algebra

Boolean Algebra (cont d) UNIT 3 BOOLEAN ALGEBRA (CONT D) Guidelines for Multiplying Out and Factoring. Objectives. Iris Hui-Ru Jiang Spring 2010

Two-level logic using NAND gates

3.Basic Gate Combinations

CSE140: Components and Design Techniques for Digital Systems

Introduction. The Quine-McCluskey Method Handout 5 January 21, CSEE E6861y Prof. Steven Nowick

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

Section 1. Finding Common Terms

Factoring - Grouping

Understanding Logic Design

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

DEPARTMENT OF INFORMATION TECHNLOGY

Digital circuits make up all computers and computer systems. The operation of digital circuits is based on

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Binary Adders: Half Adders and Full Adders

BEGINNING ALGEBRA ACKNOWLEDMENTS

Boolean Design of Patterns

Gates & Boolean Algebra. Boolean Operators. Combinational Logic. Introduction

Combinational Logic Design

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Factoring - Greatest Common Factor

DESIGN OF GATE NETWORKS

Click on the links below to jump directly to the relevant section

1.4. Arithmetic of Algebraic Fractions. Introduction. Prerequisites. Learning Outcomes

2 : two cube. 5 : five cube. 10 : ten cube.

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

INCIDENCE-BETWEENNESS GEOMETRY

Read-only memory Implementing logic with ROM Programmable logic devices Implementing logic with PLDs Static hazards

Factoring Polynomials

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

Figure 8-1 Four Possible Results of Adding Two Bits

Lecture 8: Synchronous Digital Systems

So let us begin our quest to find the holy grail of real analysis.

To Evaluate an Algebraic Expression

FINDING THE LEAST COMMON DENOMINATOR

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, The Binary Adder

Properties of Real Numbers

MATH Fundamental Mathematics IV

COMPUTER SCIENCE. Paper 1 (THEORY)

SECTION C [short essay] [Not to exceed 120 words, Answer any SIX questions. Each question carries FOUR marks] 6 x 4=24 marks

6.080/6.089 GITCS Feb 12, Lecture 3

DERIVATIVES AS MATRICES; CHAIN RULE

Chapter 1. Computation theory

C H A P T E R Regular Expressions regular expression

CM2202: Scientific Computing and Multimedia Applications General Maths: 2. Algebra - Factorisation

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.

Karnaugh Maps (K-map) Alternate representation of a truth table

Matrix Algebra. Some Basic Matrix Laws. Before reading the text or the following notes glance at the following list of basic matrix algebra laws.

How To Factor By Gcf In Algebra 1.5

Lecture 5: Gate Logic Logic Optimization

Solutions Manual for How to Read and Do Proofs

AMC 10 Solutions Pamphlet TUESDAY, FEBRUARY 13, 2001 Sponsored by Mathematical Association of America University of Nebraska

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Algebraic expressions are a combination of numbers and variables. Here are examples of some basic algebraic expressions.

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell

A Course Material on DIGITAL PRINCIPLES AND SYSTEM DESIGN

Rotation Matrices and Homogeneous Transformations

SAT Math Facts & Formulas Review Quiz

Sequences. A sequence is a list of numbers, or a pattern, which obeys a rule.

Chapter 5. Rational Expressions

Adder.PPT(10/1/2009) 5.1. Lecture 13. Adder Circuits

Lecture 2 Matrix Operations

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Welcome to Math Video Lessons. Stanley Ocken. Department of Mathematics The City College of New York Fall 2013

Class One: Degree Sequences

6. BOOLEAN LOGIC DESIGN

Factoring Trinomials of the Form x 2 bx c

FACTORING OUT COMMON FACTORS

1.3 Polynomials and Factoring

Negative Integer Exponents

Binary full adder. 2-bit ripple-carry adder. CSE 370 Spring 2006 Introduction to Digital Design Lecture 12: Adders

So far we have investigated combinational logic for which the output of the logic devices/circuits depends only on the present state of the inputs.

Let s put together a Manual Processor

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

Using the ac Method to Factor

Lecture Notes in Discrete Mathematics. Marcel B. Finan Arkansas Tech University c All Rights Reserved

Transcription:

2 Ver..4 George Boole was an English mathematician of XIX century can operate on logic (or Boolean) variables that can assume just 2 values: /, true/false, on/off, closed/open Usually value is associated to True, while to alse 2 - Claudio ornaro 3 4 Boolean algebra is suited for representing binary events, that is conditions that can assume just 2 values A light bulb can be turned on or off unctions operating on Boolean variables are called Boolean functions and can only produce values or A Boolean function, computed on the Boolean variables v,v 2,...,v n is denoted as: ( v, v2,, v n A Boolean function can be defined in many ways, among them the truth table: a list of the values that produces for every possible combination of the variables )

5 6 (v,v 2,v 3 ) can be defined as shown on the right side: Each Boolean variable can assume only 2 values, thus n variables can produce 2 n possible combinations, and each one is a row of the table v 3 v 2 v Description of an event by using a Boolean function To pass a certain exam, a student must match one of the following conditions: s/he passes the written pre-test and then the oral discussion s/he passes the written test and then the oral discussion 7 8 Each event is either independent or dependent (from the independent events) Each event is assigned a Boolean variable: a pre-test, =passed b written test, =passed c oral test, =passed e exam, =passed 3 variables allow 8 (2 3 ) combinations The truth table for the Boolean function passing the exam then is: Meaning of this row: the student passed pre-test (a=), didn t pass (or try) written test (b=) and passed oral test (c=), thus s/he passes the whole exam (e=) a b c e

9 After looking carefully, condition a =, b =, and c = cannot happen, because the oral examination can be tried only when the pretest or the written test has been passed (or both) or that combination the exam is not passed, but this is an impossible condition, so it could be useful to indicate a don t care condition (usually represented by a ). A don t care mark will be eventually replaced by either a or a as needed in a next stage Boolean variables can be combined by using Boolean (or logic) operators into Boolean (or logic) expressions The result of a logic operation is still a logic value (true or false) The most important operators are: AND, OR, NOT EXOR NAND, NOR, EXNOR 2 Operator AND (logic product) symbol: (like the algebraic product), it is often omitted it combines 2 values and produces a result following the rules below: = = = = Result is True if both operands are True I go to sea if it is sunny AND it is warm X= it is sunny Y= it is warm Z= I go to sea Z = X Y Both condition must be true to have that I go to the sea be true

3 4 Operator OR (Inclusive OR, logic sum) symbol: + (like the algebraic sum) it combines 2 values and produces a result following the rules below: + = + = + = + = Result is True if at least one operand is True I take car if it is raining OR it is cold I use car if it is raining OR it is cold X= it is raining Y= it is cold Z= I use car Z = X + Y At least one condition must be true to have that I use car be true 5 6 Operator NOT symbol: a little line over the variable or the expression to be negated, or just a sign it applies to just one value and produces a result following the rules below: = = Result is True if the operand is alse, and vice versa Operator EX-OR (Exclusive OR) symbol: it combines 2 values and produces a result following the rules below: = = = = Result is True if just one operand is True

7 8 Logic Expressions A logic (or Boolean) expression is composed by: logic variables constants and logic operators parentheses Examples a b c ab c(d ae) c e Logic Expressions In a logic expression the operator with the maximum priority is NOT, followed by AND and then OR This means that the following expressions are equivalent = a + b c = a + (b c) 9 2 Logic Expressions Two expressions and 2 are said equivalent when each input variable combination produce the same output value on both functions (they have the same truth tables) s 2 x x Logic Expressions Two expressions and 2 are said complementary when each input variable combination produce an opposite output value on both functions (they have complementary truth tables) s a b 2 a b

2 22 Logic Expressions Two expressions and 2 are said dual when: each OR of corresponds to an AND of 2 and vice versa each of corresponds to an of 2 and v.v. the order of operator evaluation is the same a b ( c ) 2 a ( b ( c )) note the added parentheses Logic expression reduction A reduced expression is faster to be evaluated and the corresponding circuit is smaller, faster, and less power consuming Reduction can be accomplished in many ways, among them: Boolean algebra axioms and theorems Karnaugh maps 23 24 Axioms and Th. Theorem of duality: if an equivalence holds, the dual equivalence holds as well Axioms and theorems. x = x + = 2. x = x x + = x 3. x x = x + x = 4. x x = x x + x = x 5. x y = y x x +y = y +x Axioms and Th. 6. x y z = (x y) z = x+y+z = (x+y) + z = = x (y z) = = x + (y+z) = = y (x z) = y + (x+z) 7. De Morgan s Theorem x y z = x+y+z+ x+y+z+ = x y z 8. x y+x z = x (y+z) (x+y) (x+z) = x+y z 9. x+x y = x x (x+y) = x. x y + x y = x (x+y) (x+y) = x. x+x y = x+y x (x+y) = x y 2. x y = x y+x y = x y x y=x y=x y=xy+xy

25 26 Axioms and Th. Some demonstrations 9. x+x y = x +x y = x (+y) = x = x 8. b. (x+y) (x+z) = xx+xz+xy+yz = = x+xz+xy+yz = = x +xz+xy+yz = = x (+z+y)+yz = x +yz = x+yz. x y+x y = x (y+y) = x = x. x+x y = x +xy = x (+y)+xy = x+xy+xy = = x+y rule Axioms and Th. In the previous equalities, variables x, y, and z can be considered both as single variables or as full logic expressions E.g. from rule bis: (a b+c d) + = where the parentheses content is considered as x Note that the complementary of x y is NOT x y, but is x y and this for the De Morgan s Theorem is equal to x+y Examples of reduction Reduce the following expressions. A B AB ( A B) AB A B B ( A B) AB A ( A B) AB rule rule 3b everything rule b 2. ( A B) AB C BA A C B C C rule b rule 4 rule 27 Examples of reduction Another demonstration of rule x+x y = x +xy = x (y+y)+xy = = xy+xy+xy = xy+xy+xy+xy = [rule 4b] = x(y+y)+y(x+x) = x+y Any term in OR may be duplicated, triplicated, etc. following rule 4b (backward): x=x+x+x+ Any term in AND may be duplicated, triplicated, etc. following rule 4a (backward): x=x x x 28

29 3 Logic unctions and Truth Tables To obtain the truth table from a logic function, the output value for each combination of the input values must be computed Compute the truth table of the following function: (a,b,c) = (ab + b) c Logic unctions and Truth Tables abc ab b ab + b c (ab+b) c 3 32 Expressions in Canonical orms SP Canonical orm Logical sum of products (SP) Each term (called minterm) is a product of all the variables (some could be affirmed, other negated) Example this expression is composed by 4 minterms (a,b,c) = abc+abc+abc+abc Expressions in Canonical orms PS Canonical orm Logical product of sums (PS) Each term (called maxterm) is a sum of all the variables (some could be affirmed, other negated) Example this expression is composed by 3 maxterms (a,b,c) = (a+b+c) (a+b+c) (a+b+c)

33 34 rom Truth Table to SP Because the function must give for some specific combination of input values, for each row with output value : write a product of all the variables (minterm) Each minterm must give for a specific combination of the input variables, so: negate each variable whose value is on the input combination corresponding to the minterm Sum the minterms rom Truth Table to SP a b c abc (a,b,c) = abc+abc+abc+abc 35 36 rom Truth Table to PS Because the function must give for some specific combination of input values, for each row with output value : write a sum of all the variables (maxterm) Each maxterm must give for a specific combination of the input variables, so: negate each variable whose value is on the input combination corresponding to the maxterm Multiply the maxterms rom Truth Table to PS a b c ( a b c ) (a,b,c)=(a+b+c) (a+b+c) (a+b+c) (a+b+c)

37 38 Expressions in Canonical orms To canonicalize an SP expression If in a product a variable is missing (e.g. x) multiply the product by (x+x) and solve removing duplicates Example (x,y,z) = xyz+yz+z = xyz+(x+x)yz+(x+x)(y+y)z = xyz+xyz+xyz+xyz+xyz+xyz+xyz Expressions in Canonical orms To canonicalize a PS expression If in a sum a variable is missing (e.g. x) add to the sum the term x x and solve removing duplicates Example (x,y,z) = (x+y+z) (x+z) x = (x+y+z) (x+yy+z) (x+yy+zz) = (x+y+z) (x+y+z) (x+y+z) etc. 39 4 Logic Circuits A logical function can be implemented in a digital electronic circuit Input variables are input signals Output variables are output signals Signals have just 2 values: low and high, associated to logic values and Logic operators corresponds to logic gates (e.g. in an AND gate, the output signal is high only when the 2 input signals are high) Logic Gates AND OR NOT NAND = NOR = EXOR EX-NOR =

4 42 Logic Gates Multiple-input gates exists and are equivalent to more gates connected (thanks to the associative property), but are faster A multiple-input EXOR gate gives when the number of input with value is odd Logic Circuits of logic circuit equivalent to a logic expression = a b + c Note how operator priority is provided by the relative position of the gates a b c 43 44 Logic Circuits Examples a b c ( a bc) ( abc a b). our doors (A, B, C, and D) separate two rooms. The doors are operated by 3 switches (X, Y, and Z) that, when pressed, close some doors: X closes A and C, Y closes B and D, Z closes B and C. Draw the corresponding truth table that produces only when all the doors are closed. Determine the corresponding function with the least number of variables.

45 46 Examples XYZ ABCD D =Door closed (Note the truth table is the bold part, columns ABCD are just intermediate values) D=XYZ+XYZ=XY Examples 2. Design a digital circuit with inputs:. a 2C value D composed by bits a and b 2. a selector: one bit s and outputs:. a 2C value U composed by bits x and y 2. an overflow indicator: one bit w that works in this way: U = D if s= U = D if s= w = if the 2C operation produces an incorrect result 47 Examples sab D U xy w + + -2-2 - - + - -2 -- -- - + x=sab+sab+sab y=sab+sab+sab+sab w=sab