Lecture 21: Boolean Logic. To Wrap up AVR

Similar documents
ECE380 Digital Logic. Axioms of Boolean algebra

Digital electronics form a class of circuitry where the ability of the electronics to process data is the primary focus.

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

Contents. Chapter 2 Digital Circuits Page 1 of 30

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

School of Computer Science and Electrical Engineering 28/05/01. Digital Circuits. Lecture 14. ENG1030 Electrical Physics and Electronics

EC-121 Digital Logic Design

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

Chapter 2 Boolean Algebra and Logic Gates

Binary Logic and Gates

Chapter 2 Boolean Algebra and Logic Gates

L2: Combinational Logic Design (Construction and Boolean Algebra)

Chapter 2: Boolean Algebra and Logic Gates

BOOLEAN ALGEBRA TRUTH TABLE

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

Boolean Algebra and Logic Gates

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

Binary Logic and Gates. Our objective is to learn how to design digital circuits.

Standard & Canonical Forms

L2: Combinational Logic Design (Construction and Boolean Algebra)

L2: Combinational Logic Design (Construction and Boolean Algebra)

Lecture 9: Digital Electronics

Boole Algebra and Logic Series

Gates. Quiz 1 will cover up to and including this lecture. The book says something about NAND... maybe an in-law. Is he talking about BILL??? 6.

CS61c: Representations of Combinational Logic Circuits

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

Chapter 2: Switching Algebra and Logic Circuits

EEC 116 Lecture #5: CMOS Logic. Rajeevan Amirtharajah Bevan Baas University of California, Davis Jeff Parkhurst Intel Corporation

Boolean Algebra, Gates and Circuits

CMPEN 411 VLSI Digital Circuits Spring 2011 Lecture 07: Pass Transistor Logic

control in out in out Figure 1. Binary switch: (a) opened or off; (b) closed or on.

CPE100: Digital Logic Design I

Digital Integrated Circuits A Design Perspective

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA

Logic Gates and Boolean Algebra

EEC 118 Lecture #6: CMOS Logic. Rajeevan Amirtharajah University of California, Davis Jeff Parkhurst Intel Corporation

Properties of CMOS Gates Snapshot

Boolean Algebra & Logic Gates. By : Ali Mustafa

Digital Integrated Circuits Designing Combinational Logic Circuits. Fuyuzhuo

Lecture 4: Implementing Logic in CMOS

9/18/2008 GMU, ECE 680 Physical VLSI Design

Gates and Logic: From switches to Transistors, Logic Gates and Logic Circuits

Digital Design 2. Logic Gates and Boolean Algebra

EE141Microelettronica. CMOS Logic

Floating Point Representation and Digital Logic. Lecture 11 CS301

NAND, NOR and XOR functions properties

Digital Circuit And Logic Design I. Lecture 3

UC Berkeley College of Engineering, EECS Department CS61C: Representations of Combinational Logic Circuits

Designing Information Devices and Systems II Spring 2016 Anant Sahai and Michel Maharbiz Homework 5. This homework is due February 29, 2016, at Noon.

Boolean Algebra. The Building Blocks of Digital Logic Design. Section. Section Overview. Binary Operations and Their Representation.

COMBINATIONAL LOGIC. Combinational Logic

CHAPTER1: Digital Logic Circuits Combination Circuits

THE INVERTER. Inverter

DC and Transient Responses (i.e. delay) (some comments on power too!)

Chapter 2. Boolean Algebra and Logic Gates

ECE 238L Boolean Algebra - Part I

Digital Logic Design. Combinational Logic

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

Switches: basic element of physical implementations

COMP 103. Lecture 16. Dynamic Logic

Pass-Transistor Logic

ECE 342 Electronic Circuits. Lecture 34 CMOS Logic

Boolean Algebra. Examples: (B=set of all propositions, or, and, not, T, F) (B=2 A, U,, c, Φ,A)

Part 5: Digital Circuits

New Students Day Activity

Combinational Logic Design Principles

