Goals for Lecture. Binary Logic and Gates (MK 2.1) Binary Variables. Notation Examples. Logical Operations

Similar documents
ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2

Chapter 2 Combinational Logic Circuits

Chapter 2 Boolean Algebra and Logic Gates

Logic and Computer Design Fundamentals. Chapter 2 Combinational Logic Circuits. Part 1 Gate Circuits and Boolean Equations

Learning Objectives. Boolean Algebra. In this chapter you will learn about:

Chapter 2 Combinational

Number System conversions

Chapter 2 Combinational Logic Circuits

Computer Organization I

Chapter 2: Princess Sumaya Univ. Computer Engineering Dept.

Boolean Algebra. Boolean Variables, Functions. NOT operation. AND operation. AND operation (cont). OR operation

Chapter 2 Combinational Logic Circuits

Combinational logic. Possible logic functions of two variables. Minimal set of functions. Cost of different logic functions.

Theorem/Law/Axioms Over (.) Over (+)

Digital Circuit And Logic Design I. Lecture 3

ECE/Comp Sci 352 Digital System Fundamentals Quiz # 1 Solutions

Part 5: Digital Circuits

Combinational Logic (mostly review!)

CS 121 Digital Logic Design. Chapter 2. Teacher Assistant. Hanin Abdulrahman

Possible logic functions of two variables

Combinational Logic Circuits Part II -Theoretical Foundations

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 2 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

CHAPTER III BOOLEAN ALGEBRA

CHAPTER III BOOLEAN ALGEBRA

Chapter 2 Boolean Algebra and Logic Gates

Why digital? Overview. Number Systems. Binary to Decimal conversion

MC9211 Computer Organization

Combinational Logic Design Principles

Logic Gates and Boolean Algebra

Boolean Algebra and Logic Simplification

Prove that if not fat and not triangle necessarily means not green then green must be fat or triangle (or both).

Logic Design. Chapter 2: Introduction to Logic Circuits

II. COMBINATIONAL LOGIC DESIGN. - algebra defined on a set of 2 elements, {0, 1}, with binary operators multiply (AND), add (OR), and invert (NOT):

Digital Logic Design. Malik Najmus Siraj

Chapter 2: Switching Algebra and Logic Circuits

Administrative Notes. Chapter 2 <9>

Logic and Computer Design Fundamentals. Chapter 2 Combinational Logic Circuits. Part 2 Circuit Optimization

Standard Expression Forms

2009 Spring CS211 Digital Systems & Lab CHAPTER 2: INTRODUCTION TO LOGIC CIRCUITS

EEE130 Digital Electronics I Lecture #4

Digital Design 2. Logic Gates and Boolean Algebra

Functions. Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways:

ENGR 303 Introduction to Logic Design Lecture 3. Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

L2: Combinational Logic Design (Construction and Boolean Algebra)

EECS Variable Logic Functions

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev. Section 2: Boolean Algebra & Logic Gates

ENG2410 Digital Design Combinational Logic Circuits

12/31/2010. Overview. 05-Boolean Algebra Part 3 Text: Unit 3, 7. DeMorgan s Law. Example. Example. DeMorgan s Law

Slide Set 3. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

INTRODUCTION TO INFORMATION & COMMUNICATION TECHNOLOGY LECTURE 8 : WEEK 8 CSC-110-T

CPE100: Digital Logic Design I

CMSC 313 Lecture 16 Postulates & Theorems of Boolean Algebra Semiconductors CMOS Logic Gates

COSC3330 Computer Architecture Lecture 2. Combinational Logic

for Digital Systems Simplification of logic functions Tajana Simunic Rosing Sources: TSR, Katz, Boriello & Vahid

Lecture 3. Title goes here 1. level Networks. Boolean Algebra and Multi-level. level. level. level. level

Ex: Boolean expression for majority function F = A'BC + AB'C + ABC ' + ABC.

Lecture 1. Notes. Notes. Notes. Introduction. Introduction digital logic February Bern University of Applied Sciences

This form sometimes used in logic circuit, example:

Week-I. Combinational Logic & Circuits

Introduction. 1854: Logical algebra was published by George Boole known today as Boolean Algebra

Boolean Algebra & Logic Gates. By : Ali Mustafa

Digital Logic Design. Combinational Logic

