COMP541 Combinational Logic - 4

Slides:



Advertisements
Similar presentations
Modular Combinational Logic
Advertisements

Combinational Circuits
Functions and Functional Blocks
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 9 Programmable Configurations Read Only Memory (ROM) – –a fixed array of AND gates.
K-Maps, Timing Sequential Circuits: Latches & Flip-Flops Lecture 4 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier,
Overview Part 2 – Combinational Logic
1 COMP541 Combinational Logic and Design Montek Singh Jan 30, 2007.
Digital Fundamentals Floyd Chapter 4 Tenth Edition
Combinational Logic Building Blocks

1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 2 Combinational Logic Design.
EE2174: Digital Logic and Lab
Digital Fundamentals with PLD Programming Floyd Chapter 4
Combinational Logic Design
Encoders Three-state Outputs Multiplexers XOR gates.
Digital Logic Chapter 4 Presented by Prof Tim Johnson
Boolean Algebra and Digital Circuits
CS1Q Computer Systems Lecture 8
1 Digital Logic Design Week 5 Simplifying logic expressions.
Digital Logic Design Review Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office: Ahmad Almulhem, KFUPM 2010.
1 COMP541 Combinational Logic - 3 Montek Singh Jan 21, 2010.
1 © 2015 B. Wilkinson Modification date: January 1, 2015 Designing combinational circuits Logic circuits whose outputs are dependent upon the values placed.
ENG241 Digital Design Week #4 Combinational Logic Design.
1 COMP541 Combinational Logic - 4 Montek Singh Jan 30, 2012.
Digital Logic Problems (II) Prof. Sin-Min Lee Department of Mathematics and Computer Science.
Combinational Design, Part 3: Functional Blocks
Kuliah Rangkaian Digital Kuliah 6: Blok Pembangun Logika Kombinasional Teknik Komputer Universitas Gunadarma.
CHAPTER 4 Combinational Logic
UM EECS 270 Spring 2011 – Taken from Dr.Karem Sakallah Logic Synthesis: From Specs to Circuits Implementation Styles –Random –Regular Optimization Criteria.
Chapter 2 Digital Design and Computer Architecture, 2 nd Edition Chapter 2 David Money Harris and Sarah L. Harris.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 7 Dr. Shi Dept. of Electrical and Computer Engineering.
Fundamentals of digital electronics Prepared by - Anuradha Tandon Assistant Professor, Instrumentation & Control Engineering Branch, IT, NU.
Lecture 3. Combinational Logic 2 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
1 CS 151: Digital Design Chapter 3: Combinational Logic Design 3-1Design Procedure CS 151: Digital Design.
Boolean Expressions Lecture 3 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
1 ECE 545—Digital System Design with VHDL Lecture 1 Digital Logic Refresher Part A – Combinational Logic Building Blocks.
1 COMP541 Combinational Logic - 3 Montek Singh Jan 21, 2015.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Binary Numbers For digital systems, the.
Digital Logic Design Basics Combinational Circuits Sequential Circuits Pu-Jen Cheng Adapted from the slides prepared by S. Dandamudi for the book, Fundamentals.
1 DLD Lecture 16 More Multiplexers, Encoders and Decoders.
ECE 171 Digital Circuits Chapter 9 Hazards Herbert G. Mayer, PSU Status 2/21/2016 Copied with Permission from prof. Mark PSU ECE.
Lecture 3. Combinational Logic #2 Prof. Taeweon Suh Computer Science & Engineering Korea University COSE221, COMP211 Logic Design.
©2010 Cengage Learning SLIDES FOR CHAPTER 8 COMBINATIONAL CIRCUIT DESIGN AND SIMULATION USING GATES Click the mouse to move to the next page. Use the ESC.
K-maps and Decoders Prof. Sin-Min Lee Department of Computer Science.
Overview Part 2 – Combinational Logic Functions and functional blocks
COMP541 Combinational Logic - 3
COSC3330 Computer Architecture Lecture 2. Combinational Logic
CS221: Digital Logic Design Combinational Circuits 3
COMP541 Combinational Logic - 3
Combinational Logic Circuits
COMP211 Computer Logic Design Lecture 3. Combinational Logic 2
CPE/EE 422/522 Advanced Logic Design
ECE 434 Advanced Digital System L03
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
CPE/EE 422/522 Advanced Logic Design L02
Combinatorial Logic Design Practices
ECE434a Advanced Digital Systems L02
Programmable Configurations
COE 202: Digital Logic Design Combinational Circuits Part 3
Instructor: Alexander Stoytchev
Digital Fundamentals Floyd Chapter 4 Tenth Edition
Instructor: Alexander Stoytchev
ECE 352 Digital System Fundamentals
COMP541 Combinational Logic - 3
Digital System Design Combinational Logic
Chapter 2 Digital Design and Computer Architecture, 2nd Edition
ECE 352 Digital System Fundamentals
Lecture 2: Combinational Logic Design
Presentation transcript:

COMP541 Combinational Logic - 4 Montek Singh Sep 14-16, 2015

Today’s Topics Logic Minimization Combinational Building Blocks Karnaugh Maps Combinational Building Blocks Multiplexers Decoders Encoders Delays and Timing

Karnaugh Maps (K-maps) Graphical method for simplifying Boolean equations work well for up to 4 variables help quickly combine terms based on visual inspection Example: Figure 2.43 Three-input function: (a) truth table, (b) K-map, (c) K-map showing minterms

Karnaugh Maps K-Map structure: Example: up to 4 variables one or two variables  horizontal dimension one or two variables  vertical dimension rows/columns arranged so only one variable different among neighbors ends “wrap around” Example:

Logic Minimization using K-Maps Basic Idea: Simply “circle” all “rectangular” regions of 1’s in the K-map using the fewest possible number of circles each circle should be as large as possible Read off the products that were circled Here are the rules: use the fewest circles necessary to cover all the 1’s a circle must not contain any 0’s (don’t-cares are okay) each circle must span a rectangular block that is a power of 2 i.e., 1, 2, or 4 squares in each direction each circle should be as large as possible a circle may wrap around the edges of the K-map a 1 in a K-map may be circled multiple times if needed

An aside on notation In Boolean equations, complementation can be indicated in one of two ways: by using an overbar: e.g. best for handwriting or math/equation editors by using the prime symbol: e.g., X’ more convenient for basic wordprocessors

K-Map: Example 1 The two 1’s can be covered by a single circle the circle spans the region expressed as A’B’ hence, the minimized sum-of-products expression is:

K-Map: Example 2 Need only two products! the four 1’s on the corners can be covered by a single circle the 1st circle spans the region B’ the remaining 1 merges with its neighbor to the right the 2nd circle spans AC’ the minimal SOP expression is: the unminimized sum-of-minterms would have been:

K-Map: Example 3 (with Don’t Cares) Don’t-Cares can help simplify logic a circle may be expanded to include Don’t-Cares helps reduce size of product terms may help reduce the number of circles but Don’t-Cares do not have to be covered Example: if X’s in this K-map were 0’s 4 products would be needed products would be larger

Combinational Building Blocks Multiplexers Decoders Encoders

Multiplexer (Mux) Selects 1 out of N inputs Example: 2:1 Mux a control input (“select” signal) determines which input is chosen # bits in select = ceil(log2N) Example: 2:1 Mux 2 inputs 1 output 1-bit select signal

Multiplexer Implementations Logic gates Sum-of-products form Tristate buffers For an N-input mux, use N tristate buffers Turn on exactly one buffer to propagate the appropriate input all others are in floating (Hi-Z) state

Wider Multiplexers (4:1) A 4-to-1 mux has 4 inputs and 1 output selection signal now is 2 bits Several ways to implement: Figure 2.58 4:1 multiplexer implementations: (a) two-level logic, (b) tristates, (c) hierarchical

Combinational Logic using Multiplexers Implement a truth table using a mux use a mux with as many input lines are rows in the table Y values are fed into the mux’s data inputs AB values become the mux’s select inputs

SystemVerilog for Multiplexer Just a conditional statement: module mux(input wire d0, d1, input wire s, output logic y); assign y = s ? d1 : d0; endmodule Easily extends to multi-bit data inputs: module mux4bit(input wire [3:0] d0, d1, output logic [3:0] y);

SystemVerilog for Multiplexer Also extends to N-way multiplexers: module mux4way4bit( input wire [3:0] d0, d1, d2, d3, input wire [1:0] s, output logic [3:0] y); assign y = s[1] ? (s[0]? d3 : d2) : (s[0]? d1 : d0); endmodule Or, in a truth-table style: assign y = s == 2’b11 ? d3 : s == 2’b10 ? d2 : s == 2’b01 ? d1 : d0;

Decoders N inputs, 2N outputs “One-hot” outputs only one output HIGH at any given time

Decoder Implementation Each output is a minterm! Yk = 1 if the inputs A1A0 match corresponding row

Logic using Decoders Can implement Boolean function using decoders: decoder output is all minterms OR the ON-set minterms Example: For multiple outputs only one decoder needed one separate OR gate per output

