Software Engineering 2DA4. Slides 3: Optimized Implementation of Logic Functions

Similar documents
Software Engineering 2DA4. Slides 9: Asynchronous Sequential Circuits

The word digital implies information in computers is represented by variables that take a limited number of discrete values.

EECS 270 Final Exam Spring 2012

EXPERIMENT: 1. Graphic Symbol: OR: The output of OR gate is true when one of the inputs A and B or both the inputs are true.

Lecture 8: Sequential Logic

Department of Electrical and Computer Engineering Mid-Term Examination Winter 2012

EECS 270 Midterm 2 Exam Closed book portion Fall 2014

Where Are We Now? e.g., ADD $S0 $S1 $S2?? Computed by digital circuit. CSCI 402: Computer Architectures. Some basics of Logic Design (Appendix B)

Section 001. Read this before starting!

EECS 270 Midterm Exam Spring 2011

EECS 270 Midterm 1 Exam Closed book portion Winter 2017

Computer Architecture and Organization

Final Exam review: chapter 4 and 5. Supplement 3 and 4

EECS 270 Homework the Last Winter 2017

COE328 Course Outline. Fall 2007

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 2 Logistics

A Review of logic design

DIGITAL ELECTRONICS MCQs

1. Convert the decimal number to binary, octal, and hexadecimal.

Using minterms, m-notation / decimal notation Sum = Cout = Using maxterms, M-notation Sum = Cout =

COMP sequential logic 1 Jan. 25, 2016

1. What does the signal for a static-zero hazard look like?

THE KENYA POLYTECHNIC

ME 515 Mechatronics. Introduction to Digital Electronics

Chapter 5 Sequential Circuits

Flip-Flops and Sequential Circuit Design

EE292: Fundamentals of ECE

CS 151 Final. Instructions: Student ID. (Last Name) (First Name) Signature

D Latch (Transparent Latch)

Department of CSIT. Class: B.SC Semester: II Year: 2013 Paper Title: Introduction to logics of Computer Max Marks: 30

ELEN Electronique numérique

Multi-Level Gate Circuits. Chapter 7 Multi-Level Gate Circuits NAND and NOR Gates. Some Terminologies (Cont.) Some Terminologies

St. MARTIN S ENGINEERING COLLEGE

Digital Circuit Engineering

Introduction to Digital Electronics

EECS 270 Group Homework 4 Due Friday. June half credit if turned in by June

211: Computer Architecture Summer 2016

MODULE 3. Combinational & Sequential logic

ELCT201: DIGITAL LOGIC DESIGN

COMP2611: Computer Organization. Introduction to Digital Logic

UNIT III. Combinational Circuit- Block Diagram. Sequential Circuit- Block Diagram

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

Sequential Logic Circuits

CPS311 Lecture: Sequential Circuits

LATCHES & FLIP-FLOP. Chapter 7

COE 202: Digital Logic Design Sequential Circuits Part 1. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

DIGITAL SYSTEM DESIGN UNIT I (2 MARKS)

MODEL QUESTIONS WITH ANSWERS THIRD SEMESTER B.TECH DEGREE EXAMINATION DECEMBER CS 203: Switching Theory and Logic Design. Time: 3 Hrs Marks: 100

Microprocessor Design

Chapter 5: Synchronous Sequential Logic

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) LATCHES and FLIP-FLOPS

For Teacher's Use Only Q Total No. Marks. Q No Q No Q No

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 3 Logistics

MUHAMMAD NAEEM LATIF MCS 3 RD SEMESTER KHANEWAL

1. a) For the circuit shown in figure 1.1, draw a truth table showing the output Q for all combinations of inputs A, B and C. [4] Figure 1.

UNIT 1: DIGITAL LOGICAL CIRCUITS What is Digital Computer? OR Explain the block diagram of digital computers.

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors

A clock is a free-running signal with a cycle time. A clock may be either high or low, and alternates between the two states.

Section 6.8 Synthesis of Sequential Logic Page 1 of 8

CHAPTER 4: Logic Circuits

Chapter 5 Synchronous Sequential Logic

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic

1. True/False Questions (10 x 1p each = 10p) (a) I forgot to write down my name and student ID number.

Previous Lecture Sequential Circuits. Slide Summary of contents covered in this lecture. (Refer Slide Time: 01:55)

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science SOLUTIONS

RELATED WORK Integrated circuits and programmable devices

DIGITAL CIRCUIT LOGIC UNIT 9: MULTIPLEXERS, DECODERS, AND PROGRAMMABLE LOGIC DEVICES

VU Mobile Powered by S NO Group

