Digital Logic & Computer Design CS Professor Dan Moldovan Spring 2010

Similar documents
Digital Logic & Computer Design CS Professor Dan Moldovan Spring Copyright 2007 Elsevier 2-<101>

Chapter 2. Introduction. Chapter 2 :: Topics. Circuits. Nodes. Circuit elements. Introduction

Logic Design Combinational Circuits. Digital Computer Design

COSC3330 Computer Architecture Lecture 2. Combinational Logic

CPE100: Digital Logic Design I

Karnaugh Maps (K-Maps)

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

Digital Design 2. Logic Gates and Boolean Algebra

CPE100: Digital Logic Design I

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

Administrative Notes. Chapter 2 <9>

211: Computer Architecture Summer 2016

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

This form sometimes used in logic circuit, example:

Possible logic functions of two variables

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

Combinational Logic (mostly review!)

CSE140: Components and Design Techniques for Digital Systems. Logic minimization algorithm summary. Instructor: Mohsen Imani UC San Diego

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

CPE100: Digital Logic Design I

ENG2410 Digital Design Combinational Logic Circuits

Fundamentals of Computer Systems

CHAPTER1: Digital Logic Circuits Combination 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):

Fundamentals of Computer Systems

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

CMSC 313 Lecture 19 Combinational Logic Components Programmable Logic Arrays Karnaugh Maps

Combinational Logic Circuits Part II -Theoretical Foundations

Week-I. Combinational Logic & Circuits

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

Part 5: Digital Circuits

Working with Combinational Logic. Design example: 2x2-bit multiplier

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

Chap 2. Combinational Logic Circuits

Minimization techniques

Show that the dual of the exclusive-or is equal to its compliment. 7

CMSC 313 Lecture 19 Homework 4 Questions Combinational Logic Components Programmable Logic Arrays Introduction to Circuit Simplification

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

Chapter 4 Optimized Implementation of Logic Functions

Logic Design. Chapter 2: Introduction to Logic Circuits

Contents. Chapter 3 Combinational Circuits Page 1 of 36

Review. EECS Components and Design Techniques for Digital Systems. Lec 06 Minimizing Boolean Logic 9/ Review: Canonical Forms

The Karnaugh Map COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

UNIT 5 KARNAUGH MAPS Spring 2011

CPE100: Digital Logic Design I

Slides for Lecture 19

CHAPTER III BOOLEAN ALGEBRA

Simplifying Logic Circuits with Karnaugh Maps

Chapter 7 Combinational Logic Networks

Textbook: Digital Design, 3 rd. Edition M. Morris Mano

CPE100: Digital Logic Design I

Combinational Logic. Review of Combinational Logic 1

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

Chapter 5. Digital systems. 5.1 Boolean algebra Negation, conjunction and disjunction

Chapter 2 Combinational logic

Logic. Basic Logic Functions. Switches in series (AND) Truth Tables. Switches in Parallel (OR) Alternative view for OR

Combinational Logic Design Principles

MODULAR CIRCUITS CHAPTER 7

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

EECS Variable Logic Functions

Review: Additional Boolean operations

CSE140: Components and Design Techniques for Digital Systems. Decoders, adders, comparators, multipliers and other ALU elements. Tajana Simunic Rosing

T02 Tutorial Slides for Week 6

CHAPTER III BOOLEAN ALGEBRA

Lecture 2 Review on Digital Logic (Part 1)

Digital Circuit And Logic Design I. Lecture 3

Unit 2 Session - 6 Combinational Logic Circuits

ECE 2300 Digital Logic & Computer Organization

Chapter 2: Switching Algebra and Logic Circuits

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

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

Chapter 7 Logic Circuits

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

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

MC9211 Computer Organization

Simplification of Boolean Functions. Dept. of CSE, IEM, Kolkata

ELCT201: DIGITAL LOGIC DESIGN

CS470: Computer Architecture. AMD Quad Core

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

