Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 Lecture 4 Boolean Algebra

2 Logical Statements °A proposition that may or may not be true: Today is Monday Today is Sunday It is raining °Compound Statements °More complicated expressions can be built from simpler ones: Today is Monday AND it is raining. Today is Sunday OR it is NOT raining Today is Monday AND today is NOT Monday -(This is a contradiction) °The expression as a whole is either true or false.

3 Things can get a little tricky… °Are these two statements equivalent? It is not nighttime and it is Monday OR it is raining and it is Monday. It is not nighttime or it is raining and Monday AND it is Monday.

4 Boolean Algebra °Formal logic: In formal logic, a statement (proposition) is a declarative sentence that is either true(1) or false (0). °It is easier to communicate with computers using formal logic. °Boolean variable: Takes only two values – either true (1) or false (0). They are used as basic units of formal logic.

5 Venn Diagrams 5 A A B A B A B A B A

6 Boolean Algebra °Boolean Algebra is a mathematical technique that provides the ability to algebraically simplify logic expressions. These simplified expressions will result in a logic circuit that is equivalent to the original circuit, yet requires fewer gates. A B C B+A C A B C AB+A(B+C)+B(B+C)

7 Boolean Algebra, Logic and Gates °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 a foundation for designing and analyzing digital systems! °A literal is a Boolean variable or its complement. A minterm of the Boolean variables x 1, x 2, …, x n is a Boolean product y 1 y 2 …y n, where y i = x i or y i = -x i. °Hence, a minterm is a product of n literals, with one literal for each variable.

8 Boolean Switching °Boolean (switching) variable x ∈ {0,1} 0, 1 are abstract symbols They may correspond to {false, true} in logic, {off, on} of a switch, {low voltage, high voltage} of a CMOS circuit, or other meanings °Boolean space {0,1} n °The configuration space of all possible {0,1 assignments to n Boolean variables E.g., the Boolean space spanned by (x1,x2) is {0,1} 2 = {0,1}×{0,1} = {00, 01, 10, 11}

9 Overview °Logic functions with 1’s and 0’s Building digital circuitry °Truth tables °Logic symbols and waveforms °Boolean algebra °Properties of Boolean Algebra Reducing functions Transforming functions

10 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 X 1 for now RESET, START_IT, or ADD1 later

11 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.

12 ° Examples: is read “Y is equal to A AND B.” is read “z is equal to x OR y.” is read “X is equal to NOT A.” Notation Examples  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”).  BAY  yxz   AX 

13 Operator Definitions  Operations are defined on the values "0" and "1" for each operator: AND 0 · 0 = 0 0 · 1 = 0 1 · 0 = 0 1 · 1 = 1 OR 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 1 NOT 10  01 

14 01 10 X XZ  Truth Tables °Truth table  a tabular listing of the values of a function for all possible combinations of values on its arguments °Example: Truth tables for the basic logic operations: 111 001 010 000 Z = X·Y YX AND OR XYZ = X+Y 000 011 101 111

15 °Using Switches Inputs: -logic 1 is switch closed -logic 0 is switch open Outputs: -logic 1 is light on -logic 0 is light off. NOT input: -logic 1 is switch open -logic 0 is switch closed Logic Function Implementation Switches in series => AND Switches in parallel => OR C Normally-closed switch => NOT

16 °Example: Logic Using Switches °Light is on (L = 1) for L(A, B, C, D) = and off (L = 0), otherwise. °Useful model for relay and CMOS gate circuits, the foundation of current digital logic circuits Logic Function Implementation – cont’d B A D C A (B C + D) = A B C + A D

17 Digital Systems °Analysis problem: Determine binary outputs for each combination of inputs °Design problem: given a task, develop a circuit that accomplishes the task Many possible implementation Try to develop “best” circuit based on some criterion (size, power, performance, etc.)........ Logic Circuit InputsOutputs

18 Toll Booth Controller °Consider the design of a toll booth controller °Inputs: quarter, car sensor °Outputs: gate lift signal, gate close signal °If driver pitches in quarter, raise gate. °When car has cleared gate, close gate. Logic Circuit $.25 Car? Raise gate Close gate

19 Describing Circuit Functionality: Inverter °Basic logic functions have symbols. °The same functionality can be represented with truth tables. Truth table completely specifies outputs for all input combinations. °The above circuit is an inverter. An input of 0 is inverted to a 1. An input of 1 is inverted to a 0. AY 01 10 InputOutput A Y Symbol Truth Table

