 # Boolean Algebra. Binary Logic and Gates Binary variables take on one of two values. Logical operators operate on binary values and binary variables. Basic.

## Presentation on theme: "Boolean Algebra. Binary Logic and Gates Binary variables take on one of two values. Logical operators operate on binary values and binary variables. Basic."— Presentation transcript:

Boolean Algebra

Binary Logic and Gates Binary variables take on one of two values. 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!

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

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.

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 

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 

01 10 X XZ  Truth Tables 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

Truth Tables – Cont’d Used to evaluate any logic function Consider F(X, Y, Z) = X Y + Y Z XYZX YYY ZF = X Y + Y Z 0000100 0010111 0100000 0110000 1000100 1010111 1101001 1111001

Logic Gate Symbols and Behavior Logic gates have special symbols: And waveform behavior in time as follows : X 0011 Y0101 X · Y(AND)0001 X+ Y(OR)0111 (NOT)X 1100 OR gate X Y Z= X+ Y X Y Z= X · Y AND gate X Z= X NOT gate or inverter

Logic Diagrams and Expressions Boolean equations, truth tables and logic diagrams describe the same function! Truth tables are unique, but expressions and logic diagrams are not. This gives flexibility in implementing functions. X Y F Z Logic Diagram Logic Equation ZY X F  Truth Table 11 1 1 11 1 0 11 0 1 11 0 0 00 1 1 00 1 0 10 0 1 00 0 0 X Y Z Z Y X F   

NAND Gate 11 XYZ 001 011 101 110 X Y

NAND Gate as an Inverter Gate 12 XZ 01 10 X (Before Bubble) Equivalent to Inverter

NAND Gate as an AND Gate 13 XYZ 000 010 100 111 X Y NAND Gate Inverter Equivalent to AND Gate

NAND Gate as an OR Gate 14 XYZ 000 011 101 111 Equivalent to OR Gate X Y NAND Gate Inverters

NOR Gate XYZ 001 010 100 110 X Y 15

NOR Gate as an Inverter Gate XZ 01 10 X (Before Bubble) Equivalent to Inverter 16

NOR Gate as an OR Gate XYZ 000 011 101 111 X Y NOR Gate“Inverter” Equivalent to OR Gate 17

NOR Gate as an AND Gate XYZ 000 010 100 111 Equivalent to AND Gate X Y NOR Gate “Inverters” 18

Boolean Algebra Variable – a symbol used to represent a logical quantity. Complement – the inverse of a variable and is indicated by a bar over the variable. Literal – a variable or the complement of a variable.

1. 3. 5. 7. 9. 11. 13. 15. 17. Commutative Associative Distributive DeMorgan’s 2. 4. 6. 8. X. 1 X = X. 00 = X. XX = 0 = Boolean Algebra 10. 12. 14. 16. X + YY + X = (X + Y)Z + X + (YZ)Z) += X(Y + Z)XYXZ += X + YX. Y = XYYX = (XY)ZX(YX(YZ)Z) = X+ YZ(X + Y)(X + Z)= X. YX + Y = X + 0 X = + X 11 = X + XX = 1 = X = X  Invented by George Boole in 1854  An algebraic structure defined by a set B = {0, 1}, together with two binary operators (+ and ·) and a unary operator ( ) Idempotence Complement Involution Identity element

Useful Theorems Minimization X Y + X Y = Y Absorption X + X Y = X Simplification X + X Y = X + Y DeMorgan’s X + Y = X · Y  Minimization (dual) (X+Y)(X+Y) = Y  Absorption (dual) X · (X + Y) = X  Simplification (dual) X · (X + Y) = X · Y  DeMorgan’s (dual)  X · Y = X + Y

Some Properties of Boolean Algebra  Boolean Algebra is defined in general by a set B that can have more than two values  A two-valued Boolean algebra is also know as Switching Algebra. The Boolean set B is restricted to 0 and 1. Switching circuits can be represented by this algebra.  The dual of an algebraic expression is obtained by interchanging + and · and interchanging 0’s and 1’s.  The identities appear in dual pairs. When there is only one identity on a line the identity is self-dual, i. e., the dual expression = the original expression.  Sometimes, the dot symbol ‘  ’ (AND operator) is not written when the meaning is clear

Boolean Operator Precedence  The order of evaluation is: 1.Parentheses 2.NOT 3.AND 4.OR  Consequence: Parentheses appear around OR expressions  Example: F = A(B + C)(C + D)

Reducing Boolean expression

Example 1

Boolean Algebraic Proof – Example 1 A + A · B = A (Absorption Theorem) Proof StepsJustification A + A · B = A · 1 + A · B Identity element: A · 1 = A = A · ( 1 + B) Distributive = A · 1 1 + B = 1 = A Identity element Our primary reason for doing proofs is to learn: – Careful and efficient use of the identities and theorems of Boolean algebra, and – How to choose the appropriate identity or theorem to apply to make forward progress, irrespective of the application.

AB + AC + BC = AB + AC (Consensus Theorem) Proof StepsJustification = AB + AC + BC = AB + AC + 1 · BCIdentity element = AB + AC + (A + A) · BCComplement = AB + AC + ABC + ABCDistributive = AB + ABC + AC + ACBCommutative = AB · 1 + ABC + AC · 1 + ACBIdentity element = AB (1+C) + AC (1 + B)Distributive = AB. 1 + AC. 11+X = 1 = AB + ACIdentity element Boolean Algebraic Proof – Example 2

Truth Table to Verify DeMorgan’s XYX·YX·YX+YXY X · YX·YX·YX+Y 0000111111 0101100011 1001010011 1111000000 X + Y = X · Y X · Y = X + Y Generalized DeMorgan’s Theorem: X 1 + X 2 + … + X n = X 1 · X 2 · … · X n X 1 · X 2 · … · X n = X 1 + X 2 + … + X n

Simplification Using Boolean Algebra AB+A(B+C)+B(B+C) – (distributive law) AB+AB+AC+BB+BC – (rule 7; BB=B) AB+AB+AC+B+BC – (rule 5; AB+AB=AB) AB+AC+B+BC – (rule 10; B+BC=B) AB+AC+B – (rule 10; AB+B=B) B+AC A B C A B C AB+A(B+C)+B(B+C)

Download ppt "Boolean Algebra. Binary Logic and Gates Binary variables take on one of two values. Logical operators operate on binary values and binary variables. Basic."

Similar presentations