Review. EECS Components and Design Techniques for Digital Systems. Lec 05 Boolean Logic 9/4-04. Seq. Circuit Behavior. Outline.

Similar documents
Review. EECS Components and Design Techniques for Digital Systems. Lec 03 Field Programmable Gate Arrays

1. Mark the correct statement(s)

Outline. EECS Components and Design Techniques for Digital Systems. Lec 11 Putting it all together Where are we now?

Combinational Logic & Circuits

CS8803: Advanced Digital Design for Embedded Hardware

Chapter 2. Boolean Expressions:

Incompletely Specified Functions with Don t Cares 2-Level Transformation Review Boolean Cube Karnaugh-Map Representation and Methods Examples

Specifying logic functions

Software Engineering 2DA4. Slides 2: Introduction to Logic Circuits

Experiment 4 Boolean Functions Implementation

Computer Science. Unit-4: Introduction to Boolean Algebra

Boolean Algebra and Logic Gates

Boolean algebra. June 17, Howard Huang 1

DKT 122/3 DIGITAL SYSTEM 1

Introduction to Computer Architecture

Combinational Devices and Boolean Algebra

Unit-IV Boolean Algebra

Boolean Algebra. BME208 Logic Circuits Yalçın İŞLER

IT 201 Digital System Design Module II Notes

Assignment (3-6) Boolean Algebra and Logic Simplification - General Questions

Experiment 3: Logic Simplification

Chapter 2 Boolean algebra and Logic Gates

Midterm Exam Review. CS 2420 :: Fall 2016 Molly O'Neil

ELCT201: DIGITAL LOGIC DESIGN

Bawar Abid Abdalla. Assistant Lecturer Software Engineering Department Koya University

VALLIAMMAI ENGINEERING COLLEGE. SRM Nagar, Kattankulathur DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING EC6302 DIGITAL ELECTRONICS

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

UNIT-4 BOOLEAN LOGIC. NOT Operator Operates on single variable. It gives the complement value of variable.

Code No: 07A3EC03 Set No. 1

R.M.D. ENGINEERING COLLEGE R.S.M. Nagar, Kavaraipettai

Lecture (05) Boolean Algebra and Logic Gates

Menu. Algebraic Simplification - Boolean Algebra EEL3701 EEL3701. MSOP, MPOS, Simplification

Gate Level Minimization Map Method

Department of Electrical Engineering McGill University ECSE 221 Introduction to Computer Engineering Assignment 2 Combinational Logic

Combinational Logic Circuits

ELCT201: DIGITAL LOGIC DESIGN

EECS Components and Design Techniques for Digital Systems. Lec 07 PLAs and FSMs 9/ Big Idea: boolean functions <> gates.

Gate-Level Minimization. BME208 Logic Circuits Yalçın İŞLER

Chapter 2. Boolean Algebra and Logic Gates

Chapter 3. Boolean Algebra and Digital Logic

EECS150 Homework 2 Solutions Fall ) CLD2 problem 2.2. Page 1 of 15

Chap-2 Boolean Algebra

Definitions. 03 Logic networks Boolean algebra. Boolean set: B 0,

Chapter 2: Combinational Systems

01 Introduction to Digital Logic. ENGR 3410 Computer Architecture Mark L. Chang Fall 2006

Announcements. Chapter 2 - Part 1 1

01 Introduction to Digital Logic. ENGR 3410 Computer Architecture Mark L. Chang Fall 2008

CHAPTER-2 STRUCTURE OF BOOLEAN FUNCTION USING GATES, K-Map and Quine-McCluskey

UNIT 2 BOOLEAN ALGEBRA

Chapter 3. Gate-Level Minimization. Outlines