Lecture 4: More Boolean Algebra

Slides for Lecture 10

Algebraic Methods for the Analysis and Synthesis

Lecture 5: NAND, NOR and XOR Gates, Simplification of Algebraic Expressions

COMP2611: Computer Organization. Introduction to Digital Logic

Combinational Logic Fundamentals

L2: Combinational Logic Design (Construction and Boolean Algebra)

Lecture 2. Notes. Notes. Notes. Boolean algebra and optimizing logic functions. BTF Electronics Fundamentals August 2014

EC-121 Digital Logic Design

Chapter 2: Boolean Algebra and Logic Gates

Ch 2. Combinational Logic. II - Combinational Logic Contemporary Logic Design 1

CHAPTER 3 LOGIC GATES & BOOLEAN ALGEBRA

Chapter 2 : Boolean Algebra and Logic Gates

Combinational Logic. Review of Combinational Logic 1

WEEK 2.1 BOOLEAN ALGEBRA

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA

CS 226: Digital Logic Design

Chapter-2 BOOLEAN ALGEBRA

Signals and Systems Digital Logic System

211: Computer Architecture Summer 2016

Combinational logic. Possible logic functions of two variables. Minimal set of functions. Cost of different logic functions

ﻮﻧﺭﺎﮐ ﺔﺸﻘﻧ ﺎﺑ ﻱﺯﺎﺳ ﻪﻨﻴﻬﺑ

Unit 2 Boolean Algebra

Boolean Algebra and Logic Gates

Every time has a value associated with it, not just some times. A variable can take on any value within a range

Chapter 2 Boolean Algebra and Logic Gates

Chap 2. Combinational Logic Circuits

Combinatorial Logic Design Principles

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive

Chapter 2. Boolean Algebra and Logic Gates

Electronics. Overview. Introducction to Synthetic Biology

ELCT201: DIGITAL LOGIC DESIGN

Chapter 2 Boolean Algebra and Logic Gates

CHAPTER1: Digital Logic Circuits Combination Circuits

DIGITAL ELECTRONICS & it0203 Semester 3

CHAPTER 2 BOOLEAN ALGEBRA

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev

COE 202: Digital Logic Design Combinational Logic Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Transcription:

Introduction to Electrical Engineering, II LETURE NOTES #2 Instructor: Email: Telephone: Office: ndrew. Kahng (lecture) abk@ucsd.edu 858-822-4884 office 3802 P&M lass Website: http://vlsicad.ucsd.edu/courses/ece20b/wi04/ Goals for Lecture inary logic and gates oolean lgebra anonical forms for function representation unction simplification Examples orresponds to MK, 2.-2.4 (some 2.5) 2 inary Logic and Gates (MK 2.) inary Variables inary variables take on one of two values. Logical operators operate on binary values and binary variables. asic logical operators are the logic functions ND, OR and NOT. Logic gates implement logic functions. oolean lgebra: a useful mathematical system for specifying and transforming logical functions. We study oolean lgebra as foundation for designing digital systems. The two binary values have different names: True/alse On/Off Yes/No /0 We will use and 0 to denote the two values. Variable identifiers:,, y, or z for now RESET, STRT_IT, or DD later 3 4 Logical Operations Notation Examples The three basic logical operations are: ND OR NOT ND is denoted by a dot ( ). OR is denoted by a plus (+). NOT is denoted by a bar ( ) over, a single quote mark (') after, or ~ before the variable. Examples: Y = is read Y is equal to and. z = x + y is read z is equal to x OR y. = is read is equal to NOT. Note: The statement: + = 2 (read one plus one is equal to two ) is not the same as + = (read or is equal to ). 5 6

