EE 108A Lecture 2 (c) W. J. Dally and P. Levis 2

Similar documents
Unit 4. Combinational Circuits

Engr354: Digital Logic Circuits

CS 2204 DIGITAL LOGIC & STATE MACHINE DESIGN SPRING 2014

CARLETON UNIVERSITY. 1.0 Problems and Most Solutions, Sect B, 2005

Lesson 2.1 Inductive Reasoning

Solutions - Homework 1 (Due date: September 9:30 am) Presentation and clarity are very important!

Lesson 2.1 Inductive Reasoning

Digital Control of Electric Drives

CS 491G Combinatorial Optimization Lecture Notes

DeMorgan s Theorem. The dual DeMorgan D + E = D E D+E D E 1 D NOR D E. Slide 29 Modified; January 3, 2006 John Knight Digital Circuits p.

Chapter 4 State-Space Planning

expression simply by forming an OR of the ANDs of all input variables for which the output is

Combinational Logic. Precedence. Quick Quiz 25/9/12. Schematics à Boolean Expression. 3 Representations of Logic Functions. Dr. Hayden So.

18.06 Problem Set 4 Due Wednesday, Oct. 11, 2006 at 4:00 p.m. in 2-106

Lecture 6: Coding theory

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs

Digital Circuit Engineering

Nondeterministic Finite Automata

NON-DETERMINISTIC FSA

Lecture 11 Binary Decision Diagrams (BDDs)

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700: Digital Logic Design Fall Notes - Unit 1

Let's start with an example:

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design Winter Notes - Unit 1

CS12N: The Coming Revolution in Computer Architecture Laboratory 2 Preparation

Instructions. An 8.5 x 11 Cheat Sheet may also be used as an aid for this test. MUST be original handwriting.

Writing Exams: Writing Exams. Exam Review

, g. Exercise 1. Generator polynomials of a convolutional code, given in binary form, are g. Solution 1.

CS 573 Automata Theory and Formal Languages

Technology Mapping Method for Low Power Consumption and High Performance in General-Synchronous Framework

Solutions for HW9. Bipartite: put the red vertices in V 1 and the black in V 2. Not bipartite!

m2 m3 m1 (a) (b) (c) n2 n3

I 3 2 = I I 4 = 2A

Convert the NFA into DFA

CHAPTER 9 MULTIPLEXERS, DECODERS, AND PROGRAMMABLE LOGIC DEVICES

Regular expressions, Finite Automata, transition graphs are all the same!!

Algebra 2 Semester 1 Practice Final

Exam Review. John Knight Electronics Department, Carleton University March 2, 2009 ELEC 2607 A MIDTERM

CSC2542 State-Space Planning

K-map Definitions. abc

EE273 Lecture 15 Asynchronous Design November 16, Today s Assignment

Introduction to Electrical & Electronic Engineering ENGG1203

Logic Synthesis and Verification

Boolean algebra.

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

Chapter 2 Finite Automata

Metodologie di progetto HW Technology Mapping. Last update: 19/03/09

Project 6: Minigoals Towards Simplifying and Rewriting Expressions

Outline Last time: Deriving the State Diagram & Datapath (Cont.) Mapping the Datapath onto Control

Implication Graphs and Logic Testing

9.1 Day 1 Warm Up. Solve the equation = x x 2 = March 1, 2017 Geometry 9.1 The Pythagorean Theorem 1

Propositional models. Historical models of computation. Application: binary addition. Boolean functions. Implementation using switches.

Boolean Algebra cont. The digital abstraction

= x x 2 = 25 2

Automata and Regular Languages

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

ES-TA-3..1 Six- and Ten-Input E-Stop Safety Modules with DeviceNet

80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers

Lecture 08: Feb. 08, 2019

Lecture 6. CMOS Static & Dynamic Logic Gates. Static CMOS Circuit. PMOS Transistors in Series/Parallel Connection

Fast Boolean Algebra

Control with binary code. William Sandqvist