CSE 140, Lecture 2 Combinational Logic CK Cheng CSE Dept. UC San Diego

Chapter 2 Combinational Logic Circuits

Boolean Logic Continued Prof. James L. Frankel Harvard University

L2: Combinational Logic Design (Construction and Boolean Algebra)

S.E. Sem. III [ETRX] Digital Circuit Design. t phl. Fig.: Input and output voltage waveforms to define propagation delay times.

Boolean cubes EECS150. Mapping truth tables onto cubes. Simplification. The Uniting Theorem. Three variable example

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

Boolean Algebra, Gates and Circuits

Basic Gate Repertoire

Logic. Combinational. inputs. outputs. the result. system can

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

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

Chapter 2 Combinational Logic Circuits

Boolean Algebra and Logic Simplification

Computer Organization I

Simlification of Switching Functions

Part 1: Digital Logic and Gates. Analog vs. Digital waveforms. The digital advantage. In real life...

Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps

14:332:231 DIGITAL LOGIC DESIGN

Outcomes. Spiral 1 / Unit 5. Logic Function Synthesis KARNAUGH MAPS. Karnaugh Maps

Transcription:

Digital Logic & Computer Design CS 434 Professor Dan Moldovan Spring 2 Copyright 27 Elsevier 2-<> Chapter 2 :: Combinational Logic Design Digital Design and Computer rchitecture David Money Harris and Sarah L. Harris Copyright 27 Elsevier 2-<2>

Chapter 2 :: Topics Introduction oolean Equations oolean lgebra From Logic to Gates Multilevel Combinational Logic s and Z s Karnaugh Maps Combinational uilding locks Timing Copyright 27 Elsevier 2-<3> Introduction logic circuit is composed of: Inputs Outputs Functional specification Timing specification inputs functional spec timing spec outputs Copyright 27 Elsevier 2-<4> 2

Circuits Nodes Inputs:,, C Outputs:, Z Internal: n Circuit elements E, E2, E3 Each a circuit C E E2 n E3 Z Copyright 27 Elsevier 2-<5> Types of Logic Circuits Combinational Logic Memoryless Outputs determined by current values of inputs Sequential Logic Has memory Outputs determined by previous and current values of inputs inputs functional spec timing spec outputs Copyright 27 Elsevier 2-<6> 3

Rules of Combinational Composition Every circuit element is itself combinational Every node of the circuit is either designated as an input to the circuit or connects to exactly one output terminal of a circuit element The circuit contains no cyclic paths: every path through the circuit visits each circuit node at most once Example: Copyright 27 Elsevier 2-<7> oolean Equations Functional specification of outputs in terms of inputs Example: S = F(,, C in ) C out = F(,, C in ) S C L C C out in S = C in C out = + C in + C in Copyright 27 Elsevier 2-<8> 4

Some Definitions Complement: variable with a bar over it,, C Literal: variable or its complement,,,, C, C Implicant: product of literals C, C, C Minterm: product that includes all input variables C, C, C Maxterm: sum that includes all input variables (++C), (++C), (++C) Copyright 27 Elsevier 2-<9> Sum-of-Products (SOP) Form ll oolean equations can be written in SOP form Each row in a truth table has a minterm minterm is a product (ND) of literals Each minterm is TRUE for that row (and only that row) The function is formed by ORing the minterms for which the output is TRUE Thus, a sum (OR) of products (ND terms) = F(, ) = minterm Copyright 27 Elsevier 2-<> 5

Sum-of-Products (SOP) Form ll oolean equations can be written in SOP form Each row in a truth table has a minterm minterm is a product (ND) of literals Each minterm is TRUE for that row (and only that row) The function is formed by ORing the minterms for which the output is TRUE Thus, a sum (OR) of products (ND terms) = F(, ) = minterm Copyright 27 Elsevier 2-<> Sum-of-Products (SOP) Form ll oolean equations can be written in SOP form Each row in a truth table has a minterm minterm is a product (ND) of literals Each minterm is TRUE for that row (and only that row) The function is formed by ORing the minterms for which the output is TRUE Thus, a sum (OR) of products (ND terms) minterm = F(, ) = + Copyright 27 Elsevier 2-<2> 6