Operator Definitions Truth Tables Operations are defined on the values "0" and "" for each Operator: ND 0 0 = 0 0 = 0 0 = 0 = OR 0 + 0 = 0 0 + = + 0 = + = NOT 0 = = 0 Truth tables list the output value of a function for all possible input values Truth tables for basic logic operations: ND Y Z = Y 0 0 0 0 0 0 0 Y 0 0 0 0 OR Z = +Y 0 NOT Z = 0 0 7 8 Logic unction Implementation Logic Gates Using Switches or inputs: logic is switch closed logic 0 is switch open or outputs: logic is light on logic 0 is light off. or NOT, a switch such that for inputs: logic is switch open logic 0 is switch closed Switches in parallel => OR Switches in series => ND In the earliest computers, switches were opened and closed by energizing coils to produce magnetic fields. The switches in turn opened and closed current paths. Later, vacuum tubes that open and close current paths replaced the relays. Today, transistors are used as electronic switches that open and close current paths. 9 0 Logic Gates (continued) Logic Gate Symbols and ehavior Implementation of logic functions with transistors (See text website Supplement 2-8) logic +V Logic gates have special symbols: 2 n using p-type transistors using n-type transistors Y rom G +V G = + Y Y +V. Y +V nd waveform behavior in time as follows: logic 0 rom G2 (a) General structure (b) NOR (c) NND Transistor or tube based implementations of logic functions are called logic gates or just gates (d) NOT 2 2

Logic Diagrams and Expressions oolean lgebra (MK 2.2) Truth Table Logic Diagram Y Z 0 0 0 = + Y Z 0 0 0 Y 0 0 0 Z 0 0 0 0 Expression 0 0 = + Y Z oolean expressions, 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. 3 n algebraic structure defined on a set of at least two elements,, together with two binary operators (denoted + and ) that satisfies the following identities: losure of with respect to +, (see slide 6) Identity elements 0 and such that:. + 0 = 2. = 3. + = 4. 0 = 0 5. + = 6. = or each element, an element (inverse) s.t.: 7. + = 8. = 0 9. = 4 oolean lgebra (cont.) 0. + Y = Y +. Y = Y 2. + (Y + Z) = ( + Y) + Z 3. (Y Z) = ( Y) Z 4. (Y + Z) = Y + Z 5. + Y Z = ( + Y) ( + Z) 6. Y = + Y 7. + Y = Y The identities are organized into dual pairs. These pairs have names as follows: -4 Existence of 0 and 5-6 Idempotence 7-8 Existence of complement 9 Involution 0- ommutative Laws 2-3 ssociative Laws 4-5 Distributive Laws 6-7 DeMorgan s Laws If the meaning is unambiguous, we leave out the symbol Duality The dual of an algebraic expression is obtained by interchanging + and and interchanging 0 s and s. The identities appear in dual pairs. When there is only one identity on a line the identity is selfdual, i. e., the dual expression = the original expression. Unless it happens to be self-dual, the dual of an expression does not equal the expression itself. 5 6 oolean lgebraic Proofs - Example oolean lgebraic Proofs - Example 2 + Y = (bsorption Theorem) Y + Z + YZ = Y + Z (onsensus Theorem) Proof Steps Justification (identity or theorem) + Y = + Y (identity 2) = (Y + Y) + Y (identity 7) = Y + Y + Y (identity 4) = Y + Y (identity 5, applied to Y) = (Y + Y) (identity 4) = = (identity 5, identity 2) Proof Steps Justification (identity or theorem) YZ = YZ( + ) (identity 2, identity 7) = YZ + YZ (identity 4) Y + Z + YZ + YZ = Y( + Z) + Z( + Y) (identity 2, identity 7) = Y + Z (identity 3, identity 2) 7 8 3

oolean Operator Precedence The order of evaluation in oolean Expressions is: Parentheses NOT ND OR ecause ND takes precedence over OR, parentheses must be placed around the OR operator more frequently. Useful Theorems ( )( ) n x y + x y = y x + y x + y = y Minimizatio x + x y = x x ( x + y) = x bsorption x + x y = x + y x ( x + y) = x y Simplification x y + x z + y z = x y + x z onsensus ( x + y) ( x + z) ( y + z) = ( x + y) ( x + z) x + y = x y x y = x + y DeMorgan's Laws Exercise: Prove DeMorgan s Laws 9 20 oolean unction Evaluation Expression Simplification = xyz 2 = x + yz 3 = xyz + x y z + xy 4 = xy + x z x y z 2 3 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Simplify to contain the smallest number of literals (complemented and uncomplemented variables): + D + D + D + D = = + + D = + ( + D) or = + + D = + ( + D) 2 22 omplementing unctions anonical orms (MK 2.3) Use DeMorgan's Theorem to complement a function:. Interchange ND and OR operators 2. omplement each literal Example: omplement x yz + xyz It is useful to specify oolean functions in a form that: llows comparison for equality. Has a correspondence the truth tables anonical forms: Sum of Minterms (SOM) or Sum of Products (SOP) Product of Maxterms (POM) or Product of Sums (POS) 23 24 4

