Penn ESE680-002 Spring2007 -- DeHon 1 ESE680-002 (ESE534): Computer Organization Day 2: January 10, 2007 Logic and FSM Review.

Slides:



Advertisements
Similar presentations
Finite State Machines (FSMs)
Advertisements

Penn ESE534 Spring DeHon 1 ESE534: Computer Organization Day 14: March 19, 2014 Compute 2: Cascades, ALUs, PLAs.
Give qualifications of instructors: DAP
Logic Synthesis – 3 Optimization Ahmed Hemani Sources: Synopsys Documentation.
Penn ESE370 Fall DeHon 1 ESE370: Circuit-Level Modeling, Design, and Optimization for Digital Systems Day 24: November 4, 2011 Synchronous Circuits.
Circuits require memory to store intermediate data
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
Caltech CS184a Fall DeHon1 CS184a: Computer Architecture (Structures and Organization) Day2: September 27, 2000 Logic, Gate, FSMs.
Penn ESE Spring DeHon 1 ESE (ESE534): Computer Organization Day 21: April 2, 2007 Time Multiplexing.
Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 13: March 4, 2009 FSM Equivalence Checking.
FSMs 1 Sequential logic implementation  Sequential circuits  primitive sequential elements  combinational logic  Models for representing sequential.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 2: January 23, 2008 Covering.
Caltech CS184a Fall DeHon1 CS184a: Computer Architecture (Structures and Organization) Day8: October 18, 2000 Computing Elements 1: LUTs.
Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 22: April 23, 2008 FSM Equivalence Checking.
Dr. Turki F. Al-Somani VHDL synthesis and simulation – Part 3 Microcomputer Systems Design (Embedded Systems)
Penn ESE Fall DeHon 1 ESE (ESE534): Computer Organization Day 19: March 26, 2007 Retime 1: Transformations.
Penn ESE Spring DeHon 1 ESE (ESE534): Computer Organization Day 11: February 14, 2007 Compute 1: LUTs.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 16: March 23, 2009 Covering.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 12: March 2, 2009 Sequential Optimization (FSM Encoding)
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 8: February 11, 2009 Dataflow.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 15: March 18, 2009 Static Timing Analysis and Multi-Level Speedup.
Penn ESE Spring DeHon 1 ESE (ESE534): Computer Organization Day 5: January 24, 2007 ALUs, Virtualization…
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 8: February 13, 2008 Retiming.
Zvi Kohavi and Niraj K. Jha 1 Capabilities, Minimization, and Transformation of Sequential Machines.
1 COMP541 State Machines Montek Singh Feb 8, 2012.
B-1 Appendix B - Reduction of Digital Logic Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 2: January 26, 2015 Covering Work preclass exercise.
EKT 221/4 DIGITAL ELECTRONICS II  Registers, Micro-operations and Implementations - Part3.
CALTECH CS137 Spring DeHon CS137: Electronic Design Automation Day 9: May 6, 2002 FSM Equivalence Checking.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 24: April 18, 2011 Covering and Retiming.
Introduction to State Machine
Caltech CS184 Winter DeHon CS184a: Computer Architecture (Structure and Organization) Day 2: January 8, 2003 Logic and FSM Review.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 20: April 8, 2015 Sequential Optimization (FSM Encoding)
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 23: April 20, 2015 Static Timing Analysis and Multi-Level Speedup.
Penn ESE534 Spring DeHon 1 ESE534: Computer Organization Day 2: January 20, 2010 Universality, Gates, Logic Work Preclass Exercise.
Technology Mapping. 2 Technology mapping is the phase of logic synthesis when gates are selected from a technology library to implement the circuit. Technology.
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Multi-Level Logic Synthesis.
Penn ESE534 Spring DeHon 1 ESE534: Computer Organization Day 4: January 25, 2012 Sequential Logic (FSMs, Pipelining, FSMD)
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 15: March 4, 2002 Two-Level Logic-Synthesis.
Introduction to ASIC flow and Verilog HDL
Penn ESE534 Spring DeHon 1 ESE534: Computer Organization Day 2: January 18, 2012 Universality, Gates, Logic Work Preclass Exercise.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 6: January 26, 2004 Sequential Optimization (FSM Encoding)
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 17: March 11, 2002 Sequential Optimization (FSM Encoding)
Penn ESE534 Spring DeHon 1 ESE534: Computer Organization Day 4: January 27, 2010 Sequential Logic (FSMs, Pipelining, FSMD)
Penn ESE370 Fall DeHon 1 ESE370: Circuit-Level Modeling, Design, and Optimization for Digital Systems Day 24: November 5, 2012 Synchronous Circuits.
Caltech CS184 Winter DeHon 1 CS184a: Computer Architecture (Structure and Organization) Day 11: January 31, 2005 Compute 1: LUTs.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 20: April 4, 2011 Static Timing Analysis and Multi-Level Speedup.
CBSSS 2002: DeHon Universal Programming Organization André DeHon Tuesday, June 18, 2002.
Penn ESE370 Fall DeHon 1 ESE370: Circuit-Level Modeling, Design, and Optimization for Digital Systems Day 20: October 25, 2010 Pass Transistors.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 15: March 13, 2013 High Level Synthesis II Dataflow Graph Sharing.
Penn ESE534 Spring DeHon 1 ESE534: Computer Organization Day 11: February 20, 2012 Instruction Space Modeling.
CALTECH CS137 Fall DeHon 1 CS137: Electronic Design Automation Day 2: September 28, 2005 Covering.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 25: April 17, 2013 Covering and Retiming.
ESE534: Computer Organization
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
ESE534: Computer Organization
COMP541 Sequential Logic – 2: Finite State Machines
ESE535: Electronic Design Automation
ESE535: Electronic Design Automation
Lecture 13 Logistics Last lecture Today HW4 up, due on Wednesday PLDs
CSE 370 – Winter Sequential Logic - 1
ESE534: Computer Organization
ESE535: Electronic Design Automation
ESE535: Electronic Design Automation
ECE 352 Digital System Fundamentals
ESE 150 – Digital Audio Basics
CSE 370 – Winter Sequential Logic-2 - 1
Presentation transcript:

