1 COMP541 Combinational Logic - 3 Montek Singh Jan 21, 2010.

Slides:



Advertisements
Similar presentations
Part 4: combinational devices
Advertisements

컴퓨터구조론 교수 채수환. 교재 Computer Systems Organization & Architecture John D. Carpinelli, 2001, Addison Wesley.
Modular Combinational Logic
Combinational Circuits
Functions and Functional Blocks
Decoders/DeMUXs CS370 – Spring Decoder: single data input, n control inputs, 2 outputs control inputs (called select S) represent Binary index of.
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 Foundations of Software Design Lecture 3: How Computers Work Marti Hearst Fall 2002.
1 COMP541 Combinational Logic and Design Montek Singh Jan 30, 2007.
1 COMP541 Sequencing and Control Montek Singh Mar 29, 2007.
1 COMP541 Combinational Logic and Design Montek Singh Jan 25, 2007.
1 COMP541 Combinational Logic - 2 Montek Singh Jan 18, 2007.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 3 – Combinational Logic Design Part 2 –

1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 2 Combinational Logic Design.
1 COMP541 Combinational Logic - II Montek Singh Aug 27, 2014.
Shannon’s Expansion Muxes and Encoders. Tri-State Buffers  A tri-state buffer has one input x, one output f and one control line e Z means high impedance,
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Logic and Computer Design.
Some Useful Circuits Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.
Top-down modular design
Combinational Logic Design
Encoders Three-state Outputs Multiplexers XOR gates.
Outline Analysis of Combinational Circuits Signed Number Arithmetic
Chap 3. Chap 3. Combinational Logic Design. Chap Combinational Circuits l logic circuits for digital systems: combinational vs sequential l Combinational.
Logic Design A Review. Binary numbers Binary numbers to decimal  Binary 2 decimal  Decimal 2 binary.
CS1Q Computer Systems Lecture 8
Documentation Standards Circuit specification. –Description of what the system is supposed to do, including a description of all inputs and outputs and.
Digital Logic Design Review Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office: Ahmad Almulhem, KFUPM 2010.
Fall 2004EE 3563 Digital Systems Design EE3563 Multiplexers  A multiplexer is a digital switch  Allows a device to select a single line from many  Some.
ECE 545—Digital System Design with VHDL Lecture 3
ENG241 Digital Design Week #4 Combinational Logic Design.
1 COMP541 Combinational Logic - 4 Montek Singh Jan 30, 2012.
Combinational Design, Part 3: Functional Blocks
Multiplexers XOR gates. Multiplexers A multiplexer is a digital switch - it connects data from one of n sources to its output. An n-input and b-bit multiplexer.
1 Combinational Logic Design Digital Computer Logic Kashif Bashir
Kuliah Rangkaian Digital Kuliah 6: Blok Pembangun Logika Kombinasional Teknik Komputer Universitas Gunadarma.
Chapter 5 Designing Combinational Systems Tell me what you Have in Have out And want done in between Then I can build a program to do anything. Capt. Ed.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
COMP541 Arithmetic Circuits
CS 105 DIGITAL LOGIC DESIGN Chapter 4 Combinational Logic 1.
CS151 Introduction to Digital Design
Lecture 3. Combinational Logic 1 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
Chapter 2 Digital Design and Computer Architecture, 2 nd Edition Chapter 2 David Money Harris and Sarah L. Harris.
Decoder/Demultiplexer
1 COMP541 Combinational Logic - 3 Montek Singh Jan 23, 2012.
Lecture 3. Combinational Logic 2 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
COMP541 Combinational Logic - 4
ECOM 4311—Digital System Design with VHDL
CS1Q Computer Systems Lecture 8
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.
1 DLD Lecture 16 More Multiplexers, Encoders and Decoders.
Lecture 3. Combinational Logic #2 Prof. Taeweon Suh Computer Science & Engineering Korea University COSE221, COMP211 Logic Design.
Mu.com.lec 11.  Used not only to perform addition but also to perform subtraction, multiplication and division  The most basic of the adders is the.
COMP541 Combinational Logic - 3
COSC3330 Computer Architecture Lecture 2. Combinational Logic
COMP541 Combinational Logic - 3
Combinational Logic Circuits
COMP211 Computer Logic Design Lecture 3. Combinational Logic 2
ECE 434 Advanced Digital System L03
CPE/EE 422/522 Advanced Logic Design L02
Combinatorial Logic Design Practices
Thought of the Day To be what we are, and to become
ECE 352 Digital System Fundamentals
COMP541 Combinational Logic - 3
Digital System Design Combinational Logic
Chapter 2 Digital Design and Computer Architecture, 2nd Edition
Lecture 2: Combinational Logic Design
Presentation transcript:

1 COMP541 Combinational Logic - 3 Montek Singh Jan 21, 2010

Topics 2  Other gates, XOR  X’s – don’t cares Using encoder as example Using encoder as example  Z’s – floating values  Multiplexers and Decoders  Quick look at timing and glitches

Other Types of Gates 3  In practical terms, doesn’t matter for our FPGA But does for other technologies But does for other technologies

Exclusive OR 4  Exclusive OR  What lay people mean by “or”  Symbol is  Plus in a circle Plus in a circle

Parity Function 5  Recall how parity works Ask class Ask class  Write truth table for two input even parity What needs to be generated for parity bit? What needs to be generated for parity bit?  What function of two inputs gives you this?

XOR Gives Odd Function 6  As many inputs as necessary  How do you get odd parity?  Design even parity generator for 3-bit signal Perhaps make truth table and K-Map Perhaps make truth table and K-Map Draw with XOR, then sum-of-products w/ NAND gates Draw with XOR, then sum-of-products w/ NAND gates  How do you design a detector?  How about a 7-bit ASCII character?

Others 7

CMOS Transmission Gates 8  Act like electronic switches

XOR w/ Transmission Gate 9

Introduction to Circuits 10  A logic circuit is composed of: Inputs Inputs Outputs Outputs Functional specification Functional specification Timing specification Timing specification

Circuits  Nodes Inputs: A, B, C Inputs: A, B, C Outputs: Y, Z Outputs: Y, Z Internal: n1 Internal: n1  Circuit elements E1, E2, E3 E1, E2, E3 Each a circuit Each a circuit 11

Types of Logic Circuits  Combinational Logic Memoryless Memoryless Outputs determined by current values of inputs Outputs determined by current values of inputs  Sequential Logic Has memory Has memory Outputs determined by previous and current values of inputs Outputs determined by previous and current values of inputs 12

Rules of Combinational Composition Composition rules: Every circuit element is itself combinational 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 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  no output shorts The circuit contains no cyclic paths The circuit contains no cyclic paths  every path through the circuit visits each circuit node at most once (latches are made via a cyclic path) Example: Example: 13

Aside: Circuit Schematics with Style 14 Drawing style/conventions: (where possible) Inputs are on the left (or top) side of a schematic Inputs are on the left (or top) side of a schematic Outputs are on the right (or bottom) side of a schematic Outputs are on the right (or bottom) side of a schematic Gates should flow from left to right Gates should flow from left to right Straight wires are better to use than jagged wires Straight wires are better to use than jagged wires

Circuit Schematic Rules (cont.) Wire connections A dot where wires cross indicates a connection A dot where wires cross indicates a connection Wires crossing without a dot make no connection Wires crossing without a dot make no connection Wires always connect at a T junction Wires always connect at a T junction 15

Multiple Output Circuits Output asserted corresponding to most significant TRUE input 16

Priority Encoder Hardware 17

Don’t Cares (X) 18

Meanings of X 19  Don’t care  Contention (illegal input value)  Uninitialized value In a simulator In a simulator

Floating: Z  Floating, high impedance, open, high Z Floating output might be 0, 1, or somewhere in between Floating output might be 0, 1, or somewhere in between A voltmeter won’t indicate whether a node is floating A voltmeter won’t indicate whether a node is floating Allows connecting outputs Allows connecting outputs Tristate Buffer 20