Minterms Minterms are ND terms with every variable in true or complemented form. Each binary variable may appear in uncomplemented (e.g., x) or complemented (e.g., x ) form there are 2 n minterms for n variables. EMPLE: Two variables, combined with an ND operator, Y have 2*2 or 4 combinations: (both normal) Y Y ( normal, Y complemented) Y ( complemented, Y normal) Y (both complemented) There are four minterms of two variables. 25 Maxterms Maxterms are OR terms with every variable in true or complemented form. Each binary variable may appear in uncomplemented (e.g., x) or complemented (e.g., x ) form there are 2 n maxterms for n variables. Two variables, combined with an OR operator, + Y, have 2*2 or 4 combinations: + Y (both normal) + Y (x normal, y complemented) + Y (x complemented, y normal) + Y (both complemented) 26 Maxterms and Minterms Standard Order Examples: Two variable minterms and maxterms. Index Maxterm Minterm 0 x + y x y x + y x y 2 x + y x y 3 x + y x y The index above is important for describing which variables in the terms are true and which are complemented. 27 Minterms and maxterms are designated with a subscript The subscript is a number, corresponding to a binary pattern The bits in the pattern represent the complemented or normal state of EVERY variable, listed in a STNDRD order. ll variables will be present in a minterm or maxterm and will be listed in the same order (usually alphabetically) Example: or variables a, b, c: Maxterms: (a + b + c), ( a + b + c) Minterms: a b c, a b c, a b c Terms: (b + a + c), a c b, and (c + b + a) are NOT in standard order. Terms: (a + c), b c, and (a + b) do not contain all variables 28 Purpose of the Index The index for the minterm or maxterm, expressed as a binary number, is used to determine whether each variable occurs in true form or complemented form. or Minterms: means the variable is Not omplemented and 0 means the variable is omplemented. or Maxterms: 0 means the variable is Not omplemented and means the variable is omplemented. Index Example in Three Variables Example: (for three variables) ssume the variables are called, Y, and Z. the standard order is, then Y, then Z. The Index 0 (base 0) = 000 (base 2 to three digits) so all three variables are complemented for minterm 0 (, Y, Z) and no variables are complemented for Maxterm 0 (,Y,Z) Minterm 0, called m 0 is YZ. Maxterm 0, called M 0 is ( + Y + Z). 29 30 5

our Variables Index Examples Index inary Minterm Maxterm i Pattern m i M i 0 0000 abcd 000 abcd 3 00 abcd 5 00 abcd 7 0 abcd 0 00 abcd 3 0 abcd 5 abcd Minterm and Maxterm Relationship DeMorgan's Theorem: x y = x + y and x + y = x y Two-variable example: M 2 = x + y and m 2 = x y Thus M 2 is the complement of m 2 and vice-versa. Since DeMorgan's Theorem holds for n variables, the above holds for terms of n variables giving: M and i = mi m i = M i Thus M i is the complement of m i. 3 32 unction Tables for oth Observations Minterms of Maxterms of 2 variables 2 variables x y m 0 m m 2 m 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x y M 0 M M 2 M 3 0 0 0 0 0 0 0 0 Each column in the maxterm function table is the complement of the column in the minterm function table since M i is the complement of m i. In the function tables: Each minterm has one and only one present in the 2 n terms (a minimum of ones). ll other entries are 0. Each maxterm has one and only one 0 present in the 2 n terms ll other entries are (a maximum of ones). We can implement any function by "ORing" the minterms corresponding to a "" in the function table. We can implement any function by "NDing" the maxterms corresponding to a "0" in the function table. This gives us two canonical forms: Sum of Minterms (SOM), and Product of Maxterms (POM) for stating any oolean function. 33 34 Minterm unction Example Minterm unction Example Example: ind = m + m 4 + m 7 = x y z + x y z + x y z (,,, D, E) = m 2 + m 9 + m 7 + m 23 x y z index m + m 4 + m 7 = 0 0 0 0 0 + 0 + 0 = 0 0 0 + 0 + 0 = 0 0 2 0 + 0 + 0 = 0 0 3 0 + 0 + 0 = 0 0 0 4 0 + + 0 = 0 5 0 + 0 + 0 = 0 0 6 0 + 0 + 0 = 0 7 0 + 0 + = 35 36 6