Homework 4. 0 ε 0. (00) ε 0 ε 0 (00) (11) CS 341: Foundations of Computer Science II Prof. Marvin Nakayama

System Validation (IN4387) November 2, 2012, 14:00-17:00

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution

= state, a = reading and q j

Automatic Synthesis of New Behaviors from a Library of Available Behaviors

Finite State Automata and Determinisation

CS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

Surds and Indices. Surds and Indices. Curriculum Ready ACMNA: 233,

Welcome. Balanced search trees. Balanced Search Trees. Inge Li Gørtz

sec x over the interval (, ). x ) dx dx x 14. Use a graphing utility to generate some representative integral curves of the function Curve on 5

Lexical Analysis Finite Automate

D. Harel, Statecharts: A visual formalism for complex systems, Science of Computer Programming 8, 1987, pp

ECE 327 Solution to Midterm 2016t1 (Winter)

Overview of Today s Lecture:

Minimal DFA. minimal DFA for L starting from any other

Good Review book ( ) ( ) ( )

Fault Modeling. EE5375 ADD II Prof. MacDonald

22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of:

INTRODUCTION TO AUTOMATA THEORY

Numbers and indices. 1.1 Fractions. GCSE C Example 1. Handy hint. Key point

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

More on automata. Michael George. March 24 April 7, 2014

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions

2.4 Theoretical Foundations

CSE 332. Sorting. Data Abstractions. CSE 332: Data Abstractions. QuickSort Cutoff 1. Where We Are 2. Bounding The MAXIMUM Problem 4

Particle Physics. Michaelmas Term 2011 Prof Mark Thomson. Handout 3 : Interaction by Particle Exchange and QED. Recap

Digital Circuit Engineering

Digital Circuit Engineering

EE 560 INTRODUCTION. Kenneth R. Laker, University of Pennsylvania

Arrow s Impossibility Theorem

First Midterm Examination

ECE223. R eouven Elbaz Office room: DC3576

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

Alpha Algorithm: Limitations

CSE 401 Compilers. Today s Agenda

Exercise 3 Logic Control

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS

where the box contains a finite number of gates from the given collection. Examples of gates that are commonly used are the following: a b

Transcription:

EE08A Leture 2: Comintionl Logi Design EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis Announements Prof. Levis will hve no offie hours on Friy, Jn 8. Ls n setions hve een ssigne - see the we pge Register for eelss Ls strt this week - no prel for L 0 Hnouts Leture notes Homework 2 L EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 2

Review Leture The worl is igitl Anlog t the eges, hrwre for emning prolems, 00x per ee Digitl signls Enoe isrete sttes in ontinuous signl Rejet noise Representtions Binry, set, ontinuous, ompoun Boolen Alger (0,,, ) Axioms, properties, ulity Logi equtions express inry funtions Comintionl logi Output is funtion only of urrent input Verilog Defines hrwre moules, ssign, se EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 3 Toy How to implement omintionl logi y hn Given esription of logi funtion Generte gte-level iruit tht relizes tht funtion Everyone nees to o this one To unerstn how its one Demystifies wht the synthesis tools o Better unerstning of wht synthesis tools n n n t o Mkes you etter t helping synthesis tool o goo jo In prtie you will rrely hve to o this y hn Generl prtie is: Design using Verilog Simulte with test ses Generte gtes with synthesis progrm EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 4 2

English lnguge esription of omintionl logi funtion F(,,,) is true if input,,, is prime EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 5 Truth Tle F(,,,) is true if input,,, is prime No q 0 0000 0 000 2 000 3 00 4 000 0 5 00 6 00 0 7 0 8 000 0 9 00 0 0 00 0 0 2 00 0 3 0 4 0 0 5 0 EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 6 3