Penn ESE Spring DeHon 1 ESE (ESE534): Computer Organization Day 2: January 10, 2007 Logic and FSM Review

Penn ESE Spring DeHon 2 Last Time Computational Design as an Engineering Discipline Importance of Costs

Penn ESE Spring DeHon 3 Today Simple abstract computing building blocks –gates, boolean logic –registers, RTL Logic in Gates –optimization –properties –costs Sequential Logic

Penn ESE Spring DeHon 4 Computer Architecture vs. Logic Design Logic Design is a mature discipline –There are a set of systematic techniques to implement and optimize –We can automate those techniques Nonetheless, solutions change with costs –We can automate wrt a single cost –Still work to do for multiple, incomparable costs

Penn ESE Spring DeHon 5 Stateless Functions (Combinational Logic) Compute some “function” –f(i 0,i 1,…i n )  o 0,o 1,…o m Each unique input vector –implies a particular, deterministic, output vector

Penn ESE Spring DeHon 6 Specification in Boolean logic –o=a+b –o=/(a*b) –o=a*/b –o=a*/b + b –o=a*b+b*c+d*e+/b*f + f*/a+abcdef –o=(a+b)(/b+c)+/b*/c

Penn ESE Spring DeHon 7 Implementation in Gates Gate: small Boolean function Goal: assemble gates to cover our desired Boolean function Collection of gates should implement same function I.e. collection of gates and Boolean function should have same Truth Table

Penn ESE Spring DeHon 8 Covering with Gates –o=(a+/b)(b+c)+/b*/c

Penn ESE Spring DeHon 9 Equivalence There is a canonical specification for a Boolean function –its Truth Table Two expressions, gate netlists, a gate netlist and an expression -- are the same iff. –They have the same truth table

Penn ESE Spring DeHon 10 Netlist Netlist: collection of interconnected gates –A list of all the gates and what they are connected to

Penn ESE Spring DeHon 11 Truth Table o=/a*/b*c+/a*b*/c+a*b*/c+a*/b*c a b c o

Penn ESE Spring DeHon 12 How many gates? o=/a*/b*c+/a*b*/c+a*b*/c+a*/b*c a b c o

Penn ESE Spring DeHon 13 How many gates? –o=(a+/b)(b+c)+/b*/c a b c o