CMSC 313 Lecture 16 Announcement: no office hours today. Good-bye Assembly Language Programming Overview of second half on Digital Logic DigSim Demo

Digital Electronics. Delay Max. FF Rate Power/Gate High Low (ns) (MHz) (mw) (V) (V) Standard TTL (7400)

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

CHAPTER 2 BOOLEAN ALGEBRA

ECE 546 Lecture 10 MOS Transistors

Circuits & Boolean algebra.

CPE/EE 427, CPE 527 VLSI Design I L18: Circuit Families. Outline

Unit 2 Boolean Algebra

Binary logic consists of binary variables and logical operations. The variables are

Logic Design. Chapter 2: Introduction to Logic Circuits

Chapter 2. Digital Logic Basics

Chapter 2 Combinational Logic Circuits

Static CMOS Circuits

CS/EE 181a 2010/11 Lecture 4

Chapter 2 Boolean Algebra and Logic Gates

Miscellaneous Lecture topics. Mary Jane Irwin [Adapted from Rabaey s Digital Integrated Circuits, 2002, J. Rabaey et al.]

E40M. Binary Numbers. M. Horowitz, J. Plummer, R. Howe 1

Introduction to Computer Engineering ECE 203

CHAPTER 12 Boolean Algebra

Digital Logic. CS211 Computer Architecture. l Topics. l Transistors (Design & Types) l Logic Gates. l Combinational Circuits.

Midterm Examination # 1 Wednesday, February 25, Duration of examination: 75 minutes

Week-I. Combinational Logic & Circuits

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

CMPE12 - Notes chapter 1. Digital Logic. (Textbook Chapter 3)

Sequential Logic. Handouts: Lecture Slides Spring /27/01. L06 Sequential Logic 1

MC9211 Computer Organization

Standard Expression Forms

Discrete Mathematics. CS204: Spring, Jong C. Park Computer Science Department KAIST

Chapter-2 BOOLEAN ALGEBRA

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

Digital Integrated Circuits A Design Perspective

Logic and Boolean algebra

Chapter 2 Boolean Algebra and Logic Gates

Transcription:

18 100 Lecture 21: oolean Logic S 15 L21 1 James C. Hoe Dept of ECE, CMU pril 7, 2015 Today s Goal: Introduce oolean logic nnouncements: Read Rizzoni 12.3 and 11.5 HW8 due Thursday Office Hours: Wed 12:30~2:30 Handouts: Lab 11 (on lackboard) To Wrap up VR S 15 L21 2 To be a hacker, you also need to know subroutine calls, in particular recursive calls exception handling I/O how to hand optimize code Feel free to read the VR documents on lackboard ig picture to keep in mind you will see assembly programming in much greater detail in 213/240/34{8,9}/447 etc. most of you will not code in assembly for a living; this is more about understanding the underlying concepts once you learn one IS you can learn the rest some ISs are uglier than others VR is not a pretty one.

S 15 L21 3 Recall the 3 aspects of a computer Processing Storage (program and data) I/O Input In General ll sequential digital systems comprise Next State Logic S Next State S Output Logic S 15 L21 4 Output input and output state stuff that remembers combinational stuff that computes a function (has no memory) In an execution, state is updated to a next state based on a function of the current state

S 15 L21 5 First things first: Combinational Logic In Out The same In value always leads to the same Out value regardless of history Combinational Logic combinational logic circuit has an output that is a function of its inputs output inputs What do you mean by function? unique mapping from input values to output values in this context implies the same input values produce the same output value every time same output for different input values is okay no memory (does not depend on the history of input values) Later on we will learn, a sequential circuit s output depends on the current and the history of its inputs C S 15 L21 6