Product-of-Sums (POS) Form ll oolean equations can be written in POS form Each row in a truth table has a maxterm maxterm is a sum (OR) of literals Each maxterm is FLSE for that row (and only that row) The function is formed by NDing the maxterms for which the output is FLSE Thus, a product (ND) of sums (OR terms) maxterm + + + + = F(, ) = ( + )( + ) Copyright 27 Elsevier 2-<3> oolean Equations Example ou are going to the cafeteria for lunch ou won t eat lunch (E) If it s not open (O) or If they only serve corndogs (C) Write a truth table for determining if you will eat lunch (E). O C E Copyright 27 Elsevier 2-<4> 7

oolean Equations Example ou are going to the cafeteria for lunch ou won t eat lunch (E) If it s not open (O) or If they only serve corndogs (C) Write a truth table for determining if you will eat lunch (E). O C E Copyright 27 Elsevier 2-<5> SOP & POS Form SOP sum-of-products O C E minterm O C O C O C O C POS product-of-sums O C maxterm O + C O + C O + C O + C Copyright 27 Elsevier 2-<6> 8

SOP & POS Form SOP sum-of-products O C E POS product-of-sums O C E minterm O C O C O C O C maxterm O + C O + C O + C O + C = OC = (O + C)(O + C)(O + C) Copyright 27 Elsevier 2-<7> oolean lgebra Set of axioms and theorems to simplify oolean equations Like regular algebra, but in some cases simpler because variables can have only two values ( or ) xioms and theorems obey the principles of duality: NDs and ORs interchanged, s and s interchanged Copyright 27 Elsevier 2-<8> 9

oolean xioms Copyright 27 Elsevier 2-<9> T: Identity Theorem = + = Copyright 27 Elsevier 2-<2>

T: Identity Theorem = + = = = Copyright 27 Elsevier 2-<2> T2: Null Element Theorem = + = Copyright 27 Elsevier 2-<22>

T2: Null Element Theorem = + = = = Copyright 27 Elsevier 2-<23> T3: Idempotency Theorem = + = Copyright 27 Elsevier 2-<24> 2

T3: Idempotency Theorem = + = = = Copyright 27 Elsevier 2-<25> T4: Identity Theorem = Copyright 27 Elsevier 2-<26> 3

T4: Identity Theorem = = Copyright 27 Elsevier 2-<27> T5: Complement Theorem = + = Copyright 27 Elsevier 2-<28> 4

T5: Complement Theorem = + = = = Copyright 27 Elsevier 2-<29> oolean Theorems: Summary Copyright 27 Elsevier 2-<3> 5

oolean Theorems of Several Variables Copyright 27 Elsevier 2-<3> Simplifying oolean Expressions: Example = + Copyright 27 Elsevier 2-<32> 6

Simplifying oolean Expressions: Example = + = ( + ) T8 = () T5 = T Copyright 27 Elsevier 2-<33> Simplifying oolean Expressions: Example 2 = ( + C) Copyright 27 Elsevier 2-<34> 7

Simplifying oolean Expressions: Example 2 = ( + C) = (( + C)) T8 = (()) T2 = () T = () T7 = T3 Copyright 27 Elsevier 2-<35> DeMorgan s Theorem = = + = + = Copyright 27 Elsevier 2-<36> 8

ubble Pushing Pushing bubbles backward (from the output) or forward (from the inputs) changes the body of the gate from ND to OR or vice versa. Pushing a bubble from the output back to the inputs puts bubbles on all gate inputs. Pushing bubbles on all gate inputs forward toward the output puts a bubble on the output and changes the gate body. Copyright 27 Elsevier 2-<37> ubble Pushing What is the oolean expression for this circuit? C D Copyright 27 Elsevier 2-<38> 9