Combinational Building Blocks  Multiplexers  Decoders  Encoders 21

Multiplexer (Mux) 22  Selects between one of N inputs to connect to the output.  log 2 N-bit select input – control input  Example: 2:1 Mux

Multiplexer Implementations  Logic gates Sum-of-products form Sum-of-products form  Tristates For an N-input mux, use N tristates For an N-input mux, use N tristates Turn on exactly one to select the appropriate input Turn on exactly one to select the appropriate input

Multiplexer with Hi-Z 24 Normal operation is blue area Smoke

Logic using Multiplexers  Using the mux as a lookup table

Verilog for Multiplexer 26  Just a conditional statement. For example, module mux2(input [3:0] d0, d1, input s, input s, output [3:0] y); output [3:0] y); assign y = s ? d1 : d0; assign y = s ? d1 : d0;endmodule

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

Decoder Implementation

Aside: Enable  Enable is a common input to logic functions  See it in memories and today’s logic blocks 29

2-to-4 Decoder with Enable 30

Verilog 31

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

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

3-to-8 Decoder: Schematic 34

3-to-8 Decoder: Multilevel Circuit 35

3-to-8 Decoder: Enable used for expansion 36

Multi-Level 6-to-64 Decoder 37

Uses for Decoders  Binary number might serve to select some operation  CPU op codes are encoded Decoder lines might select add, or subtract, or multiply, etc. Decoder lines might select add, or subtract, or multiply, etc.  Memory address lines 38

Logic using Decoders  OR the ON-set minterms

Demultiplexer  Takes one input  Out to one of 2 n possible outputs 40

Demux is a Decoder  With an enable 41

Encoder  Encoder is the opposite of decoder  2 n inputs (or fewer)  n outputs 42

Truth Table 43

Inputs are Minterms  Can OR them together appropriately  A 0 = D 1 + D 3 + D 5 + D 7 44

What’s the Problem?  What if D3 and D6 both high?  Simple OR circuit will set A to 7 45

Priority Encoder  Chooses one with highest priority Largest number, usually Largest number, usually  Note “don’t cares” 46 What if all inputs are zero?

Need Another Output  A “Valid” output 47

Valid is OR of inputs 48

Code Converters  One code to another  Book puts seven-segment decoder in this category  Typically multiple outputs Each output has function or truth table Each output has function or truth table 49

Seven-Segment Decoder  LAST Friday’s lab: Verilog of hex to LEDs  Extended version of book example 50

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

Delays  Transport delay = “pure” delay Output after a specified time Output after a specified time  Inertial delay No effect if input occurs for time that is too short (can’t overcome inertia) No effect if input occurs for time that is too short (can’t overcome inertia)  can filter out glitches 52

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

Effect of Inertial Delay 54 Blue – Propagation delay time Black – Rejection time

Propagation & Contamination Delay  Propagation delay: t pd max delay from input to output max delay from input to output  Contamination delay: t cd min delay from input to output min delay from input to output

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

Propagation & Contamination Delay 57

Critical (Long) Path: t pd = 2t pd_AND + t pd_OR Short Path: t cd = t cd_AND Critical and Short Paths Critical (Long) and Short Paths

Glitches  What is a Glitch? a non-monotonic change in a signal a non-monotonic change in a signal e.g., a single input change can cause multiple changes on the same output e.g., a single input change can cause multiple changes on the same output a multi-input transition can also cause glitches a multi-input transition can also cause glitches  Are glitches a problem? Not really in synchronous design Not really in synchronous design  Clock time period must be long enough for all glitches to subside Yes, in asynchronous design 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 It is important to recognize a glitch when you see one in simulations or on an oscilloscope Often cannot get rid of all glitches Often cannot get rid of all glitches

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

Glitch Example (cont.)

Fixing the Glitch  Add redundant logic term

Next  Hierarchical Design 63