Combinational Circuits Digital Logic (Materials taken primarily from:

Propositional Calculus. Math Foundations of Computer Science

2.6 BOOLEAN FUNCTIONS

2008 The McGraw-Hill Companies, Inc. All rights reserved.

2. BOOLEAN ALGEBRA 2.1 INTRODUCTION

Identity. p ^ T p p _ F p. Idempotency. p _ p p p ^ p p. Associativity. (p _ q) _ r p _ (q _ r) (p ^ q) ^ r p ^ (q ^ r) Absorption

SWITCHING THEORY AND LOGIC CIRCUITS

Philadelphia University Faculty of Information Technology Department of Computer Science. Computer Logic Design. By Dareen Hamoudeh.

Henry Lin, Department of Electrical and Computer Engineering, California State University, Bakersfield Lecture 7 (Digital Logic) July 24 th, 2012

Bawar Abid Abdalla. Assistant Lecturer Software Engineering Department Koya University

Standard Forms of Expression. Minterms and Maxterms

CS February 17

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

X Y Z F=X+Y+Z

Gate-Level Minimization. section instructor: Ufuk Çelikcan

VLSI System Design Part II : Logic Synthesis (1) Oct Feb.2007

Circuit analysis summary

CS470: Computer Architecture. AMD Quad Core

Summary. Boolean Addition

Logic Design: Part 2

SYNERGY INSTITUTE OF ENGINEERING & TECHNOLOGY,DHENKANAL LECTURE NOTES ON DIGITAL ELECTRONICS CIRCUIT(SUBJECT CODE:PCEC4202)


Boolean Algebra & Digital Logic

1/28/2013. Synthesis. The Y-diagram Revisited. Structural Behavioral. More abstract designs Physical. CAD for VLSI 2

KING FAHD UNIVERSITY OF PETROLEUM & MINERALS COMPUTER ENGINEERING DEPARTMENT

QUESTION BANK FOR TEST

Propositional Calculus. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Module -7. Karnaugh Maps

BOOLEAN ALGEBRA. Logic circuit: 1. From logic circuit to Boolean expression. Derive the Boolean expression for the following circuits.

Computer Organization and Levels of Abstraction

Simplification of Boolean Functions

COPYRIGHTED MATERIAL INDEX

Combinational Logic Circuits

MODULE 5 - COMBINATIONAL LOGIC

Computer Organization

Gate Level Minimization

Administrivia. CSE 370 Spring 2006 Introduction to Digital Design Lecture 9: Multilevel Logic

Digital Logic Design (CEN-120) (3+1)

ENGIN 112 Intro to Electrical and Computer Engineering

Design of Digital Circuits Lecture 6: Combinational Logic, Hardware Description Lang. & Verilog. Prof. Onur Mutlu ETH Zurich Spring March 2018

Injntu.com Injntu.com Injntu.com R16

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road QUESTION BANK (DESCRIPTIVE)

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

Logic and Computer Design Fundamentals. Chapter 2 Combinational Logic Circuits. Part 3 Additional Gates and Circuits

SIR C.R.REDDY COLLEGE OF ENGINEERING, ELURU DEPARTMENT OF INFORMATION TECHNOLOGY LESSON PLAN

BHARATHIDASAN ENGINEERING COLLEGE Degree / Branch : B.E./ECE Year / Sem : II/ III Sub.Code / Name : EC6302/DIGITAL ELECTRONICS

Chapter 6. Logic Design Optimization Chapter 6

COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING QUESTION BANK SUBJECT CODE & NAME: EC 1312 DIGITAL LOGIC CIRCUITS UNIT I

Objectives: 1- Bolean Algebra. Eng. Ayman Metwali

Transcription:

Review EECS 150 - Components and Design Techniques for Digital Systems Lec 05 Boolean Logic 94-04 David Culler Electrical Engineering and Computer Sciences University of California, Berkeley Design flow Design entry, High Level Analysis, Technology Mapping, Low- Level Analysis Role of Netlists and Hardware Description Languages Verilog Structural models Behavioral models Elements of the language Lots of examples http:www.eecs.berkeley.edu~culler http:www-inst.eecs.berkeley.edu~cs150 Synchronous Sequential Circuits in Verilog module FF (CLK,Q,D); input D, CLK; output Q; reg Q; always @ (posedge CLK) Q=D; endmodule FF Seq. Circuit Behavior module ParToSer(LD, X, out, CLK); input [3:0] X; input LD, CLK; output out; reg out; reg [3:0] Q; always @ (posedge CLK) if (LD) Q=X; else Q = Q>>1;??? assign out = Q[0]; endmodule mux2 Other models module ParToSer(LD, X, out, CLK); input [3:0] X; input LD, CLK; output out; reg out; reg [3:0] Q; wire [3:0] A; A = LD? X : {0, Q[ 3:1 ] }; always @ (posedge CLK) Q = A; assign out = Q[0]; endmodule mux2 Outline Review Motivation: working with combinational logic Truth Tables vs Boolean Expressions vs Gates Minimal Operators Boolean Algebra Manipulating Expressions and Circuits Proofs: Term rewriting & Exhaustive Enumeration Simplifications De Morgan s Law Duality Canonical and minimal forms (maybe)

Combinational Logic (CL) Defined CL Block Example #1 Boolean Equation: y 0 = (x 0 AND not(x 1 )) OR (not(x 0 ) AND x 1 ) y 0 = x 0 x 1 '+ x 0 'x 1 y i = f i (x0,...., xn-1), where x, y are {0,1}. Y is a function of only X. Truth Table Description: x0 x1 y 0 0 0 0 1 1 0 1 0 Gate Representation: If we change X, Y will change immediately (well almost!). There is an implementation dependent delay from X to Y. 1 1 1 How would we prove that all three representations are equivalent? More Complex gate: xor x0 x1 y 0 0 0 0 1 1 1 0 1 1 1 0 The example is the standard function called exclusive-or (XOR,EXOR) Has a standard algebraic symbol: CL Block Example #2 4-bit adder: Truth Table Representation: And a standard gate symbol: R = A + B, c is carry out In general: 2 n rows for n inputs. 256 rows! Is there a more efficient (compact) way to specify this function? 4-bit Adder Example Motivate the adder circuit design by hand addition: c Add a0 and b0 as follows: carry to next stage co ci Add a1 and b1 as follows: 4-bit Adder Example In general: r i = a i XOR b i XOR c in c out = a i c in + a i b i + b i c in = c in (a i + b i ) + a i b i Now, the 4-bit adder: Full adder cell r = a XOR b c = a AND b = ab r = a XOR b XOR ci co = ab + aci + bci ripple adder

4-bit Adder Example Graphical Representation of FA-cell r i = a i XOR b i XOR c in c out = a i c in + a i b i + b i c in Alternative Implementation (with 2- input gates): r i = (a i XOR b i ) XOR c in c out = c in (a i + b i ) + a i b i Boolean AlgebraLogic Circuits Why are they called logic circuits? Logic: The study of the principles of reasoning. The 19th Century Mathematician, George Boole, developed a math. system (algebra) involving logic, Boolean Algebra. His variables took on TRUE, FALSE Later Claude Shannon (father of information theory) showed (in his Master s thesis!) how to map Boolean Algebra to digital circuits: Primitive functions of Boolean Algebra: Relationship Among Representations * Theorem: Any Boolean function that can be expressed as a truth table can be written as an expression in Boolean Algebra using AND, OR, NOT. unique? Truth Table not unique Boolean Expression [convenient for manipulation]? gate representation (schematic) [close to implementaton] How do we convert from one to the other? not unique Minimal set of functions Implement any logic functions from NOT, NOR, and NAND? For example, implementing X and Y is the same as implementing not (X nand Y) Do it with only NOR or only NAND NOT is just a NAND or a NOR with both inputs tied together and NAND and NOR are "duals", i.e., easy to implement one using the other X nand Y not ( (not X) nor (not Y) ) X nor Y not ( (not X) nand (not Y) ) Based on the mathematical foundations of logic: Boolean Algebra Announcements Homework 2 is due Friday Reading: Katz and Boriello 2.1-2.4 We will process wait list Lab exchange to get in same lab as partner An algebraic structure An algebraic structure consists of a set of elements B binary operations { +, } and a unary operation { '} such that the following axioms hold: 1. set B contains at least two elements, a, b, such that a b 2. closure: a + b is in B a b is in B 3. commutativity: a + b = b + a a b = b a 4. associativity: a + (b + c) = (a + b) + c a (b c) = (a b) c 5. identity: a + 0 = a a 1 = a 6. distributivity: a + (b c) = (a + b) (a + c) a (b + c) = (a b) + (a c) 7. complementarity: a + a'= 1 a a'= 0

Boolean algebra Boolean algebra B = {0, 1} + is logical OR, is logical AND 'is logical NOT All algebraic axioms hold Logic functions and Boolean algebra Any logic function that can be expressed as a truth table can be written as an expression in Boolean algebra using the operators: ', +, and! Possible logic functions of two variables 16 possible functions of 2 input variables: 2**(2**n) functions of n inputs Cost of different logic functions Some are easier, others harder, to implement Each has a cost associated with the number of switches needed 0 (F0) and 1 (F15): require 0 switches, directly connect output to lowhigh X (F3) and Y (F5): require 0 switches, output is one of inputs X'(F12) and Y'(F10): require 2 switches for "inverter" or NOT-gate X nor Y (F4) and X nand Y (F14): require 4 switches X or Y (F7) and X and Y (F1): require 6 switches X = Y (F9) and X Y (F6): require 16 switches Because NOT, NOR, and NAND are the cheapest they are the functions we implement the most in practice Axioms & theorems of Boolean algebra Identity 1. X + 0 = X 1D. X 1 = X Null 2. X + 1 = 1 2D. X 0 = 0 Idempotency: 3. X + X = X 3D. X X = X Involution: 4. (X')'= X Complementarity: 5. X + X'= 1 5D. X X'= 0 Commutativity: 6. X + Y = Y + X 6D. X Y = Y X Associativity: 7. (X + Y) + Z = X + (Y + Z) 7D. (X Y) Z = X (Y Z) Axioms and theorems of Boolean algebra (cont d) Distributivity: 8. X (Y + Z) = (X Y) + (X Z) 8D. X + (Y Z) = (X + Y) (X + Z) Uniting: 9. X Y + X Y'= X 9D. (X + Y) (X + Y') = X Absorption: 10. X + X Y = X 10D. X (X + Y) = X 11. (X + Y') Y = X Y 11D. (X Y') + Y = X + Y Factoring: 12. (X + Y) (X'+ Z) = 12D. X Y + X' Z = X Z + X' Y (X + Z) (X'+ Y) Concensus: 13. (X Y) + (Y Z) + (X' Z) = 13D. (X + Y) (Y + Z) (X'+ Z) = X Y + X' Z (X + Y) (X'+ Z)

Axioms and theorems of Boolean algebra (cont ) de Morgan's: 14. (X + Y +...)'= X' Y'... 14D. (X Y...)'= X'+ Y' +... generalized de Morgan's: 15. f'(x1,x2,...,xn,0,1,+, ) = f(x1',x2',...,xn',1,0,,+) establishes relationship between and + Axioms & theorems of Bool. Alg. - Duality Duality Dual of a Boolean expression is derived by replacing by +, + by, 0 by 1, and 1 by 0, and leaving variables unchanged Any theorem that can be proven is thus also proven for its dual! Meta-theorem (a theorem about theorems) duality: 16. X + Y +... X Y... generalized duality: 17. f (X1,X2,...,Xn,0,1,+, ) f(x1,x2,...,xn,1,0,,+) Different than demorgan s Law this is a statement about theorems this is not a way to manipulate (re-write) expressions Proving theorems (rewriting) Using the axioms of Boolean algebra: e.g., prove the theorem: X Y + X Y' = X Proving theorems (perfect induction) De Morgan s Law complete truth table, exhaustive proof " # $ " % "& e.g., prove the theorem: X + X Y = X "& " # "' "& = ( ) *+,( & $ (,( &+ ) * $ = Push inv. bubble from output to input and change symbol A simple example 1-bit binary adder inputs: A, B, Carry-in outputs: Sum, Carry-out, -. -.,-,-,-,- -,-,-,-,- Apply the theorems to simplify expressions The theorems of Boolean algebra can simplify Boolean expressions e.g., full adder's carry-out function (same rules apply to any function) -,-,-,-,-,-,-,-,-,-,-,-,-,-,-,,-,-,-,- -,-,-,- -,-,-,-,- -,-,-,-,- -,-,-,- -,-,-,- -,-,-- -,-, -,-,