Penn ESE Spring DeHon 14 Engineering Goal Minimize resources –area, gates Exploit structure of logic “An Engineer can do for a dime what everyone else can do for a dollar.”

Penn ESE Spring DeHon 15 Sum of Products o=/a*/b*c+/a*b*/c+a*b*/c+a*/b*c o=(a+b)(/b+/c) –a*b+a*/c+b*/c o=(a+/b)(b+c)+/b*/c –a*b+a*c+/b*c +/b*/c

Penn ESE Spring DeHon 16 Minimum Sum of Products o=/a*/b*c+/a*b*/c+a*b*/c+a*/b*c /b*c + b*/c

Penn ESE Spring DeHon 17 Minimum Sum of Products o=(a+b)(/b+/c) ab c a*/b+a*/c+b*/c a*/b + b*/c a*/b+a*/c+b*/c

Penn ESE Spring DeHon 18 Redundant Terms o=(a+b)(/b+/c) –a*/b+a*/c+b*/c –a*/b + b*/c ab c

Penn ESE Spring DeHon 19 There is a Minimum Area Implementation o=(a+b)(/b+/c) –a*/b+a*/c+b*/c –a*/b + b*/c ab c

Penn ESE Spring DeHon 20 There is a Minimum Area Implementation Consider all combinations of fewer gates: –any smaller with same truth table? –there must be a smallest one.

Penn ESE Spring DeHon 21 Not Always MSP o=(a+b)(c+d) 3 2-input gates –a*b+a*c+b*c +b*d 7 2-input gates Product of Sums smaller…

Penn ESE Spring DeHon 22 Minimize Area Area minimizing solutions depends on the technology cost structure Consider: –I1: ((a*b) + (c*d))*e*f –I2: ((a*b*e*f)+(c*d*e*f)) Area: –I1: 2*A(and2)+1*A(or2)+1*A(and3) –I2: 2*A(and4)+1*A(or2)

Penn ESE Spring DeHon 23 Minimize Area –I1: ((a*b) + (c*d))*e*f –I2: ((a*b*e*f)+(c*d*e*f)) Area: –I1: 2*A(and2)+1*A(or2)+1*A(and3) –I2: 2*A(and4)+1*A(or2) all gates take unit area:  A(l2)=3 < A(l1)=4 gate size proportional to number of inputs:  A(I1)=2*2+2+3=9 < A(I2)=2*4+2=10

Penn ESE Spring DeHon 24 Best Solution Depends on Costs This is a simple instance of the general point: …When technology costs change  the optimal solution changes. In this case, we can develop an automated decision procedure which takes the costs as a parameter.

Penn ESE Spring DeHon 25 Don’t Cares Sometimes will have incompletely specified functions: a b c o x x

Penn ESE Spring DeHon 26 Don’t Cares Will want to pick don’t care values to minimize implementation costs: a b c o x x a b c o

Penn ESE Spring DeHon 27 NP-hard in General Logic Optimization –Two Level Minimization –Covering w/ reconvergent fanout Are NP-hard in general –…but that’s not to say it’s not viable to find an optimal solution. Cover how to attack in an EDA class –can point you at rich literature –can find software to do it for you

Penn ESE Spring DeHon 28 Delay in Gates Simple model: –each gate contributes a fixed delay for passing through it –can be different delay for each gate type –e.g. inv = 50ps nand2=100ps nand3=120ps and2=130ps

Penn ESE Spring DeHon 29 Path Delay Simple Model: Delay along path is the sum of the delays of the gates in the path Path Delay = Delay(And3i2)+Delay(Or2)

Penn ESE Spring DeHon 30 Critical Path Path lengths in circuit may differ Worst-case performance of circuit determined by the longest path Longest path designated Critical Path

Penn ESE Spring DeHon 31 Multiple Paths Path Delay = Delay(And3i2)+Delay(Or2) Path Delay = Delay(Or2i1)+Delay(And2)+Delay(Or2)

Penn ESE Spring DeHon 32 Critical Path = Longest Path Delay = 2 Path Delay = 3

Penn ESE Spring DeHon 33 Critical Path There is always a set of critical paths –set such that the path length of the members is at least as long as any other path length May be many such paths