20 The AND Gate °This is an AND gate. °So, if the two inputs signals are asserted (high) the output will also be asserted. Otherwise, the output will be deasserted (low). ABY 000 010 100 111 A B Y Truth Table

21 The OR Gate °This is an OR gate. °So, if either of the two input signals are asserted, or both of them are, the output will be asserted. ABY 000 011 101 111 A B Y

22 Describing Circuit Functionality: Waveforms °Waveforms provide another approach for representing functionality. °Values are either high (logic 1) or low (logic 0). °Can you create a truth table from the waveforms? ABY 000 010 100 111 AND Gate

23 Consider three-input gates 3 Input OR Gate

24 Ordering Boolean Functions °How to interpret A  B+C? Is it A  B ORed with C ? Is it A ANDed with B+C ? °Order of precedence for Boolean algebra: AND before OR. °Note that parentheses are needed here :

25 Boolean Algebra °A Boolean algebra is defined as a closed algebraic system containing a set K or two or more elements and the two operators,. and +. °Useful for identifying and minimizing circuit functionality °Identity elements a + 0 = a a. 1 = a °0 is the identity element for the + operation. °1 is the identity element for the. operation.

26 Commutatively and Associativity of the Operators °The Commutative Property: For every a and b in K, a + b = b + a a. b = b. a °The Associative Property: For every a, b, and c in K, a + (b + c) = (a + b) + c a. (b. c) = (a. b). c

27 Distributivity of the Operators and Complements °The Distributive Property: For every a, b, and c in K, a + ( b. c ) = ( a + b ). ( a + c ) a. ( b + c ) = ( a. b ) + ( a. c ) °The Existence of the Complement: For every a in K there exists a unique element called a’ (complement of a) such that, a + a’ = 1 a. a’ = 0 °To simplify notation, the. operator is frequently omitted. When two elements are written next to each other, the AND (.) operator is implied… a + b. c = ( a + b ). ( a + c ) a + bc = ( a + b )( a + c )

28 Duality °The principle of duality is an important concept. This says that if an expression is valid in Boolean algebra, the dual of that expression is also valid. °To form the dual of an expression, replace all + operators with. operators, all. operators with + operators, all ones with zeros, and all zeros with ones. °Form the dual of the expression a + (bc) = (a + b)(a + c) °Following the replacement rules… a(b + c) = ab + ac °Take care not to alter the location of the parentheses if they are present.

29 Involution °This theorem states: a’’ = a °Remember that aa’ = 0 and a+a’=1. Therefore, a’ is the complement of a and a is also the complement of a’. As the complement of a’ is unique, it follows that a’’=a. °Taking the double inverse of a value will give the initial value.

30 Absorption °This theorem states: a + ab = aa(a+b) = a °To prove the first half of this theorem: a + ab = a. 1 + ab = a (1 + b) = a (b + 1) = a (1) a + ab= a

31 DeMorgan’s Theorem °A key theorem in simplifying Boolean algebra expression is DeMorgan’s Theorem. It states: (a + b)’ = a’b’(ab)’ = a’ + b’ °Complement the expression a(b + z(x + a’)) and simplify. (a(b+z(x + a ’ ))) ’ = a ’ + (b + z(x + a ’ )) ’ = a ’ + b ’ (z(x + a ’ )) ’ = a ’ + b ’ (z ’ + (x + a ’ ) ’ ) = a ’ + b ’ (z ’ + x ’ a ’’ ) = a ’ + b ’ (z ’ + x ’ a)

32 Commutative Law Associative Law Distributive Law Consensus Theorem Boolean & DeMorgan’s Theorems DeMorgan’s

33 DeMorgan Shortcut BREAK THE LINE, CHANGE THE SIGN Break the LINE over the two variables, and change the SIGN directly under the line. For Theorem #14A, break the line, and change the AND function to an OR function. Be sure to keep the lines over the variables. For Theorem #14B, break the line, and change the OR function to an AND function. Be sure to keep the lines over the variables.

34 Summary °Basic logic functions can be made from AND, OR, and NOT (invert) functions °The behavior of digital circuits can be represented with waveforms, truth tables, or symbols °Primitive gates can be combined to form larger circuits °Boolean algebra defines how binary variables can be combined °Rules for associativity, commutativity, and distribution are similar to algebra °DeMorgan’s rules are important. Will allow us to reduce circuit sizes.


Download ppt "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."

Similar presentations


Ads by Google