FSM Specification. State minimization

Similar documents
Counters are sequential circuits which "count" through a specific state sequence.

Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs

Topics of Chapter 5 Sequential Machines. Memory elements. Memory element terminology. Clock terminology

IE1204 Digital Design F12: Asynchronous Sequential Circuits (Part 1)

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

Decomposition of Finite State Machines for Area, Delay Minimization

CHAPTER 5 FINITE STATE MACHINE FOR LOOKUP ENGINE

Discuss the size of the instance for the minimum spanning tree problem.

FSM Decomposition and Functional Verification of FSM Networks

Lecture 7: NP-Complete Problems

JUST-IN-TIME SCHEDULING WITH PERIODIC TIME SLOTS. Received December May 12, 2003; revised February 5, 2004

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

Clustering and scheduling maintenance tasks over time

BOOLEAN ALGEBRA & LOGIC GATES

Combinational Logic Design Process

High Performance Computing for Operation Research

Cloud Computing is NP-Complete

Informatique Fondamentale IMA S8


Optimal Technology Mapping and Cell Merger for Asynchronous Threshold Networks

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Scheduling Shop Scheduling. Tim Nieberg

6.852: Distributed Algorithms Fall, Class 2

Decomposition of Finite State Machines for Area, Delay Minimization

npsolver A SAT Based Solver for Optimization Problems

How To Solve A Minimum Set Covering Problem (Mcp)

Introduction to CMOS VLSI Design (E158) Lecture 8: Clocking of VLSI Systems

Lecture 8: Synchronous Digital Systems

Combinatorial PCPs with ecient veriers

One last point: we started off this book by introducing another famously hard search problem:

5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

Complexity Classes P and NP

Lecture 7: Clocking of VLSI Systems

Analysis of Algorithms, I

Finite State Machine. RTL Hardware Design by P. Chu. Chapter 10 1

Planning and Scheduling in the Digital Factory

Network (Tree) Topology Inference Based on Prüfer Sequence

Digital Electronics Detailed Outline

Compact Representations and Approximations for Compuation in Games

Scheduling Home Health Care with Separating Benders Cuts in Decision Diagrams

FUZZY CLUSTERING ANALYSIS OF DATA MINING: APPLICATION TO AN ACCIDENT MINING SYSTEM

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Introduction to Machine Learning and Data Mining. Prof. Dr. Igor Trajkovski

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

Handout #Ch7 San Skulrattanakulchai Gustavus Adolphus College Dec 6, Chapter 7: Digraphs

FINITE STATE MACHINE: PRINCIPLE AND PRACTICE

SIMS 255 Foundations of Software Design. Complexity and NP-completeness

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)

Chapter 6: Episode discovery process

1 Approximating Set Cover

Elementary Logic Gates

Machines with Memory

Offline 1-Minesweeper is NP-complete

Lecture 1: Systems of Linear Equations

Determination of the normalization level of database schemas through equivalence classes of attributes

Coding and decoding with convolutional codes. The Viterbi Algor

CSE140: Midterm 1 Solution and Rubric

Switching and Finite Automata Theory

A Lab Course on Computer Architecture

Fault Modeling. Why model faults? Some real defects in VLSI and PCB Common fault models Stuck-at faults. Transistor faults Summary

UNIVERSIDADE DE SÃO PAULO

Compression algorithm for Bayesian network modeling of binary systems

Diversity Coloring for Distributed Data Storage in Networks 1

Why? A central concept in Computer Science. Algorithms are ubiquitous.

TD 271 Rev.1 (PLEN/15)

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012

PROGETTO DI SISTEMI ELETTRONICI DIGITALI. Digital Systems Design. Digital Circuits Advanced Topics

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

Introduction to computer science

On the Relationship between Classes P and NP

Synthesis of Low-Power Selectively- Clocked Systems from High-Level Specification

Chapter 5. Sequential Logic

A Working Knowledge of Computational Complexity for an Optimizer

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

Lecture 5: Gate Logic Logic Optimization

How To Write A Hexadecimal Program

Asynchronous counters, except for the first block, work independently from a system clock.

ANALOG & DIGITAL ELECTRONICS

NP-complete? NP-hard? Some Foundations of Complexity. Prof. Sven Hartmann Clausthal University of Technology Department of Informatics

Topology-based network security

Approximated Distributed Minimum Vertex Cover Algorithms for Bounded Degree Graphs

Introduction to Logic in Computer Science: Autumn 2006

Approximation Algorithms

System Interconnect Architectures. Goals and Analysis. Network Properties and Routing. Terminology - 2. Terminology - 1

1 Example of Time Series Analysis by SSA 1

Quantum Computing. Robert Sizemore

Lecture 1: Course overview, circuits, and formulas

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

Minimizing the Eect of Clock Skew. Via Circuit Retiming 1. Technical Report May, 1992

CS 3719 (Theory of Computation and Algorithms) Lecture 4

THE FUNDAMENTAL THEOREM OF ALGEBRA VIA PROPER MAPS

Lecture Notes 10

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute 5. LECTURE: REGISTERS AND RELATED

Chapter 1. Computation theory