Boolean expressions to logic gates Boolean expressions to logic gates NOT X' X ~X AND X Y XY X Y OR X + Y X Y NAND NOR XOR X Y XNOR X = Y 0+"00!!$0 0+"00$ $$0 From Boolean expressions to logic gates (cont d) More than one way to map expressions to gates e.g., Z = A' B' (C + D) = (A' (B' (C + D))) 1' 1 Waveform view of logic functions Just a sideways truth table but note how edges don't line up exactly it takes time for a gate to switch its output!!23,, - & 1' 1 - &!"#$%"%!"!" Choosing different realizations of a function, - 34 $ ( ) 1 34! ) * $ Which realization is best? Reduce number of inputs literal: input variable (complemented or not)» can approximate cost of logic gate as 2 transistors per literal» why not count inverters? Fewer literals means less transistors» smaller circuits Fewer inputs implies faster gates» gates are smaller and thus also faster Fan-ins (# of gate inputs) are limited in some technologies Reduce number of gates Fewer gates (and the packages they come in) means smaller circuits» directly influences manufacturing costs

Which is the best realization? (cont d) Reduce number of levels of gates Fewer level of gates implies reduced signal propagation delays Minimum delay configuration typically requires more gates» wider, less deep circuits How do we explore tradeoffs between increased circuit delay and size? Automated tools to generate different solutions Logic minimization: reduce number of gates and complexity Logic optimization: reduction while trading off against delay Are all realizations equivalent? Under the same inputs, the alternative implementations have almost the same waveform behavior delays are different glitches (hazards) may arise variations due to differences in number of gate levels and structure Three implementations are functionally equivalent Implementing Boolean functions Technology independent Canonical forms Two-level forms Multi-level forms Technology choices Packages of a few gates Regular logic Two-level programmable logic Multi-level programmable logic Canonical forms Truth table is the unique signature of a Boolean function Many alternative gate realizations may have the same truth table Canonical forms Standard forms for a Boolean expression Provides a unique algebraic signature Sum-of-products canonical forms Also known as disjunctive normal form Also known as minterm expansion, - 5 5 5,-,-,-,-,- 5,-,-,- Sum-of-products canonical form (cont d) Product term (or minterm) ANDed product of literals input combination for which output is true Each variable appears exactly once, in true or inverted form (but not both), -,-,-,- ',- 2,- 6,- %,- 7,- 8 3!!2 5$ $! & 5,- Σ 2%78 2 % 7 8,-,-,-,-,- $ $!! 5,-,-,-,-,-,-,,,,-,-,,-,- -,-,--,-

Product-of-sums canonical form Product-of-sums canonical form (cont d) Also known as conjunctive normal form Also known as maxterm expansion, - 5 5 5 5,-,-,-, -,- 9,- 9,- 9 ',- 9 2,- 9 6,- 9 %,- 9 7,- 9 8 Sum term (or maxterm) ORed sum of literals input combination for which output is false each variable appears exactly once, in true or inverted form (but not both) 5$ $! : 5,- Π9 '6 9 9 ' 9 6,-,-,- $ $!! 5,-,-,-,-,-,-,-,-,-- '(('('(''((''('('('(' 3!!2 S-o-P, P-o-S, and de Morgan s theorem Four alternative two-level implementations of F = AB + C Sum-of-products F'= A'B'C'+ A'BC'+ AB'C' Apply de Morgan's (F')'= (A'B'C'+ A'BC'+ AB'C')' F = (A + B + C) (A + B'+ C) (A'+ B + C) A B C F1 $ $ 3!3 $ 4 3!3 $ Product-of-sums F'= (A + B + C') (A + B'+ C') (A'+ B + C') (A'+ B'+ C) (A'+ B'+ C') Apply de Morgan's (F')'= ( (A + B + C')(A + B'+ C')(A'+ B + C')(A'+ B'+ C)(A'+ B'+ C') )' F = A'B'C + A'BC + AB'C + ABC'+ ABC F2 F3 $ $ $3!3 4 $3!3 F4 Waveforms for the four alternatives Waveforms are essentially identical Except for timing hazards (glitches) Delays almost identical (modeled as a delay per level, not type of gate or number of inputs to gate) Mapping between canonical forms Minterm to maxterm conversion Use maxterms whose indices do not appear in minterm expansion e.g., F(A,B,C) = Σm(1,3,5,6,7) = ΠM(0,2,4) Maxterm to minterm conversion Use minterms whose indices do not appear in maxterm expansion e.g., F(A,B,C) = ΠM(0,2,4) = Σm(1,3,5,6,7) Minterm expansion of F to minterm expansion of F' Use minterms whose indices do not appear e.g., F(A,B,C) = Σm(1,3,5,6,7) F'(A,B,C) = Σm(0,2,4) Maxterm expansion of F to maxterm expansion of F' Use maxterms whose indices do not appear e.g., F(A,B,C) = ΠM(0,2,4) F'(A,B,C) = ΠM(1,3,5,6,7)

Incompleteley specified functions Notation for incompletely specified functions Example: binary coded decimal increment by 1 BCD digits encode decimal digits 0 9 in bit patterns 0000 1001, - & ;!!3!; 3!; $&-!; $ $$ < 0 $0 $ $ 4 Don't cares and canonical forms So far, only represented on-set Also represent don't-care-set Need two of the three sets (on-set, off-set, dc-set) Canonical representations of the BCD increment by 1 function: Z = m0 + m2 + m4 + m6 + m8 + d10 + d11 + d12 + d13 + d14 + d15 Z = Σ [ m(0,2,4,6,8) + d(10,11,12,13,14,15) ] Z = M1 M3 M5 M7 M9 D10 D11 D12 D13 D14 D15 Z = Π [ M(1,3,5,7,9) D(10,11,12,13,14,15) ] Simplification of two-level comb. logic Finding a minimal sum of products or product of sums realization Exploit don't care information in the process Algebraic simplification Not an algorithmicsystematic procedure How do you know when the minimum realization has been found? Computer-aided design tools Precise solutions require very long computation times, especially for functions with many inputs (> 10) Heuristic methods employed "educated guesses" to reduce amount of computation and yield good if not best solutions Hand methods still relevant To understand automatic tools and their strengths and weaknesses Ability to check results (on small examples) Combinational logic summary Logic functions, truth tables, and switches NOT, AND, OR, NAND, NOR, XOR,..., minimal set Axioms and theorems of Boolean algebra Proofs by re-writing and perfect induction Gate logic Networks of Boolean functions and their time behavior Canonical forms Two-level and incompletely specified functions Later Two-level simplification using K-maps Automation of simplification Multi-level logic Design case studies Time behavior