IT T35 Digital system desigm y - ii /s - iii

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

EMT 125 Digital Electronic Principles I CHAPTER 6 : FLIP-FLOP

Sequential Circuits: Latches & Flip-Flops

Rangkaian Sekuensial. Flip-flop

(CSC-3501) Lecture 7 (07 Feb 2008) Seung-Jong Park (Jay) CSC S.J. Park. Announcement

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute


Digital Principles and Design

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

ECE 555 DESIGN PROJECT Introduction and Phase 1

Chapter 8 Sequential Circuits

The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

Introduction Actel Logic Modules Xilinx LCA Altera FLEX, Altera MAX Power Dissipation

R13 SET - 1 '' ''' '' ' '''' Code No: RT21053

MUX AND FLIPFLOPS/LATCHES

Department of Computer Science and Engineering Question Bank- Even Semester:

DALHOUSIE UNIVERSITY Department of Electrical & Computer Engineering Digital Circuits - ECED 220. Experiment 4 - Latches and Flip-Flops

Sequential Logic. E&CE 223 Digital Circuits and Systems (A. Kennings) Page 1

ELE2120 Digital Circuits and Systems. Tutorial Note 7

Helping Material of CS302

Laboratory Objectives and outcomes for Digital Design Lab

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Digital Logic Design I

Flip-Flops. Because of this the state of the latch may keep changing in circuits with feedback as long as the clock pulse remains active.

INTRODUCTION TO SEQUENTIAL CIRCUITS

Other Flip-Flops. Lecture 27 1

DIGITAL CIRCUIT COMBINATORIAL LOGIC

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad ELECTRICAL AND ELECTRONICS ENGINEERING

ELCT201: DIGITAL LOGIC DESIGN

Synchronous Sequential Logic

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

Transcription:

Software Engineering 2DA4 Slides 3: Optimized Implementation of Logic Functions Dr. Ryan Leduc Department of Computing and Software McMaster University Material based on S. Brown and Z. Vranesic, Fundamentals of Digital Logic with Verilog Design, 3rd Ed. c 1999-2018 R.J. Leduc, M. Lawford 1

Motivation: Cost What is the cost of a circuit? x 1 x 2 f 1 0 0 0 0 1 1 1 0 0 1 1 1 f 1 = x 1 x 2 +x 1 x 2 Real cost depends on technology: 7400 chips: takes part of one or more chips CPLD: takes 1 macrocell Custom chip: takes 20 transistors (CMOS) A simple cost metric (ignore cost of inverters): Cost = # gates + # inputs For f 1 : Cost = 3 + 6 = 9. Need a method for synthesizing circuits of minimal cost. So far have used algebra. c 1999-2018 R.J. Leduc, M. Lawford 2

Karnaugh Maps We need a systematic method of optimization. Karnaugh maps were used in past to do optimization by hand. Now CAD tools do this automatically using more sophisticated techniques. Def: A K-map is a type of truth table, organized so that it shows product-terms that can be combined to reduce cost. All minterms that are adjacent in the map can be combined. Two cells are adjacent if the valuation of the input variables for each differ by only 1 bit! Cells labelled xy = 00 and xy = 01 are adjacent but cells labelled xy = 10 and xy = 01 are not. Thus in 3 variable tables, the columns are labeled such that only one variable changes in adjacent columns. c 1999-2018 R.J. Leduc, M. Lawford 3

Two Variable K-Maps c 1999-2018 R.J. Leduc, M. Lawford 4

Three Variable K-Maps c 1999-2018 R.J. Leduc, M. Lawford 5

Four Variable K-Maps c 1999-2018 R.J. Leduc, M. Lawford 6

Five Variable K-Maps c 1999-2018 R.J. Leduc, M. Lawford 7