Graphical degree sequences and realizations

路 論 Chapter 15 System-Level Physical Design

POMPDs Make Better Hackers: Accounting for Uncertainty in Penetration Testing. By: Chris Abbott

Some other convex-valued selection theorems 147 (2) Every lower semicontinuous mapping F : X! IR such that for every x 2 X, F (x) is either convex and

Transcription:

FINITE-STATE MACHINE OPTIMIZATION cgiovanni De Micheli Stanford University Outline Modeling synchronous circuits: { State-based models. { Structural models. State-based optimization methods: { State minimization. { State encoding. Synchronous Logic Circuits Modeling synchronous circuits Interconnection of: { Combinational logic gates. { Synchronous delay elements: E-T or M-S registers. State-based model: { Model circuits as nite-state machines. { Represent by state tables/diagrams. { Apply exact/heuristic algorithms for: State minimization. State encoding. Assumptions: { No direct combinational feedback. { Single-phase clocking. Structural models: { Represent circuit by synchronous logic network. { Apply: Retiming. Logic transformations.

State-based optimization Formal nite-state machine model A set of primary inputs patterns X. A set of primary outputs patterns Y. A set of states S. FSM Specification State Minimization A state transition function: { : X S! S. An output function: State Encoding Combinational Optimization { : X S! Y for Mealy models { : S! Y for Moore models. State minimization for completely specied FSMs State minimization Equivalent states: Completely specied nite-state machines : { No don't care conditions. { Easy to solve. Incompletely specied nite-state machines : { Unspecied transitions and/or outputs. { Intractable problem. { Given any input sequence the corresponding output sequences match. Theorem: { Two states are equivalent i: they lead to identical outputs and their next-states are equivalent. Equivalence is transitive: { Partition states into equivalence classes. { Minimum nite-state machine is unique.

INPUT STATE N-STATE OUTPUT 0 s 1 s 3 1 1 s 1 s 5 1 0 s 2 s 3 1 1 s 2 s 5 1 0 s 3 s 2 0 1 s 3 s 1 1 0 s 4 s 4 0 1 s 4 s 5 1 0 s 5 s 4 1 1 s 5 s 1 0 0/1 3 1/1 1 4 0/1 0/1 0/0 1/0 1/1 2 1/1 5 1/1 0/0 Algorithm Algorithm Stepwise partition renement. Initially: { All states in the same partition block. Then: { Rene partition blocks. At convergence: 1 = States belong to the same block when outputs are the same for any input. While further splitting is possible: { k+1 = States belong to the same block if they were previously in the same block and their next-states are in the same block of k for any input. { Blocks identify equivalent states.

1 = ffs 1 s 2 g fs 3 s 4 g fs 5 gg: minimal nite-state machine 2 = ffs 1 s 2 g fs 3 g fs 4 g fs 5 gg: 2 = is a partition into equivalence classes: { States fs 1 s 2 g are equivalent. INPUT STATE N-STATE OUTPUT 0 s 12 s 3 1 1 s 12 s 5 1 0 s 3 s 12 0 1 s 3 s 12 1 0 s 4 s 4 0 1 s 4 s 5 1 0 s 5 s 4 1 1 s 5 s 12 0 0/1 3 1/1 12 4 0/0 Computational complexity Polynomially-bound algorithm. There can be at most jsj partition renements. 0/1 0/0 1/0 1/1 1/1 0/1 5 1/1 Each renement requires considering each state: { Complexity O(jSj 2 ). Actual time may depend upon: { Data-structures. { Implementation details.

State minimization for incompletely specied FSMs Applicable input sequences: { All transitions are specied. Compatible states: { Given any applicable input sequence the corresponding output sequences match. State minimization for incompletely specied FSMs Compatibility is not an equivalency relation. Minimum nite-state machine is not unique. Implication relations make problem intractable. Theorem: { Two states are compatible i: they lead to identical outputs (when both are specied) and their next-states are compatible (when both are specied). Trivial method for the sake of illustration Consider all the possible don't care assignments. INPUT STATE N-STATE OUTPUT 0 s 1 s 3 1 1 s 1 s 5 * 0 s 2 s 3 * 1 s 2 s 5 1 0 s 3 s 2 0 1 s 3 s 1 1 0 s 4 s 4 0 1 s 4 s 5 1 0 s 5 s 4 1 1 s 5 s 1 0 { n don't care imply 2 n completely specied FSMs. 2 n solutions. : { Replace * by 1. = ffs 1 s 2 g fs 3 g fs 4 g fs 5 gg: { Replace * by 0. = ffs 1 s 5 g fs 2 s 3 s 4 gg:

Compatibility and implications Compatibility and implications Compatible states fs 1 s 2 g. If fs 3 s 4 g are compatible: { then fs 1 s 5 g are compatible. Incompatible states fs 2 s 5 g. Compatible pairs: { fs 1 s 2 g { fs 1 s 5 g ( fs 3 s 4 g { fs 2 s 4 g ( fs 3 s 4 g { fs 2 s 3 g ( fs 1 s 5 g { fs 3 s 4 g ( fs 2 s 4 g [ fs 1 s 5 g Incompatible pairs: { fs 2 s 5 g fs 3 s 5 g { fs 1 s 4 g fs 4 s 5 g { fs 1 s 3 g Compatibility and implications A class of compatible states is such that all state pairs are compatible. Maximal compatible classes A class is maximal: { If not subset of another class. Closure property: { A set of classes such that all compatibility implications are satised. fs 1 s 2 g fs 1 s 5 g ( fs 3 s 4 g fs 2 s 3 s 4 g ( fs 1 s 5 g Cover with MCC has cardinality 3. The set of maximal compatibility classes: { Has the closure property. { May not provide a minimum solution.

Formulation of the state minimization problem Prime compatible classes A class is prime, if not subset of another class implying the same set or a subset of classes. Compute the prime compatibility classes. Select a minimum number of PCC such that: { all states are covered. { all implications are satised. Binate covering problem. fs 1 s 2 g fs 1 s 5 g ( fs 3 s 4 g fs 2 s 3 s 4 g ( fs 1 s 5 g Minimum cover: ffs 1 s 5 g fs 2 s 3 s 4 gg. Minimum cover has cardinality 2. Heuristic algorithms State encoding Determine a binary encoding of the states: Approximate the covering problem. { Preserve closure property. { Sacrice minimality. { that optimize machine implementation: area. cycle-time. Consider all maximal compatibility classes. { May not yield minimum. Modeling: { Two-level circuits. { Multiple-level circuits.

Two-level circuit models Sum of product representation. State encoding for two-level models { PLA implementation. Area: { # of products # I/Os. Delay: { Twice # of products plus # I/Os. Symbolic minimization of state table. Constrained encoding problems. { Exact and heuristic methods. Applicable to large nite-state machines. Note: { # products of a minimum implementation. { # I/Os depends on encoding length. Symbolic minimization State encoding of nite-state machines Extension of two-level logic optimization. Reduce the number of rows of a table, that can have symbolic elds. Reduction exploits: Given a (minimum) state table of a nite-state machine : { nd a consistent encoding of the states that preserves the cover minimality with minimum number of bits. { Combination of input symbols in the same eld. { Covering of output symbols.

Primary Inputs COMBINATIONAL CIRCUIT ISTERS clock Primary Outputs State Minimum symbolic cover: * s 1 s 2 s 4 s 3 0 1 s 2 s 1 1 0 s 4 s 5 s 2 1 1 s 3 s 4 1 INPUT P-STATE N-STATE OUTPUT 0 s 1 s 3 0 1 s 1 s 3 0 0 s 2 s 3 0 1 s 2 s 1 1 0 s 3 s 5 0 1 s 3 s 4 1 0 s 4 s 2 1 1 s 4 s 3 0 0 s 5 s 2 1 1 s 5 s 5 0 Covering constraints: { s 1 and s 2 cover s 3 { s 5 is covered by all other states. Encoding constraint matrices: 2 0 0 1 0 1 0 0 1 0 1 1 1 0 1 0 A = B = 0 0 0 1 1 6 0 0 0 0 1 4 0 0 0 0 1 0 0 0 0 0 3 7 5 Encoding matrix (one row per state): 2 3 1 1 1 1 0 1 E = 0 0 1 6 4 1 0 0 7 5 0 0 0 Multiple-level circuit models Logic network representation. { Logic gate interconnection. Area: { # of literals. Encoded cover of combinational component: * 1** 001 0 1 101 111 1 0 *00 101 1 1 001 100 1 Delay: { Critical path length. Note { # literals and CP in a minimum network.

State encoding for multiple-level models Cube-extraction heuristics [Mustang-Devadas]. Rationale: { When two (or more) states have a transition to the same next-state: Keep the distance of their encoding short. Extract a large common cube. Exploit rst stage of logic. Works ne because most FSM logic is shallow. 5-state FSM (3-bits). { s 1! s 3 with input i. { s 2! s 3 with input i 0. Encoding: { s 1! 000 = a 0 b 0 c 0. { s 2! 001 = a 0 b 0 c. Transition: { ia 0 b 0 c 0 + i 0 a 0 b 0 c = a 0 b 0 (ic + i 0 c 0 ) { 6 literals instead of 8. Algorithm Examine all state pairs: { Complete graph with jv j = jsj. Add weight on edges: { Model desired code proximity. Diculties The number of occurrences of common factors depends on the next-state encoding. The extraction of common cubes interact with each other. Embed graph in the Boolean space.

Algorithm implementation Fanout-oriented algorithm: { Consider present states and outputs. { Maximize the size of the most frequent common cubes. Fanin-oriented algorithm: { Consider next states and inputs. { Maximize the frequency of the largest common cubes. Finite-state machine decomposition Classic problem. { Based on partition theory. { Recently done at symbolic level. Dierent topologies: { Cascade, parallel, general. Recent heuristic algorithms: { Factorization [Devadas]. Summary (a) Finite-state machine optimization is commonly used. { Large body of research. (b) (c) State reduction/encoding correlates well to area minimization. Performance-oriented methods are still being researched. (d)