ubble Pushing What is the oolean expression for this circuit? C D = + CD Copyright 27 Elsevier 2-<39> ubble Pushing Rules egin at the output of the circuit and work toward the inputs. Push any bubbles on the final output back toward the inputs. Draw each gate in a form so that bubbles cancel. C D Copyright 27 Elsevier 2-<4> 2

ubble Pushing Example C D Copyright 27 Elsevier 2-<4> ubble Pushing Example no output bubble C D Copyright 27 Elsevier 2-<42> 2

ubble Pushing Example no output bubble C D bubble on input and output C D Copyright 27 Elsevier 2-<43> ubble Pushing Example no output bubble C D C D no bubble on input and output bubble on input and output C D = C + D Copyright 27 Elsevier 2-<44> 22

From Logic to Gates Two-level logic: NDs followed by ORs Example: = C + C + C C C minterm: C minterm: C minterm: C Copyright 27 Elsevier 2-<45> Circuit Schematics with Style Inputs are on the left (or top) side of a schematic Outputs are on the right (or bottom) side of a schematic Whenever possible, gates should flow from left to right Straight wires are better to use than wires with multiple corners Copyright 27 Elsevier 2-<46> 23

Circuit Schematic Rules (cont.) Wires always connect at a T junction dot where wires cross indicates a connection between the wires Wires crossing without a dot make no connection wires connect at a T junction wires connect at a dot wires crossing without a dot do not connect Copyright 27 Elsevier 2-<47> Multiple Output Circuits Output asserted corresponding to most significant TRUE input 3 2 PRIORIT CiIRCUIT 3 2 3 2 3 2 Copyright 27 Elsevier 2-<48> 24

Multiple Output Circuits Output asserted corresponding to most significant TRUE input 3 2 PRIORIT CiIRCUIT 3 2 3 2 3 2 Copyright 27 Elsevier 2-<49> Priority Encoder Hardware 3 2 3 2 3 2 3 2 Copyright 27 Elsevier 2-<5> 25

Don t Cares 3 2 3 2 3 2 3 2 Copyright 27 Elsevier 2-<5> Contention: Contention: circuit tries to drive the output to and ctual value may be somewhere in between Could be a legal, a legal, or in the forbidden zone Might change with voltage, temperature, time, noise Often causes excessive power dissipation = = Contention usually indicates a bug. Fix it unless you are sure you know what you are doing. Warning: is used for don t care and contention Note the same thing Look at the context to tell them apart = Copyright 27 Elsevier 2-<52> 26

Floating: Z Floating, high impedance, open, high Z Floating output might be,, or somewhere in between voltmeter won t indicate whether a node is floating Tristate uffer E E Z Z Copyright 27 Elsevier 2-<53> Tristate usses Floating nodes are used in tristate busses Many different drivers Exactly one is active at any time processor en to bus from bus video to bus from bus Ethernet to bus from bus en2 en3 shared bus memory to bus from bus en4 Copyright 27 Elsevier 2-<54> 27

Karnaugh Maps (K-Maps) oolean expressions can be minimized by combining terms K-maps minimize equations graphically P + P = P C C C C C C C C C C C Copyright 27 Elsevier 2-<55> K-map Circle s in adjacent squares In the oolean expression, include only the literals whose true and complement form are not in the circle C C = Copyright 27 Elsevier 2-<56> 28

3-input K-map C C C C C C C C C Truth Table C K-Map C Copyright 27 Elsevier 2-<57> 3-input K-map C C C C C C C C C Truth Table K-Map C C = + C Copyright 27 Elsevier 2-<58> 29

