LOGIC GATES & BOOLEAN ALGEBRA

Slides:



Advertisements
Similar presentations
Boolean Algebra and Logic Gates
Advertisements

ENGIN112 L7: More Logic Functions September 17, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 7 More Logic Functions: NAND, NOR,
Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR
CS 151 Digital Systems Design Lecture 5 Boolean Algebra.
Chapter 2 Logic Circuits.
Boolean Algebra and Combinational Logic
ECE C03 Lecture 21 Lecture 2 Two Level Minimization Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
ENGIN112 L8: Minimization with Karnaugh Maps September 19, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 8 Minimization with Karnaugh.
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.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 6 Dr. Shi Dept. of Electrical and Computer Engineering.
Gate-Level Minimization. Digital Circuits The Map Method The complexity of the digital logic gates the complexity of the algebraic expression.
CS 151 Digital Systems Design Lecture 7 More Logic Functions: NAND, NOR, XOR.
Chapter 2 – Combinational Logic Circuits Part 1 – Gate Circuits and Boolean Equations Logic and Computer Design Fundamentals.
CS 151 Digital Systems Design Lecture 6 More Boolean Algebra A B.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
ENGIN112 L5: Boolean Algebra September 12, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 5 Boolean Algebra.
Computer Engineering (Logic Circuits) (Karnaugh Map)
CS 151 Digital Systems Design Lecture 8 Minimization with Karnaugh Maps.
بهينه سازي با نقشة کارنو Karnaugh Map. 2  Method of graphically representing the truth table that helps visualize adjacencies 2-variable K-map 3-variable.
Chapter Two Boolean Algebra and Logic Gate
Chapter 2: Boolean Algebra and Logic Functions
11.1 Boolean Functions. Boolean Algebra An algebra is a set with one or more operations defined on it. A boolean algebra has three main operations, and,
Chapter 2 Boolean Algebra and Logic Gates
Overview of Chapter 3 °K-maps: an alternate approach to representing Boolean functions °K-map representation can be used to minimize Boolean functions.
1 Logic Gates Digital Computer Logic Kashif Bashir WWW:
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Boolean Algebra and Digital Circuits
Switching functions The postulates and sets of Boolean logic are presented in generic terms without the elements of K being specified In EE we need to.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Module 4.  Boolean Algebra is used to simplify the design of digital logic circuits.  The design simplification are based on: Postulates of Boolean.
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
Unit 1 Minimization Techniques and Logic Gates. Introduction to Digital Systems Analog devices and systems process time-varying signals that can take.
1 BOOLEAN ALGEBRA Basic mathematics for the study of logic design is Boolean Algebra Basic laws of Boolean Algebra will be implemented as switching devices.
ENGIN112 L6: More Boolean Algebra September 15, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 6 More Boolean Algebra A B.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
1 EENG 2710 Chapter 2 Algebraic Methods For The Analysis and Synthesis of Logic circuits.
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.
1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression.
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Topic 4 – Switching Circuits. Serial vs. Parallel Transmission Circuit elements can be connected in either a serial or parallel manner. Serial implies.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 4 Dr. Shi Dept. of Electrical and Computer Engineering.
ECE DIGITAL LOGIC LECTURE 8: BOOLEAN FUNCTIONS Assistant Prof. Fareena Saqib Florida Institute of Technology Spring 2016, 02/11/2016.
Lecture 5 More Boolean Algebra A B. Overview °Expressing Boolean functions °Relationships between algebraic equations, symbols, and truth tables °Simplification.
DE MORGAN’S THEOREM. De Morgan’s Theorem De Morgan’s Theorem.
CSE 461. Binary Logic Binary logic consists of binary variables and logical operations. Variables are designated by letters such as A, B, C, x, y, z etc.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
CHAPTER 2 Boolean algebra and Logic gates
CHAPTER 3 Simplification of Boolean Functions
De Morgan’s Theorem,.
Chapter 2: Boolean Algebra and Logic Functions
CS 105 Digital Logic Design
CHAPTER 2 Boolean Algebra This chapter in the book includes:
Boolean Algebra and Combinational Logic
Princess Sumaya University
Give qualifications of instructors: DAP
ECE 331 – Digital System Design
Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章(Chapter 58) 伏者潛藏也
Boolean Algebra.
17-Nov-18 Logic Algebra 1 Combinational logic.
Boolean Algebra.
Boolean Algebra.
Chapter 2 Boolean Algebra and Logic Gate
CSE 370 – Winter Combinational Logic - 1
Chapter 2 Introduction to Logic Circuits
Analysis of Logic Circuits Example 1
Circuit Simplification and
Presentation transcript:

LOGIC GATES & BOOLEAN ALGEBRA MODULE 2 LOGIC GATES & BOOLEAN ALGEBRA Give qualifications of instructors: DAP teaching computer architecture at Berkeley since 1977 Co-athor of textbook used in class Best known for being one of pioneers of RISC currently author of article on future of microprocessors in SciAm Sept 1995 RY took 152 as student, TAed 152,instructor in 152 undergrad and grad work at Berkeley joined NextGen to design fact 80x86 microprocessors one of architects of UltraSPARC fastest SPARC mper shipping this Fall

The AND Gate A Y B A B Y 1 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). Truth Table A B Y 1

The OR Gate A Y B A B Y 1 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. A B Y 1

Describing Circuit Functionality: Waveforms AND Gate A B Y 1 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? credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

Consider three-input gates 3 Input OR Gate

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.

Commutativity 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

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 )

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.

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.

Absorption This theorem states: a + ab = a a(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

DeMorgan’s Theorem (a(b+z(x + a’)))’ = a’ + (b + z(x + a’))’ 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)

Boolean algebra deals with binary variables and logic operations. Boolean Functions Boolean algebra deals with binary variables and logic operations. Function results in binary 0 or 1 x 1 y z F F = x(y+z’) z’ y+z’

Boolean algebra deals with binary variables and logic operations. Boolean Functions Boolean algebra deals with binary variables and logic operations. Function results in binary 0 or 1 x 1 y 1 z 1 xy 1 yz 1 G 1 x y z G = xy +yz yz xy We will learn how to transition between equation, symbols, and truth table.

Truth Table to Expression Converting a truth table to an expression Each row with output of 1 becomes a product term Sum product terms together. x 1 y 1 z 1 G 1 Any Boolean Expression can be represented in sum of products form! xyz + xyz’ + x’yz

Equivalent Representations of Circuits All three formats are equivalent Number of 1’s in truth table output column equals AND terms for Sum-of-Products (SOP) x y z 1 G G = xyz + xyz’ + x’yz credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

Reducing Boolean Expressions Is this the smallest possible implementation of this expression? No! Use Boolean Algebra rules to reduce complexity while preserving functionality. Step 1: Use Theorum 1 (a + a = a) So xyz + xyz’ + x’yz = xyz + xyz + xyz’ + x’yz Step 2: Use distributive rule a(b + c) = ab + ac So xyz + xyz + xyz’ + x’yz = xy(z + z’) + yz(x + x’) Step 3: Use Postulate 3 (a + a’ = 1) So xy(z + z’) + yz(x + x’) = xy.1 + yz.1 Step 4: Use Postulate 2 (a . 1 = a) So xy.1 + yz.1 = xy + yz = xyz + xyz’ + x’yz G = xyz + xyz’ + x’yz

Reduced Hardware Implementation Reduced equation requires less hardware! Same function implemented! x 1 y z G x x G x x credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs. x y z G = xyz + xyz’ + x’yz = xy + yz