Examples: and / or / not S 15 L21 7 ND: Z is true iff both X and Y are true X Y ND Z X Y Z F F F F T F T F F T T T OR: Z is true iff X or Y or both are true X Y OR NOT: X is the complement of X bubble means invert; triangle is buffer Z X X X Y Z F F F F T T T F T T T T X X F T T F ny logical function can be constructed using only ND and NOT gates, or only OR and NOT gates oolean lgebra: ig Picture S 15 L21 8 n algebra on two values (usually denoted as True vs False or 1 vs 0) the operators ND ( ), OR (+), NOT useful formalism to represent and reason about combinational logic functions For example, X Z Y combinational logic above can be expressed as Z=X (X+Y) using rules of oolean algebra, the above expression can be simplified to Z=X

S 15 L21 9 Rules of oolean lgebra (Table 12.11) 1. 0+X=X 2. 1+X=1 3. X+X=X 4. X+X =1 9. (X ) =X 10. X+Y=Y+X 12. X+(Y+Z)=(X+Y)+Z 14. X (Y+Z) =X Y+X Z 6. 1 X=X 5. 0 X=0 7. X X=X 8. X X =0 means ND + means OR 11. X Y=Y X (commutativity) 13. X (Y Z)= (X Y) Z (associativity) (14). X+(Y Z)=(X+Y) (X+Z) (distributive) The above is a standard set of rules that can be easily shown by perfect induction Notice the symmetry between the left and right columns with respect to substitutions of 0 by 1, + by and vice versa Does X+(Y Z)=(X+Y) (X+Z)? S 15 L21 10 X Y Z (Y Z) X+(Y Z) (X+Y) (X+Z) (X+Y) (X+Z) F F F F F F F F F F T F F F T F F T F F F T F F F T T T T T T T T F F F T T T T T F T F T T T T T T F F T T T T T T T T T T T T Enumerate all possible patterns; n variables have 2 n patterns Evaluate the expressions in question for each case, possibly with the help of intermediate expressions like (Y Z)

Duality Is that a truth table for ND or OR? ns. depends on means true or false if means true then OR if means false then ND ND and OR are duals X X+Y Y X Y X Y Z X Y S 15 L21 11 De Morgan s Theorem X Y = (X+Y) X +Y = (X Y) For every rule, there is a dual rule where ND and OR are exchanged and 0 and 1 are exchanged Does X+XY=X? S 15 L21 12 Instead of perfect induction, we can also prove algebraically using proven rules, e.g., X+X Y = 1 X+X Y rule 6 = X 1+X Y rule 11 = X (1+Y) rule 14 = X 1 rule 2 = 1 X rule 11 = X rule 6

Does XY+YZ+X Z=XY+X Z? S 15 L21 13 S 15 L21 14 Rules of oolean lgebra (Table 12.11) 15. X+X Y=X 17. (X+Y)(X+Z)=X+YZ 18. X+X Y=X+Y 19. XY+YZ+X Z=XY+X Z DM.(++C+ ) = C 16. X (X+Y)=X (absorption) (17). XY+XZ=X(Y+Z) (18). X (X +Y)=XY (19). (X+Y)(Y+Z)(X +Z)=(X+Y)(X +Z) (DM). ( C ) = + +C + The above and other rules can be derived from the basic set, as we did for Rules 15 and 19

pplication in Logic Minimization S 15 L21 15 Given f=x Y Z +X Y Z+X YZ+XYZ simplify the expression by algebraic manipulation X Y Z +X Y Z+X YZ+XYZ = X Y (Z +Z)+(X +X)YZ rule 14 = X Y 1+1 YZ rule 4 = X Y +YZ rule 6 Original expression required one 4 input OR gate and four 3 input ND gates Simplified expression requires one 2 input OR gate and two 2 input ND gates Can we do any better? If not, can we know for sure? Minimize f= D+ D+CD+CD J. (Example 12.3 from Rizzoni) S 15 L21 16 C. Hoe

S 15 L21 17 Quick Peek elow the Digital bstraction S 15 L21 18 Physical Representations of 1s and 0s Many ways in electronics voltage level (high vs low) voltage change (delta up vs down) relative current drive on a differential pair on off keying in various transmissions Objective: must be hard to confuse between 1 vs 0 Voltage level noise margin output devices guarantee min V OH and max V OL input devices insist on a min V IH and max V IL ; if violated does not register correctly as high or low V OH noise margin e.g., harddrive read back 5V V IH V IL V OL 0V