K-map Definitions Complement: variable with a bar over it,, C Literal: variable or its complement,,,, C, C Implicant: product of literals C, C, C Prime implicant: implicant corresponding to the largest circle in a K-map Copyright 27 Elsevier 2-<59> K-map Rules Every in a K-map must be circled at least once Each circle must span a power of 2 (i.e., 2, 4) squares in each direction Each circle must be as large as possible circle may wrap around the edges of the K-map don't care () is circled only if it helps minimize the equation Copyright 27 Elsevier 2-<6> 3

4-input K-map C D CD Copyright 27 Elsevier 2-<6> 4-input K-map C D CD Copyright 27 Elsevier 2-<62> 3

4-input K-map C D CD = C + D + C + D Copyright 27 Elsevier 2-<63> K-maps with Don t Cares C D CD Copyright 27 Elsevier 2-<64> 32

K-maps with Don t Cares C D CD Copyright 27 Elsevier 2-<65> K-maps with Don t Cares C D CD = + D + C Copyright 27 Elsevier 2-<66> 33

Combinational uilding locks Multiplexers Decoders Copyright 27 Elsevier 2-<67> Multiplexer (Mux) Selects between one of N inputs to connect to the output. log 2 N-bit select input control input Example: 2: Mux S D D S D D Copyright 27 Elsevier 2-<68> 34

Multiplexer (Mux) Selects between one of N inputs to connect to the output. log 2 N-bit select input control input Example: 2: Mux S D D S D D Copyright 27 Elsevier 2-<69> S D D Multiplexer Implementations Logic gates Sum-of-products form D D S Tristates For an N-input mux, use N tristates Turn on exactly one to select the appropriate input = D S + D S S D D S D D Copyright 27 Elsevier 2-<7> 35

Logic using Multiplexers Using the mux as a lookup table = Copyright 27 Elsevier 2-<7> Logic using Multiplexers Reducing the size of the mux = Copyright 27 Elsevier 2-<72> 36

Decoders N inputs, 2 N outputs One-hot outputs: only one output HIGH at once 2:4 Decoder 3 2 3 2 Copyright 27 Elsevier 2-<73> Decoder Implementation 3 2 Copyright 27 Elsevier 2-<74> 37

Logic using Decoders OR minterms 2:4 Decoder Minterm = + = Copyright 27 Elsevier 2-<75> Timing Delay between input change and output changing How to build fast circuits? delay Time Copyright 27 Elsevier 2-<76> 38

Propagation & Contamination Delay Propagation delay: t pd = max delay from input to output Contamination delay: t cd = min delay from input to output t pd t cd Time Copyright 27 Elsevier 2-<77> Propagation & Contamination Delay Delay is caused by Capacitance and resistance in a circuit Speed of light limitation Reasons why t pd and t cd may be different: Different rising and falling delays Multiple inputs and outputs, some of which are faster than others Circuits slow down when hot and speed up when cold Copyright 27 Elsevier 2-<78> 39

Critical (Long) and Short Paths Critical Path C D n Short Path n2 Critical (Long) Path: t pd = 2t pd_nd + t pd_or Short Path: t cd = t cd_nd Copyright 27 Elsevier 2-<79> Glitches Glitch: when a single input change causes multiple output changes Glitches don t cause problems because of synchronous design conventions (which we ll talk about in a bit) ut it s important to recognize a glitch when you see one in timing diagrams Copyright 27 Elsevier 2-<8> 4

Glitch Example What happens when =, C =, falls? C C = + C Copyright 27 Elsevier 2-<8> Glitch Example (cont.) = = C = Critical Path n = n2 Short Path n2 n glitch Time Copyright 27 Elsevier 2-<82> 4

Fixing the Glitch C C = + C + C = = = C = Copyright 27 Elsevier 2-<83> Why Understand Glitches? Glitches don t cause problems because of synchronous design conventions (which we ll talk about in Chapter 3) ut it s important to recognize a glitch when you see one in simulations or on an oscilloscope Can t get rid of all glitches simultaneous transitions on multiple inputs can also cause glitches Copyright 27 Elsevier 2-<84> 42