Each variable in a Boolean expression is a literal Minterms and Maxterms Each variable in a Boolean expression is a literal Boolean variables can appear in normal (x) or complement form (x’) Each AND combination of terms is a minterm Each OR combination of terms is a maxterm For example: Minterms x y z Minterm 0 0 0 x’y’z’ m0 0 0 1 x’y’z m1 … 1 0 0 xy’z’ m4 1 1 1 xyz m7 For example: Maxterms x y z Maxterm 0 0 0 x+y+z M0 0 0 1 x+y+z’ M1 … 1 0 0 x’+y+z M4 1 1 1 x’+y’+z’ M7

Representing Functions with Minterms Minterm number same as row position in truth table (starting from top from 0) Shorthand way to represent functions x 1 y z G G = xyz + xyz’ + x’yz G = m7 + m6 + m3 = Σ(3, 6, 7) credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

Complementing Functions Minterm number same as row position in truth table (starting from top from 0) Shorthand way to represent functions x 1 y 1 z 1 G 1 G’ 1 G = xyz + xyz’ + x’yz G’ = (xyz + xyz’ + x’yz)’ = credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs. Can we find a simpler representation?

Complementing Functions Step 1: assign temporary names b + c -> z (a + z)’ = G’ Step 2: Use DeMorgans’ Law (a + z)’ = a’ . z’ Step 3: Resubstitute (b+c) for z a’ . z’ = a’ . (b + c)’ Step 4: Use DeMorgans’ Law a’ . (b + c)’ = a’ . (b’. c’) Step 5: Associative rule a’ . (b’. c’) = a’ . b’ . c’ G’ = (a + b + c)’ G = a + b + c G’ = a’ . b’ . c’ = a’b’c’ G = a + b + c credential: bring a computer die photo wafer : This can be an hidden slide. I just want to use this to do my own planning. I have rearranged Culler’s lecture slides slightly and add more slides. This covers everything he covers in his first lecture (and more) but may We will save the fun part, “ Levels of Organization,” at the end (so student can stay awake): I will show the internal stricture of the SS10/20. Notes to Patterson: You may want to edit the slides in your section or add extra slides to taylor your needs.

Complementation Example Find complement of F = x’z + yz F’ = (x’z + yz)’ DeMorgan’s F’ = (x’z)’ (yz)’ F’ = (x’’+z’)(y’+z’) Reduction -> eliminate double negation on x F’ = (x+z’)(y’+z’) This format is called product of sums

The NAND Gate A Y B This is a NAND gate. It is a combination of an AND gate followed by an inverter. Its truth table shows this… NAND gates have several interesting properties… NAND(a,a)=(aa)’ = a’ = NOT(a) NAND’(a,b)=(ab)’’ = ab = AND(a,b) NAND(a’,b’)=(a’b’)’ = a+b = OR(a,b) A B Y 1

The NAND Gate These three properties show that a NAND gate with both of its inputs driven by the same signal is equivalent to a NOT gate A NAND gate whose output is complemented is equivalent to an AND gate, and a NAND gate with complemented inputs acts as an OR gate. Therefore, we can use a NAND gate to implement all three of the elementary operators (AND,OR,NOT). Therefore, ANY switching function can be constructed using only NAND gates. Such a gate is said to be primitive or functionally complete.

NAND Gates into Other Gates (what are these circuits?) A Y NOT Gate Y A B AND Gate A B Y OR Gate

The NOR Gate A Y B This is a NOR gate. It is a combination of an OR gate followed by an inverter. It’s truth table shows this… NOR gates also have several interesting properties… NOR(a,a)=(a+a)’ = a’ = NOT(a) NOR’(a,b)=(a+b)’’ = a+b = OR(a,b) NOR(a’,b’)=(a’+b’)’ = ab = AND(a,b) A B Y 1

Functionally Complete Gates Just like the NAND gate, the NOR gate is functionally complete…any logic function can be implemented using just NOR gates. Both NAND and NOR gates are very valuable as any design can be realized using either one. It is easier to build an IC chip using all NAND or NOR gates than to combine AND,OR, and NOT gates. NAND/NOR gates are typically faster at switching and cheaper to produce.