Aside: Enable Enable is a common input to logic functions Two styles: Typically used in memories and some of today’s logic blocks Two styles: EN is ANDed with function turns output to 0 when not enabled EN’ is ORed with function turns output to 1 when not enabled

Other decoder examples

Decoder with Enable When not enabled, all outputs are 0 otherwise, 2-to-4 decoder

Decoders How about a… 1-to-2 decoder? 3-to-8 decoder? (N)-to-2(N) decoder? (N+1)-to-2(N+1) decoder?

3-to-8 Decoder: Truth Table Notice they are minterms

3-to-8 Decoder: Schematic

3-to-8 Decoder: “Enable” used for expansion

3-to-8 Decoder: Multilevel Circuit

Multi-Level 6-to-64 Decoder In general: Combine m-to-2m and n-to-2n decoders becomes an (m+n)-to-2(m+n) decoder

Uses for Decoders Binary number might serve to select some operation Number might encode a CPU Instruction (op codes) Decoder lines might select add, or subtract, or multiply, etc. Number might encode a Memory Address To read or write a particular location in memory

Demultiplexer (demux) Dual of multiplexer, but a relative of decoder One input, multiple outputs (destinations) Select signal routes input to one of the outputs n-bit select implies 2n outputs e.g., 4-way demux uses a 2-bit select routes input E to one of 4 outputs

Demux vs. Decoder Similarities Possible to make one from the other decoder produces a “1” on one of the 2N outputs … “0” elsewhere demultiplexer transmits data to one of the 2N outputs Possible to make one from the other How?

Encoder Encoder is the opposite of decoder 2N inputs (or fewer) N outputs

Encoder: Implementation Inputs are already minterms! Simply OR them together appropriately e.g.: A0 = D1 + D3 + D5 + D7

Encoder Implementation: Problem Specification assumes: Only one of the D inputs can be high What if, say, D3 and D6 are both high? simple OR circuit will set A to 7 so, must modify the spec to avoid this behavior

Solution: Priority Encoder Chooses one with highest priority Largest number, usually Note “don’t cares”

Priority Encoder What if all inputs are zero? Need another output: “Valid”

Priority Encoder Implementation Valid is simply the OR of all the data inputs

Code Converters General Converters convert one code to another examples?

Example: Seven-Segment Display convert single hex digit … … to a display character code) Will be used in the first lab using the hardware kit

Timing What is Delay? Time from input change to output change Transient response e.g., rising edge to rising edge Usually measured from 50% point

Types of Delays Transport delay = “pure” delay Inertial delay Whatever goes in … … comes out after a specified amount of time Inertial delay Inputs have an effect only if they persist for a specified amount of time No effect if input changes and changes back in too short a time (can’t overcome inertia) can filter out glitches

Effect of Transport Delay (blue) Delay just shifts signal in time focus on the blue bars; ignore the black ones AB

Effect of Inertial Delay Changes too close to each other cancel out focus on the black bars AB Blue – Propagation delay time Black – Rejection time (filter out)

Propagation & Contamination Delay Propagation delay: tpd max delay from input to output Contamination delay: tcd min delay from input to output

Propagation & Contamination Delay Delay is caused by Capacitance and resistance in a circuit More gates driven, longer delay Longer wires at output, longer delay Speed of light is the ultimate limitation Reasons why tpd and tcd may be vary: Different rising and falling delays What is typically reported? Greater of the two Multiple inputs and outputs, some faster than others Circuits slow down when hot and speed up when cold So, both maximum and typical given Specs provided in data sheets

Propagation Delay: Example

Critical and Short Paths Critical (Long) Path: tpd = 2tpd_AND + tpd_OR Short Path: tcd = tcd_AND

Glitches What is a Glitch? Are glitches a problem? a non-monotonic change in a signal e.g., a single input change can cause multiple changes on the same output a multi-input transition can also cause glitches Are glitches a problem? Not really in synchronous design Clock time period must be long enough for all glitches to subside Yes, in asynchronous design Absence of clock means there should ideally be no spurious signal transitions, esp. in control signals It is important to recognize a glitch when you see one in simulations or on an oscilloscope Often cannot get rid of all glitches

Glitch Example: Self-Study What happens when: A = 0, C = 1, and B goes from 1 to 0? Logically, nothing Because although 2nd term goes to false 1st term now is true But, output may glitch if one input to OR goes low before the other input goes high

Glitch Example: Self-Study (cont.)

Glitch Example: Self-Study (cont.) Fixing the glitch: Add redundant logic term A’C “bridges the two islands”

Next Sequential Design