S 15 L21 19 Example: NMOS Resistor Transistor Logic V out ID R D 5V V out V 0.6V 0V 0.6V Vx 5V V I/O voltage levels V IL max <turn on 0.6V, V IH min > (by how much?) V x V OH 5V (without any load), V OL?? Noise margin: full swing output even if input is not perfect ut, in output low state, I D >0 leaking power Inverting Logic S 15 L21 20 V out V out V t 1 V t 1 t 2 V Either t 1 or t 2 turn on provides path to GND V V V out 0V 0V 5V 0V 5V 0V 5V 0V 0V 5V 5V 0V V t 2 oth t 1 and t 2 must turn on to have path to GND V V V out 0V 0V 5V 0V 5V 5V 5V 0V 5V 5V 5V 0V Instead of ND and OR we have NND and NOR!! we can always stick an inverter on the output fortunately either NND or NOR is all we really need

Complex Inverted Function Gates S 15 L21 21 f g (f g) f g (f + g) NMOS network that conducts If g is true S 15 L21 22 Complex Gate Example: Exclusive OR (XOR) O F F F F T T T F T T T F O= =(+ )

Complex Function Gate Example S 15 L21 23 O D H I C E F G J K O={ [ C] + [D (E+F+G)] + [(H+I) (J+K)] } Don t really build something this complex in one gate. Too clunky. S 15 L21 24 Complementary MOS (CMOS) Logic PMOS: conducts if input is low 5V V out V V out 0.6V 0V 0.6V 5V V lmost ideal inverter transfer curve large, balanced noise margin; strong signal restorations Only 1 transistor (NMOS or PMOS) is conducting at a time ideally no (very little) static leakage current/power

CMOS NNDs and NORs S 15 L21 25 ( ) =( + ) (+) =( ) PMOS and NMOS networks are De Morgan duals output either connected to VCC or GND, never both NNDs are better than NORs (take 320 to find out why) CMOS Complex Gate Example S 15 L21 26 C D E F H J G I K O D H I C E F G J K

Minimize f= D+ D+CD+CD J. (Example 12.3) D+ D+CD+CD = D( +)+CD+CD rule 14 = D+CD+CD rule 4 and 6 =( +C)D+CD rule 14 = ( +C)D+CD rule 18 = D+CD+CD rule 14 = D+CD(1+) rule 14 = D+CD rule 2 and 6 = ( +C)D rule 14 S 15 L21 27 C. Hoe Does XY+YZ+X Z=XY+X Z? S 15 L21 28 XY+YZ+X Z =XY 1+YZ 1+X Z 1 rule 6 = XY(Z+Z )+YZ(X+X )+X Z(Y+Y ) rule 4 = XYZ+XYZ +YZX+YZX +X ZY+X ZY rule 14 = XYZ+XYZ +XYZ+X YZ+X YZ+X Y Z rule 11 =XYZ+XYZ+XYZ +X YZ+X YZ+X Y Z rule 10 = XYZ+XYZ +X YZ+X Y Z rule 3 = XY(Z+Z )+X Z(Y+Y ) rule 14 =XY 1+X Z 1 rule 4 =XY+X Z rule 6 This one is tricky

Does XY+YZ+X Z=XY+X Z? (done another way) XY+YZ+X Z = XY+YZ 1+X Z rule 6 = XY+YZ(X+X )+X Z rule 4 = XY+YZX+YZX +X Z rule 14 = XY+XYZ+X ZY+X Z rule 11 = XY+XYZ+X Z+X ZY rule 10 = XY 1+XYZ+X Z 1+X ZY rule 6 = XY(1+Z)+X Z(1+Y) rule 14 =XY 1+X Z 1 rule 2 =XY+X Z rule 6 rule 15 absorption S 15 L21 29