NOR Gates into Other Gates (what are these circuits?) A Y NOT Gate Y A B OR Gate A B Y AND Gate

The XOR Gate (Exclusive-OR) Y B This is a XOR gate. XOR gates assert their output when exactly one of the inputs is asserted, hence the name. The switching algebra symbol for this operation is , i.e. 1  1 = 0 and 1  0 = 1. A B Y 1

The XNOR Gate A Y B A B Y 1 This is a XNOR gate. This functions as an exclusive-NOR gate, or simply the complement of the XOR gate. The switching algebra symbol for this operation is , i.e. 1  1 = 1 and 1  0 = 0. A B Y 1

NOR Gate Equivalence NOR Symbol, Equivalent Circuit, Truth Table

DeMorgan’s Theorem (a(b+z(x + a’)))’ = a’ + (b + z(x + a’))’ 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)

Example Determine the output expression for the below circuit and simplify it using DeMorgan’s Theorem

Universality of NAND and NOR gates

Universality of NOR gate Equivalent representations of the AND, OR, and NOT gates

Example

Interpretation of the two NAND gate symbols Determine the output expression for circuit via DeMorgan’s Theorem

Interpretation of the two OR gate symbols Determine the output expression for circuit via DeMorgan’s Theorem

Karnaugh maps Alternate way of representing Boolean function All rows of truth table represented with a square Each square represents a minterm Easy to convert between truth table, K-map, and SOP Unoptimized form: number of 1’s in K-map equals number of minterms (products) in SOP Optimized form: reduced number of minterms y F = Σ(m0,m1) = x’y + x’y’ 1 y x x’y’ xy’ xy x’y x y F 0 0 1 0 1 1 1 0 0 1 1 0 1 y x

F=AB’C’ +AB C +ABC +ABC  + A’B’C + A’BC’ Karnaugh Maps A Karnaugh map is a graphical tool for assisting in the general simplification procedure. Two variable maps. A 1 B F=AB +A’B B 1 A 1 F=AB +AB +AB  1 1 1 A B C F Three variable maps. 1 1 A 1 00 01 BC 11 10 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + F=AB’C’ +AB C +ABC +ABC  + A’B’C + A’BC’

Rules for K-Maps We can reduce functions by circling 1’s in the K-map Each circle represents minterm reduction Following circling, we can deduce minimized and-or form. Rules to consider Every cell containing a 1 must be included at least once. The largest possible “power of 2 rectangle” must be enclosed. The 1’s must be enclosed in the smallest possible number of rectangles. Example

F=AB’C’ +AB C +ABC +ABC  + A’B’C + A’BC’ Karnaugh Maps A Karnaugh map is a graphical tool for assisting in the general simplification procedure. Two variable maps. A 1 B F=AB +A’B A 1 B F=AB +AB +AB  F=A+B Three variable maps. A 1 00 01 BC 11 10 F=A+B C +BC  F=AB’C’ +AB C +ABC +ABC  + A’B’C + A’BC’

Karnaugh maps G(A,B,C) = F(A,B,C) = m(0,4,5,7) = AC + B’C’ Numbering scheme based on Gray–code e.g., 00, 01, 11, 10 Only a single bit changes in code for adjacent map cells This is necessary to observe the variable transitions 00 01 AB C 1 11 10 B A F(A,B,C) = m(0,4,5,7) G(A,B,C) = 0 0 1 1 C B A 1 0 0 1 = AC + B’C’

More Karnaugh Map Examples 1 a b 1 1 b 1 1 1 1 Examples 1 f = a g = b' ab ab c 00 01 11 10 c 00 01 11 10 1 1 1 1 1 1 1 1 1 1 cout = ab + bc + ac f = a 1. Circle the largest groups possible. 2. Group dimensions must be a power of 2. 3. Remember what circling means!