Eqution F(,,,) is true if input,,, is prime! f = m(,2,3,5,7,,3) No q 0 0000 0 000 2 000 3 00 4 000 0 5 00 6 00 0 7 0 8 000 0 9 00 0 0 00 0 0 2 00 0 3 0 4 0 0 5 0 EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 7 Shemti Logi Digrm Shemti Logi Digrm: Eqution:! f = m(,2,3,5,7,,3) 2 3 5! f 7 3 EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 8 4

Cue representtion (3-it prime) f = m(,2,3,5,7 ) XX0 X0 00 0X 0 X00 XX XX 0 X 00 0X0 X0 0X X0 00X 000 00 0XX X0X X 0X X 0 XX EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 9 4-D Hyperue (4-it prime)! f = m(,2,3,5,7,,3) 000 0 00 00 0 000 0 EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 0 5

4-it Prime Numer Funtion (ont) 000 0 00 00 0 0xx 00x x0 x0 000 0 f = ( ) V ( ) V ( ) V ( ) V V V V V V V EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis Krnugh Mp of 4-it Prime 000 0 00 00 000 0 0 0 00 0 0 00 0 0 0 3 2 0 0 4 5 7 6 0 0 0 2 3 5 4 0 0 0 8 9 0 EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 2 6

Krnugh Mp of 4-it Prime: Minterms 0 0 00 00 0 0 0 3 2 4 5 7 6 2 3 5 4 8 9 0 Position of minterms on 4-it Krnugh mp EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 3 Krnugh Mp of 4-it Prime: Implints 00 0 0 00 0000 000 00 000 0 000 00 0 00 00 0 0 0 000 00 0 00 Ajent minterms iffer in extly one it Every positive minterm is n implint EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 4 7

Krnugh Mp of 4-it Prime: Lrger Implints 00 0 0 00 0000 000 00X 0 000 0 00 X0 00 0 0 000 00 0 00 Cn omine jent minterms into implints EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 5 Krnugh Mp of 4-it Prime: Ajeny 00 0 0 00 0000 000 X0 000 0 000 0 00 X0 00 0 0 000 00 X0 00 Cn omine jent minterms into implints Note eges wrp roun EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 6 8

Krnugh Mp of 4-it Prime: 00 0 0 00 0 0000 000 000 00 0 00 0 0 000 00 0 00 A lrger implint EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 7 0 00 0 Why mke implints overlp? Two resons:. Lrger implints hve fewer gtes. 2. Hzrs. More on them lter. 000 000 00 0 0 0 00 00 0 0 0 4 2 3 2 5 7 6 3 5 4 8 9 0 00 0 0 00X 0 0 00 0 0 0 0 0 0 0 0 0 X0 X0 9

0xx 00x x0 x0 0 0 00 00X 00 0 0 0 0 0 0 0 0 0 0 0 X0 X0 00X X0 X0 f In prtie, CMOS gtes re lwys inverting, so the rel iruit might look like this f Deiml prime numer funtion inlues on t res f =! m(,2,3,5,7) + D(0,,2,3,4,5) 00 0 0 00 0 0 0 0 0 x x x x 0 0 x x EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 20 0

Deiml prime numer funtion K-Mp XX 0 0 00 0 0 0 0 0 x x x x 0 0 x x X0X XX EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 2 Deiml prime numer funtion iruit Cover: X0X 00 0 0 00 0 0 0 0 X0X f = ( ) V ( ) V V x x x x 0 0 0 x x f X0X EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 22

Revisiting some efinitions (n some new ones) Minterm: prout term tht inlues eh input of iruit or its omplement. Implint: prout term tht if true implies the funtion is true. Prime Implint: is n implint tht nnot e me ny lrger n still e n implint. Essentil Prime Implint: the only prime implint tht ontins prtiulr minterm of the funtion. Distinguishe One: is minterm tht is ontine in only one implint. 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 23 Prout-of-Sums Implementtion Sum-of-Prouts iruit: fous on inputs sttes where truth tle is. Prout-of-Sums: fous on input sttes where truth tle is 0. Bsi pproh: esign for the omplement, pply DeMorgn s We en up with prout of sums, not sum of prouts 00 0 0 0 3 2 f =! M( 0,2) 4 5 7 6 0 0 0 0 00 2 3 5 4 8 9 0 EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 24 2