Penn ESE Spring DeHon 34 Minimum Delay There is a minimum delay for a given function and technology cost. Like area: –consider all circuits of delay 1, 2, …. –Work from 0 time (minimum gate delay) up –stop when find a function which implements the desired logic function –by construction no smaller delay implements function

Penn ESE Spring DeHon 35 Delay also depend on Costs Consider again: –I1: ((a*b) + (c*d))*e*f –I2: ((a*b*e*f)+(c*d*e*f)) Delay: –I1: D(and2)+D(or2)+D(and3) –I2: D(and4)+D(or2)

Penn ESE Spring DeHon 36 Delay also depend on Costs Delay: –I1: D(and2)+D(or2)+D(and3) –I2: D(and4)+D(or2) D(and2)=130ps, D(and3)=150ps, D(and4)=170ps  D(I2)=(170+D(or2))<D(I1)=( D(or2)) D(and2)=90ps, D(and3)=100ps, D(and4)=200ps  D(I2)=(200+D(or2))>D(I1)=( D(or2))

Penn ESE Spring DeHon 37 Delay and Area Optimum Differ –I1: ((a*b) + (c*d))*e*f –I2: ((a*b*e*f)+(c*d*e*f)) D(and2)=130ps, D(and3)=150ps, D(and4)=170ps  D(I2)<D(I1) gate size proportional to number of inputs:  A(I1)<A(I2) Induced Tradeoff -- cannot always simultaneously minimize area and delay cost

Penn ESE Spring DeHon 38 Does delay in Gates make Sense? Consider a balanced tree of logic gates of depth (tree height) n. Does this have delay n? – (unit delay gates) How big is it? (unit gate area) How long a side? Minimum wire length from input to output?

Penn ESE Spring DeHon 39 Delay in Gates make Sense? (continuing example) How big is it? (unit gate area) 2 n How long a side? Sqrt(2 n )= 2 (n/2) Minimum wire length from input to output? –2*2 (n/2) Delay per unit length? (speed of light limit) –Delay  2 (n/2)

Penn ESE Spring DeHon 40 It’s not all about costs... …or maybe it is, just not always about a single, linear cost. Must manage complexity –Cost of developing/verifying design –Size of design can accomplish in fixed time (limited brainpower) Today: human brainpower is most often the bottleneck resource limiting what we can build.

Penn ESE Spring DeHon 41 Review Logic Design Input specification as Boolean logic equations Represent canonically – remove specification bias Minimize logic Cover minimizing target cost

Penn ESE Spring DeHon 42 If’s If (a*b + /a*/b) c=d else c=e t=a*b+/a*/b c=t*d + /t*e

Penn ESE Spring DeHon 43 If  Mux Conversion Often convenient to think of IF’s as Multiplexers If (a*b + /a*/b) c=d else c=e

Penn ESE Spring DeHon 44 Muxes Mux: –Selects one of two (several) inputs based on control bit

Penn ESE Spring DeHon 45 Mux Logic Of course, Mux is just logic: –mux out = /s*a + s*b Two views logically equivalent –mux view more natural/abstract when inputs are multibit values (datapaths)

Penn ESE Spring DeHon 46 What about Tristates/busses? Tristate logic: –output can be 1, 0, or undriven –can wire together so outputs can share a wire Is this anything different?

Penn ESE Spring DeHon 47 Tristates Logically: –No, can model correct/logical operation of tristate bus with Boolean logic –Bus undriven (or multiply driven) is Don’t- Care case no one should be depending on value Implementation: –sometimes an advantage in distributed control don’t have to build monolithic, central controller

Penn ESE Spring DeHon 48 Finite Automata Recall from CSE262 (maybe ESE200?) A DFA is a quintuple M={K, , ,s,F} –K is finite set of states –  is a finite alphabet –s  K is the start state –F  K is the set of final states –  is a transition function from K  to K

Penn ESE Spring DeHon 49 Finite Automata Less formally: –Behavior depends not just on input (as was the case for combinational logic) –Also depends on state –Can be completely different behavior in each state –Logic/output now depends on state and input

Penn ESE Spring DeHon 50 Minor Amendment A DFA is a sextuple M={K, , ,s,F,  o } –  o is a finite set of output symbols –  is a transition function from K  to K  o