Rules for K-maps (Sum-of-Products) 1. Must cover all squares containing 1s 2. Form largest group of 1s but group must be power of 2 (e.g. 1, 2, 4, 8 groups). Groups contain adjacent cells of ones only (ie. rectangles and squares of 1s). 3. Write Product term for group. Only include variables with constant value in group. 4. It is OK to cover a 1 multiple times. Why largest grouping and as a few groups as possible? To keep cost (#gates + #inputs) down. c 1999-2018 R.J. Leduc, M. Lawford 8

What if non-unique soln? Literal: Variable in complemented or uncomplemented form. ie. x 1, x 1 Implicant: A product term that indicates an input valuation for when given function equals 1. Most basic implicants are minterms of the function. Prime Implicant: An implicant that can t be combined into another implicant with fewer variables. Cover: Collection of implicants that account for all valuations where f = 1. Canonical sum-of-products an example. Essential Prime Implicant: A prime implicant that contains a 1 square in k-map that is not covered by any other prime implicant. c 1999-2018 R.J. Leduc, M. Lawford 9

Optimization Method 1. Find set of essential prime implicants. 2. If cover all 1-squares of k-map, then stop. 3. Determine non-essential prime implicants until all 1-squares covered, and minimum cost solution found. May have several variations to select from. c 1999-2018 R.J. Leduc, M. Lawford 10

Optimization Example c 1999-2018 R.J. Leduc, M. Lawford 11

Product-of-Sum Optimization Rules for K-maps: 1. Must cover all squares containing 0s 2. Form largest group of 0s but group must be power of 2 (e.g. 1, 2, 4, 8 groups). Groups contain adjacent cells of zeros only (ie. rectangles and squares of 0s). 3. Write sum term for group. Only include variables with constant value in group, and complement input variables. 4. It is OK to cover a 0 multiple times. If asked to find lowest cost circuit, do k-map for both sum-of-product and product-of-sums and choose lowest cost. c 1999-2018 R.J. Leduc, M. Lawford 12

Don t Care Conditions In a circuit with n inputs, we sometimes know that certain input patterns will never occur. E.g. 1 Circuit with cross-coupled switches that are impossible to simultaneously close (i.e. set to 1) x 1 x 2 f 0 0 0 0 1 1 1 0 1 1 1 d Here d = don t care (it will never happen). We can arbitrarily make d a 0 or 1. If d = 0, f = x 1 x 2 +x 1 x 2 (cost=9) If d = 1, f = x 1 +x 2 (cost=3) c 1999-2018 R.J. Leduc, M. Lawford 13

Don t Care Conditions - II We choose the value of d (0 or 1) to minimize the circuit. For k-maps, include a d in a group if can create a larger group, ignore otherwise. You do not have to cover all d items. When circling 1s, including a d in a group sets the function output to 1 for that input combination (i.e. you are choosing d= 1 for that item). Not including the d in some group of 1s, sets the function to zero for that input combination. When circling 0s, including a d in a group sets the function output to 0 for that input combination, else 1. c 1999-2018 R.J. Leduc, M. Lawford 14

Don t Care Conditions - e.g. 2 For 7-Segment Display, assume we only want to display numbers 0-9. We need 4 inputs. (why?) Also assume that we can guarantee that only 10 input patterns will ever occur. Synthesize a function for segment f. a a f g b f g b e c e c d d decimal point c 1999-2018 R.J. Leduc, M. Lawford 15

Don t Care Conditions - e.g. 2 - II f e a g d b c f e a g d decimal point b c x 1 x 2 x 3 x 4 Display f 0 0 0 0 0 1 0 0 0 1 1 0 0 0 1 0 2 0 0 0 1 1 3 0 0 1 0 0 4 1 0 1 0 1 5 1 0 1 1 0 6 1 0 1 1 1 7 0 1 0 0 0 8 1 1 0 0 1 9 1 1 0 1 0 d 1 0 1 1 d 1 1 0 0 d 1 1 0 1 d 1 1 1 0 d 1 1 1 1 d c 1999-2018 R.J. Leduc, M. Lawford 16

Introduction to D Flip-Flops A flip-flop is a storage device. A positive edge triggered D Flip-Flop stores whatever value is at its D input on the rising edge of the clock (when the clock input transitions from low to high). The stored value is assigned to its Q output. A positive edge-triggered D flip-flop ONLY stores a new value on the rising edge of the clock, and ignores changes on its D input otherwise. A negative edge-triggered D Flip-Flop behaves the same except it only stores a value on the negative edge of the clock (when the clock transitions from high to low). c 1999-2018 R.J. Leduc, M. Lawford 17

Introduction to D Flip-Flops - II Figure shows, from top to bottom, a D latch (ignore for now), a positive edge-triggered D Flip-Flop, and a negative edge-triggered D Flip-Flop. c 1999-2018 R.J. Leduc, M. Lawford 18

D Flip-Flops with Reset Sometimes want to ensure the D flip-flop has a known value. A RESET (CLEAR) input added to the flip-flop allows us to force stored output to go to zero. Example below has an active high RESET. Reset is asynchronous as it doesn t wait for clock edge to set Q to zero; it takes effect immediately. c 1999-2018 R.J. Leduc, M. Lawford 19

Data Registers If we combine 4 D flip-flops with reset, we can create a 4 bit data register with reset. c 1999-2018 R.J. Leduc, M. Lawford 20