Prout-of-Sums Implementtion f =! M(0,2) 00 0 0 0 0 00 0 3 2 4 5 7 6 0 0 2 3 5 4 8 9 0 00 0 0 0 0 00 0 0 0 0 0 3 2 0 0 0 0 4 5 7 6 0 0 2 3 5 4 0 0 0 0 8 9 0 ( ) DeMorgn EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 25 Prout-of-Sums Exmple: Deiml Prime 0 0 00 00 0 0 0 0 3 2 0 0 4 5 7 6 x x x x 2 3 5 4 0 0 x x 8 9 0 f =! M ( 6,7,9,,5) + D(0,,2,3,4,5) EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 26 3

Hzrs 0 00 0 0 0 0 0 3 2 0 0 v 4 5 7 6 v 3 N e f N Stti- hzr e f EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 27 Cover trnsitions to eliminte hzrs 0 00 0 0 0 0 0 0 v 0 3 2 4 5 7 6 v v 3 N f EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 28 4

Reminer: 4-it Prime Numer Funtion 0 0 00 00X 00 0 0 0 0 0 0 0 0 0 0 0 X0 X0 00X X0 X0 f 0xx 00x x0 x0 f EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 29 4-it Prime Numer Funtion in Verilog Coe Using se moule prime(in, isprime) ; input [3:0] in ; // 4-it input output isprime ; // true if input is prime reg isprime ; lwys @(in) egin se(in),2,3,5,7,,3: isprime = ' ; efult: isprime = '0 ; ense en enmoule EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 30 5

4-it Prime Numer Funtion in Verilog Coe Using sex moule prime(in, isprime) ; input [3:0] in ; // 4-it input output isprime ; // true if input is prime reg isprime ; lwys @(in) egin sex(in) 4'0xx: isprime = ; 4'00x: isprime = ; 4'x0: isprime = ; 4'x0: isprime = ; efult: isprime = 0 ; ense en enmoule EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 3 4-it Prime Numer Funtion in Verilog Coe Using ssign moule prime(in, isprime) ; input [3:0] in ; // 4-it input output isprime ; // true if input is prime wire isprime = (in[0] & ~in[3]) (in[] & ~in[2] & ~in[3]) (in[0] & ~in[] & in[2]) (in[0] & in[] & ~in[2]) ; enmoule EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 32 6

Whih is etter esription? Why? Using se Using sex Using ssign moule prime(in, isprime) ; input [3:0] in ; output isprime ; reg isprime ; lwys @(in) egin se(in),2,3,5,7,,3: isprime = ' ; efult: isprime = '0 ; ense en enmoule moule prime(in, isprime) ; input [3:0] in ; output isprime ; wire isprime = (in[0] & ~in[3]) (in[] & ~in[2] & ~in[3]) (in[0] & ~in[] & in[2]) (in[0] & in[] & ~in[2]) ; enmoule moule prime(in, isprime) ; input [3:0] in ; output isprime ; reg isprime ; lwys @(in) egin sex(in) 4'0xx: isprime = ; 4'00x: isprime = ; 4'x0: isprime = ; 4'x0: isprime = ; efult: isprime = 0 ; ense en enmoule Mke your oe esy to re, unerstn, n reson out. EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 33 4-it Prime Numer Funtion in Verilog Coe Result of synthesizing esription using se moule prime ( in, isprime ); input [3:0] in; output isprime; wire n, n2, n3, n4; OAI3 U (.A(n2),.B(n),.B2(in[2]),.B3(in[3]),.Y(isprime) ); INV U2 (.A(in[]),.Y(n) ); INV U3 (.A(in[3]),.Y(n3) ); XOR2 U4 (.A(in[2]),.B(in[]),.Y(n4) ); OAI2 U5 (.A(in[0]),.B(n3),.B2(n4),.Y(n2) ); enmoule in[0] in[3] in[2] in[] U4 U3 n4 U2 n3 X0X X0X U5 X0 X0 n EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 34 n2 00X U isprime 7