Maxterm unction Example Maxterm unction Example Example: Implement in maxterms: = M 0 M 2 M 3 M 5 M 6 = (x + y + z) (x + y + z) (x + y + z) ( x + y + z) (x + y + z) x y z i M 0 M 2 M 3 M 5 M 6 = 0 0 0 0 0 = 0 0 0 = 0 0 2 0 = 0 0 3 0 = 0 0 0 4 = 0 5 0 = 0 0 6 0 = 0 7 = 37 (,,, D) = M3 M8 M M4 38 anonical Sum of Minterms nother SOM Example ny oolean unction can be expressed as a Sum of Minterms. or the function table, the minterms used are the terms corresponding to the 's or expressions, expand all terms first to explicitly list all minterms. Do this by NDing any term missing a variable v with a term ( v + v). Example: Implement f = x + x y as a sum of minterms. irst expand terms: f = x(y + y) + x y Then distribute terms: f = xy + xy + x y Express as sum of minterms: f = m 3 +m 2 +m 0 Example: = + There are three variables,,, and which we take to be the standard order. Expanding the terms with missing variables: ollect terms (removing all but one of duplicate terms): Express as SOM: 39 40 Shorthand SOM orm anonical Product of Maxterms rom the previous example, we started with: = + We ended up with: = m +m 4 +m 5 +m 6 +m 7 This can be denoted in the formal shorthand: (,,) = Σm(,4,5,6,7) (We explicitly show the standard variables in order and drop the m designators.) ny oolean unction can be expressed as a Product of Maxterms (POM). or the function table, the maxterms used are the terms corresponding to the 0's. or an expression, expand all terms first to explicitly list all maxterms. Do this by first applying the second distributive law, ORing terms missing variable v with a term equal to and then applying the distributive law again. Example: onvert to product of maxterms: irst apply the distributive law: dd missing variable z: Express as POM: f = M 2 M 3 v v f (x, y, z) = x + x y x + x y = (x + x)(x + y) = (x + y) = x + y ( x + y z) x + y + z z = (z + y + z) + 4 42 7

omplements and onversion To complement a function expressed as SOm (or, POM), just select the missing minterms (Maxterms) Or, the complement of the SOm (POM) function is given by the POM (SOm) with the same indices. To convert SOM SOP, find the missing indices, and then use the other form Example: (x,y,z) = Σ m (,3,5,7) (x,y,z) = Σ m (0,2,4,6) (x,y,z) = Π M (,3,5,7) (x,y,z) = Π M (0,2,4,6) Standard Sum-of-Products (SOP) Sum of Minterms form for n variables can be written down directly from a truth table. Implementation of this form is a two-level network of gates such that: The first level consists of n-input ND gates, and The second level is a single OR gate (with fewer than 2n inputs). This form: is usually not a minimum literal expression, and leads to a more expensive implementation (in terms of two levels of ND and OR gates) than needed. 43 44 Standard Sum-of-Products (SOP) SOP ND/OR Two-level Implementation Try to combine terms to get a lower literal cost expression less expensive implementation. Example: (,,) = Σm(,4,5,6,7) 45 Which implementation is simpler? 46 Standard Product-of-Sums (POS) Product of Maxterms form for n variables can be written down directly from a truth table. Implementation of this form is a two-level network of gates such that: The first level consists of n-input OR gates, and The second level is a single ND gate (with fewer than 2n inputs). This form: is usually not a minimum literal expression, and leads to a more expensive implementation (in terms of two levels of ND and OR gates) than needed. Standard Product-of-Sums (POS) Try to combine terms to get a lower literal cost expression less expensive implementation. Example: (,,) = ΠM(0,2,3) 47 48 8

OR/ND Two-level Implementation ost of Implementation Which implementation is simpler? anonical SOP, POS representations can differ in literal cost oolean algebra: manipulate equations into simpler forms reduces the (two-level) implementation cost Is there only one minimum-cost circuit? Is there a systematic procedure to obtain a minimum-cost circuit? 49 50 9