Download presentation
Presentation is loading. Please wait.
Published byEgbert Smith Modified over 9 years ago
1
Binary Logic and Gates Boolean Algebra Canonical and Standard Forms Chapter 2: Boolean Algebra and Logic Gates
2
Chapter 2 - Part 1 2 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 foundation for designing and analyzing digital systems!
3
Chapter 2 - Part 1 3 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
4
Chapter 2 - Part 1 4 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.
5
Chapter 2 - Part 1 5 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
6
Chapter 2 - Part 1 6 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
7
Chapter 2 - Part 1 7 01 10 X NOT 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
8
Chapter 2 - Part 1 8 Using Switches For inputs: logic 1 is switch closed logic 0 is switch open For outputs: logic 1 is light on logic 0 is light off. NOT uses a switch such that: 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
9
Chapter 2 - Part 1 9 Example: Logic Using Switches Light is on (L = 1) for L(A, B, C, D) = and off (L = 0), otherwise. Useful model for relay circuits and for CMOS gate circuits, the foundation of current digital logic technology Logic Function Implementation (Continued) B A D C
10
Chapter 2 - Part 1 10 Logic Gates In the earliest computers, switches were opened and closed by magnetic fields produced by energizing coils in relays. The switches in turn opened and closed the current paths. Later, vacuum tubes that open and close current paths electronically replaced relays. Today, transistors are used as electronic switches that open and close current paths.
11
Chapter 2 - Part 1 11 Logic Gates (continued) Implementation of logic gates with transistors (See Reading Supplement CMOS Circuits) Transistor or tube implementations of logic functions are called logic gates or just gates Transistor gate circuits can be modeled by switch circuits
12
Chapter 2 - Part 1 12 Logic Gate Symbols and Behavior Logic gates have special symbols: And waveform behavior in time as follows :
13
Chapter 2 - Part 1 13 Logic Diagrams and Expressions Boolean equations, truth tables and logic diagrams describe the same function! Truth tables are unique; expressions and logic diagrams are not. This gives flexibility in implementing functions. X Y F Z Logic Diagram 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
14
Chapter 2 - Part 1 14 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 An algebraic structure defined on a set of at least two elements, B, together with three binary operators (denoted +, · and ) that satisfies the following basic identities: 10. 12. 14. 16. X + YY + X = (X + Y)Z + X + (YZ)Z) += X(Y + Z) 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
15
Chapter 2 - Part 1 15 The identities above are organized into pairs. These pairs have names as follows: 1-4 Existence of 0 and 1 5-6 Idempotence 7-8 Existence of complement 9 Involution 10-11 Commutative Laws 12-13 Associative Laws 14-15 Distributive Laws 16-17 DeMorgan’s Laws If the meaning is unambiguous, we leave out the symbol “·” Some Properties of Identities & the 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.
16
Chapter 2 - Part 1 16 Unless it happens to be self-dual, the dual of an expression does not equal the expression itself. Example: F = (A + C) · B + 0 dual F = (A · C + B) · 1 = A · C + B Example: G = X · Y + (W + Z) dual G = Example: H = A · B + A · C + B · C dual H = Are any of these functions self-dual? Some Properties of Identities & the Algebra (Continued)
17
Chapter 2 - Part 1 17 There can be more that 2 elements in B, i. e., elements other than 1 and 0. What are some common useful Boolean algebras with more than 2 elements? 1. 2. If B contains only 1 and 0, then B is called the switching algebra which is the algebra we use most often. Some Properties of Identities & the Algebra (Continued) Algebra of Sets Algebra of n-bit binary vectors
18
Chapter 2 - Part 1 18 Boolean Operator Precedence The order of evaluation in a Boolean expression is: 1.Parentheses 2.NOT 3.AND 4.OR Consequence: Parentheses appear around OR expressions Example: F = A(B + C)(C + D)
19
Chapter 2 - Part 1 19 Example 1: Boolean Algebraic Proof A + A·B = A (Absorption Theorem) Proof Steps Justification (identity or theorem) A + A·B =A · 1 + A · B X = X · 1 = A · ( 1 + B) X · Y + X · Z = X ·(Y + Z)(Distributive Law) = A · 1 1 + X = 1 = A X · 1 = X 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.
20
Chapter 2 - Part 1 20 AB + AC + BC = AB + AC (Consensus Theorem) Proof Steps Justification (identity or theorem) AB + AC + BC = AB + AC + 1 · BC ? = AB +AC + (A + A) · BC ? = Example 2: Boolean Algebraic Proofs
21
Chapter 2 - Part 1 21 Example 3: Boolean Algebraic Proofs Proof Steps Justification (identity or theorem) = YXZ)YX( )ZX(XZ)YX( YY
22
Chapter 2 - Part 1 22 xy y Useful Theorems ninimizatioMyyyxyyyx tionSimplifica yxyxyxyx Consensuszyxzyzyx zyxzyzyx Laws sDeMorgan'xx xx x x xx xx yx y
23
Chapter 2 - Part 1 23 Proof of Simplification yyyxyyyx x x
24
Chapter 2 - Part 1 24 Proof of DeMorgan’s Laws yxx y yx yx
25
Chapter 2 - Part 1 25 Boolean Function Evaluation z x yx F4 x z yx zyx F3 x F2 xy F1 z yz y
26
Chapter 2 - Part 1 26 Expression Simplification An application of Boolean algebra Simplify to contain the smallest number of literals (complemented and uncomplemented variables): = AB + ABCD + A C D + A C D + A B D = AB + AB(CD) + A C (D + D) + A B D = AB + A C + A B D = B(A + AD) +AC = B (A + D) + A C 5 literals DCBADCADBADCABA
27
2- 27 Complement of a Function 1. Use DeMorgan's Theorem :Interchange AND and OR operators 2.Complement each constant value and literal generalizations (A+B+C+... +F)' = A'B'C'... F' (ABC... F)' = A'+ B'+C'+... +F'
28
Chapter 2 - Part 1 28 Complementing Functions (A+B+C)' = (A+X)'let B+C = X = A'X' by DeMorgan's = A'(B+C)' = A'(B'C') by DeMorgan's = A'B'C' associative Example: Complement F = F = (x + y + z)(x + y + z) Example: Complement G = (a + bc)d + e G = x zyzyx
29
2- 29 Canonical and Standard Forms Minterms and Maxterms A minterm: an AND term consists of all literals in their normal form or in their complement form For example, two binary variables x and y, xy, xy', x'y, x'y' It is also called a standard product n variables can be combined to form 2 n minterms A maxterm: an OR term It is also call a standard sum 2 n maxterms
30
2- 30 each maxterm is the complement of its corresponding minterm, and vice versa
31
2- 31 An Boolean function can be expressed by a truth table sum of minterms f 1 = x'y'z + xy'z' + xyz = m 1 + m 4 +m 7 f 2 = x'yz+ xy'z + xyz'+xyz = m 3 + m 5 +m 6 + m 7
32
2- 32 The complement of a Boolean function the minterms that produce a 0 f 1 ' = m 0 + m 2 +m 3 + m 5 + m 6 = x'y'z'+x'yz'+x'yz+xy'z+xyz' f 1 = (f 1 ')' = (x+y+z)(x+y'+z) (x+y'+z') (x'+y+z')(x'+y'+z)= M 0 M 2 M 3 M 5 M 6 Any Boolean function can be expressed as a sum of minterms a product of maxterms canonical form
33
2- 33 Sum of minterms F = A+B'C = A (B+B') + B'C = AB +AB' + B'C = AB(C+C') + AB'(C+C') + (A+A')B'C =ABC+ABC'+AB'C+AB'C'+A'B'C F = A'B'C +AB'C' +AB'C+ABC'+ ABC = m 1 + m 4 +m 5 + m 6 + m 7 F(A,B,C) = (1, 4, 5, 6, 7) or, built the truth table first
34
2- 34 Product of maxterms x + yz = (x + y)(x + z) = (x+y+zz')(x+z+yy') =(x+y+z)(x+y+z’)(x+y'+z) F = xy + x'z = (xy + x') (xy +z) = (x+x')(y+x')(x+z)(y+z) = (x'+y)(x+z)(y+z) x'+y = x' + y + zz' = (x'+y+z)(x'+y+z') F = (x+y+z)(x+y'+z)(x'+y+z)(x'+y+z') = M 0 M 2 M 4 M 5 F(x,y,z) = (0,2,4,5)
35
2- 35 Conversion between Canonical Forms F(A,B,C) = (1,4,5,6,7) F'(A,B,C) = (0,2,3) By DeMorgan's theorem F(A,B,C) = (0,2,3) m j ' = M j sum of minterms = product of maxterms interchange the symbols and and list those numbers missing from the original form of 1's of 0's
36
2- 36 Example F = xy + xz F(x, y, z) = (1, 3, 6, 7) F(x, y, z) = (0, 2, 4, 6)
37
2- 37 Standard Forms Canonical forms are seldom used sum of products F 1 = y' + zy+ x'yz' product of sums F 2 = x(y'+z)(x'+y+z'+w) F 3 = A'B'CD+ABC'D'
38
2- 38 Two-level implementation Multi-level implementation
39
2- 39 Other Logic Operations 2 n rows in the truth table of n binary variables 2 2 n functions for n binary variables 16 functions of two binary variables
40
2- 40
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.