Synthesis Reports **************************************** Report : re Design : prime Version: 2003.06 Dte : St Ot 4 :38:08 2003 **************************************** Lirry(s) Use: GS30KA_W_25_.35_CORE. (File: /home/imgine/from_ti/gs30k_.3/sun5/synop sys/li/gs30ka_w_25_.35_core.) Numer of ports: 5 Numer of nets: 9 Numer of ells: 5 Numer of referenes: 4 Comintionl re: 7.000000 Nonomintionl re: 0.000000 Net Interonnet re: unefine (Wire lo hs zero net re) Totl ell re: 7.000000 Totl re: unefine **************************************** Report : timing -pth full -ely mx -mx_pths Design : prime Version: 2003.06 Dte : St Ot 4 :38:08 2003 **************************************** Operting Conitions: Wire Lo Moel Moe: enlose Strtpoint: in[2] (input port) Enpoint: isprime (output port) Pth Group: (none) Pth Type: mx Des/Clust/Port Wire Lo Moel Lirry ------------------------------------------------ prime 2K_5LM GS30KA_W_25_.35_CORE. Point Inr Pth ---------------------------------------------------------- - input externl ely 0.000 0.000 r in[2] (in) 0.000 0.000 r U4/Y (EX20) 0.9 0.9 f U5/Y (BF05) 0.6 0.307 r U/Y (BF052) 0.68 0.475 f isprime (out) 0.000 0.475 f t rrivl time 0.475 ---------------------------------------------------------- - (Pth is unonstrine) EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 35 Constrint File rete_lok "lk" -nme lk -perio 2 -wveform {0.7} set_lok_unertinty 0.2 lk set_fix_hol ll_loks() set_lo -pin_lo 5 {isprime} set_input_ely 0.5 -lok lk {in} set_output_ely -mx 0.8 -lok lk {isprime} EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 36 8

Test enh moule test_prime ; reg [3:0] in ; wire isprime ; // instntite moule to test prime p0(in, isprime) ; initil egin in = 0 ; repet (6) egin #00 $isply("in = %2 isprime = %",in,isprime) ; in = in+ ; en en enmoule EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 37 Test enhes use very ifferent style of verilog Initil sttements $isply Repet n other looping onstruts #ely Don t use these onstruts in synthesizle moules EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 38 9

Testing Result # in = 0 isprime = 0 # in = isprime = # in = 2 isprime = # in = 3 isprime = # in = 4 isprime = 0 # in = 5 isprime = # in = 6 isprime = 0 # in = 7 isprime = # in = 8 isprime = 0 # in = 9 isprime = 0 # in = 0 isprime = 0 # in = isprime = # in = 2 isprime = 0 # in = 3 isprime = # in = 4 isprime = 0 # in = 5 isprime = 0 EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 39 Wve output 0 2 3 4 5 6 7 8 9 0 2 3 4 5 EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 40 20

moule prime_e(in, isprime) ; input [3:0] in ; // 4-it input output isprime ; // true if input is prime reg isprime ; lwys @(in) egin sex(in) 0,4,6,8,9: isprime = 0 ;,2,3,5,7: isprime = ; efult: isprime = x ; ense en enmoule Summry To minimize logi Write K-mp Fin ll prime implints Pik miniml set of prime implints tht overs the funtion Hzrs (output glithes) n e eliminte y overing trnsitions Verilog Cn represent with se, sex, ssign, or struturlly Use representtion tht is rele n mintinle se for truth tles ssign for equtions Don t try to o the logi esign yourself Synthesis tool will o the optimiztion Test enhes hek tht implementtion meets its speifition Test enhes use ifferent style of Verilog EE 08A Leture 2 () 2005-2008 W. J. Dlly n P. Levis 42 2