Penn ESE Spring DeHon 51 What power does the DFA add?

Penn ESE Spring DeHon 52 Power of DFA Process unbounded input with finite logic State is a finite representation of what’s happened before –finite amount of stuff can remember to synopsize the past State allows behavior to depend on past (on context)

Penn ESE Spring DeHon 53 Registers New element is a state element Canonical instance is a register: –remembers the last value it was given until told to change –typically signaled by clock

Penn ESE Spring DeHon 54 Issues of Timing... …many issues in detailed implementation –glitches and hazards in logic –timing discipline in clocking –…–… We’re going to work above that level for the most part this term. Watch for these details in ESE570

Penn ESE Spring DeHon 55 Same thing with registers Logic becomes: –if (state=s1) boolean logic for state 1 –(including logic for calculate next state) –else if (state=s2) boolean logic for state2 –… –if (state=sn) boolean logic for state n

Penn ESE Spring DeHon 56 Finite-State Machine (FSM) Logic core Plus registers to hold state

Penn ESE Spring DeHon 57 State Encoding States not (necessarily) externally visible We have freedom in how to encode them –assign bits to states Usually want to exploit freedom to minimize implementation costs –area, delay, energy (again, algorithms to attack -- EDA)

Penn ESE Spring DeHon 58 Multiple, Interacting FSMs What do I get when I wire together more than one FSM?

Penn ESE Spring DeHon 59 Multiple, Interacting FSMs What do I get when I wire together more than one FSM? Resulting composite is also an FSM –Input set is union of input alphabets –State set is product of states: e.g. for every sa i in A.K and sb j in B.K there will be a composite state (sa i, sb j ) in AB.K –Think about concatenating state bits

Penn ESE Spring DeHon 60 Multiple, Interacting FSMs In general, could get product number of states –|AB.K| = |A|*|B| … can get large fast All composite states won’t necessarily be reachable –so real state set may be < |A|*|B|

Penn ESE Spring DeHon 61 Multiple, Interacting FSMs Multiple, “independent” FSMs –often have implementation benefits localize inputs need to see simplify logic –decompose/ease design separate into small, understandable pieces –can sometimes obscure behavior not clear what composite states are reachable

Penn ESE Spring DeHon 62 FSM Equivalence Harder than Boolean logic Doesn’t have unique canonical form Consider: –state encoding not change behavior –two “equivalent” FSMs may not even have the same number of states –can deal with infinite (unbounded) input –...so cannot enumerate output in all cases

Penn ESE Spring DeHon 63 FSM Equivalence What matters is external observability –FA accepts and rejects same things –FSM outputs same signals in response to every possible input sequence Possible? –Finite state suggests there is a finite amount of checking required to verify behavior

Penn ESE Spring DeHon 64 FSM Equivalence Flavor Given two FSMs A and B –consider the composite FSM AB –Inputs wired together –Outputs separate Ask: –is it possible to get into a composite state in which A and B output different symbols? There is a literature on this

Penn ESE Spring DeHon 65 FSM Specification St1: goto St2 St2: –if (I==0) goto St3 –else goto St4 St3: –output o0=1 –goto St1 St4: –output o1=1 –goto St2 Could be: –behavioral language –computer language –state-transition graph

Penn ESE Spring DeHon 66 Systematic FSM Design Start with specification Can compute boolean logic for each state –If conversion… –including next state translation –Keep state symbolic (s1, s2…) Assign states Then have combinational logic –has current state as part of inputs –produces next state as part of outputs Design comb. Logic and add state registers

Penn ESE Spring DeHon 67 Admin: Reminder No class Monday –MLK Holiday Next class is Wednesday –Logic assignment due Wednesday Office Hours –Nachiket F 12:30-2:00pm (GRW 57) –André T 4:00-5:30pm This week Moore 305 (eventually GRW262)

Penn ESE Spring DeHon 68 Big Ideas [MSB Ideas] Can implement any Boolean function in gates Can implement any FA with gates and registers

Penn ESE Spring DeHon 69 Big Ideas [MSB-1 Ideas] Canonical representation for combinational logic Transformation –don’t have to implement the input literally –only have to achieve same semantics –trivial example: logic minimization There is a minimum delay, area Minimum depends on cost model