1 Steps towards State assignment Slides of Mark Schulz used.

Slides:



Advertisements
Similar presentations
FSM and Efficient Synthesizable FSM Design using Verilog
Advertisements

Introduction to Sequential Circuits
General Sequential Design
Finite State Machines (FSMs)
State-machine structure (Mealy)
State Machine Design Procedure
CS 140 Lecture 10 Sequential Networks: Implementation Professor CK Cheng CSE Dept. UC San Diego 1.
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
1 State Assignment Using Partition Pairs 2  This method allows for finding high quality solutions but is slow and complicated  Only computer approach.
Sequential Design Part II. Output A(t+1) =D A = AX + BX B(t+1) =D B = AX Y = AX + BX.
CS 151 Digital Systems Design Lecture 25 State Reduction and Assignment.
ECE 331 – Digital System Design Introduction to and Analysis of Sequential Logic Circuits (Lecture #20) The slides included herein were taken from the.
ECE 331 – Digital System Design State Reduction and State Assignment (Lecture #22) The slides included herein were taken from the materials accompanying.
ECE 331 – Digital System Design
Finite State Machine Minimization Advanced Methods based on triangular table and binate covering.
Sequential Circuits and Finite State Machines Prof. Sin-Min Lee
Dr. Turki F. Al-Somani VHDL synthesis and simulation – Part 3 Microcomputer Systems Design (Embedded Systems)
Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Chapter #8: Finite State Machine Design Finite State.
CS 140L Lecture 7 Professor CK Cheng 11/12/02. Transformation between Mealy and Moore Machines Algorithm: 1) For each NS, z = S i, j create a state S.
Contemporary Logic Design FSM Optimization © R.H. Katz Transparency No Chapter #9: Finite State Machine 9.4 Choosing Flip-Flops 9.5 Machine Partitioning.
ECE 301 – Digital Electronics Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #17)
ECE 331 – Digital Systems Design Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #19)
ENGIN112 L25: State Reduction and Assignment October 31, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 25 State Reduction and Assignment.
Unit 12 Registers and Counters Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
IKI c-Synthesis of Sequential Logic Bobby Nazief Semester-I The materials on these slides are adopted from: Prof. Daniel Gajski’s transparency.
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Unit 14 Derivation of State Graphs
Chapter 8 -- Analysis and Synthesis of Synchronous Sequential Circuits.
1 Lecture 22 State encoding  One-hot encoding  Output encoding State partitioning.
1 Lecture #12 EGR 277 – Digital Logic Synchronous Logic Circuits versus Combinational Logic Circuits A) Combinational Logic Circuits Recall that there.
Important Components, Blocks and Methodologies. To remember 1.EXORS 2.Counters and Generalized Counters 3.State Machines (Moore, Mealy, Rabin-Scott) 4.Controllers.
1 © 2014 B. Wilkinson Modification date: Dec Sequential Logic Circuits Previously, we described the basic building blocks of sequential circuits,
Module : FSM Topic : types of FSM. Two types of FSM The instant of transition from the present to the next can be completely controlled by a clock; additionally,
2017/4/24 1.
ANALYSIS OF SEQUENTIAL CIRCUITS by Dr. Amin Danial Asham.
Analysis and Synthesis of Synchronous Sequential Circuits A “synchronizing” pulse/edge signal (clock) controls the operation of the memory portion of the.
Digital System Design using VHDL

ENG241 Digital Design Week #7 Sequential Circuits (Part B)
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Introduction to Sequential Logic Design Finite State-Machine Analysis.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 99-1 Under-Graduate Project Design of Datapath Controllers Speaker: Shao-Wei Feng Adviser:
Common Elements in Sequential Design. Lecture 3 topics  Registers and Register Transfer  Shift Registers  Counters Basic Counter Partial sequence counters.
Dr. ClincyLecture Slide 1 CS Chapter 3 (3A and ) Part 8 of 8 Dr. Clincy Professor of CS.
COMBINATIONAL AND SEQUENTIAL CIRCUITS Guided By: Prof. P. B. Swadas Prepared By: BIRLA VISHVAKARMA MAHAVDYALAYA.
Chapter 3 Boolean Algebra and Digital Logic T103: Computer architecture, logic and information processing.
Week #7 Sequential Circuits (Part B)
Finite state machine optimization
Finite state machine optimization
Chapter #6: Sequential Logic Design
ANALYSIS OF SEQUENTIAL CIRCUITS
Finite State Machine, Memory Systems
Mealy Machine x X1 X2 S S1 S2 S3 x X1 X2 S S1 Y1 Y2 S2 Y3 S3 outputs
COMP541 Sequential Logic – 2: Finite State Machines
FIGURE 5.1 Block diagram of sequential circuit
Digital Design Lecture 9
Asynchronous Inputs of a Flip-Flop
ECE 301 – Digital Electronics
Assistant Prof. Fareena Saqib Florida Institute of Technology
CSE 140 MT 2 Review By Daniel Knapp.
FINITE STATE MACHINES (FSMs)
State Reduction and State Assignment
CSE 140L Discussion Finite State Machines.
CSE 370 – Winter Sequential Logic-2 - 1
Dr. Clincy Professor of CS
D Flip-Flop Schematic Block Symbol Truth Table D Q Clk Q Clk D Q(t+1)
SYEN 3330 Digital Systems Chapter 6 – Part 3 SYEN 3330 Digital Systems.
SEQUENTIAL CIRCUITS __________________________________________________
CSE 370 – Winter Sequential Logic-2 - 1
Presentation transcript:

1 Steps towards State assignment Slides of Mark Schulz used

2 Flip-Flops  FLIP-FLOPs are trivial FSMs  Use state diagrams to remember flip-flops functions 1 0 D D D D D 1 0 T T T T T 1 0 J K J K JK 1 0 S & R S R SR

3 FSM performance  Maximum frequency of operation is computed as : Out1 Q1 Q2 D2 D1 Q1 Q2 in1 Clk Next State 0 1 outout T nextstate T setup TdTd T out

4 FSM Equations Out1 Q1 Q2 D2 D1 Q1 Q2 in1 Clk Next State 0 1 outout in1 1 Structure of a FSM with two F-Fs of D type Sample part of a state diagram What values of D1 and D2 will move the FSM to the state 01 ?  FSM next state and output logic can be easily derived by inspecting the state diagram.

5  To move the FSM to state 01 the next state logic must produce ‘1’ on D2 and ‘0’ on D1. D2 = Q2 + = in1 & 00 # in1 & 11 # in1 & 01 #... D1 = Q1 + = Out1 Q1 Q2 D2 D1 Q1 Q2 in1 Clk Next State 0 1 outout in1 1 coming from state : FSM Equations

6  The output logic can be easily derived as a logical sum of all the states where ‘1’ on the output is produced (Moore). D2 = Q1 + = in1 & 00 # in1 & 11 # in1 & 01 #... D1 = Q1 + =... D2 = Q1 + = in1 & Q1 & Q2 # in1 & Q1 & Q2 # in1 & Q1 & Q2 #... Out1 = Q1 & Q2 #.... Out1 Q1 Q2 D2 D1 Q1 Q2 in1 Clk Next State 0 1 outout in1 1 FSM Equations

7  Next State Logic derivation algorithm for D type F-Fs 1. Choose a FF column in the state assignment table. 2. Find the first ‘1’ in this column and its corresponding state on the state diagram. 3. Write the product terms contributed by this state as the logical sum of the conditions on all incoming branches anded with the states they come from. 4. Find the next ‘1’ in this column and repeat the process until all ‘1’ are used. You have obtained the next state Boolean function for the chosen FF. 5. Choose next FF column and repeat until all FF are covered. The advantage of this method is that we perform encoding on a graph, which allows realization of large machines

8 EXAMPLE  Modulo 5/3 counter with Hold (Mealy machine) Q0 Q1 Q2 S0 S3 S2 S1 S Q0 + = Find the first ‘1’, find the corresponding state S0 S3 S2 S1 S4 H H H H H H H / 1 H H H&m3 H&m3 / 1

9 EXAMPLE Q0 Q1 Q2 S0 S3 S2 S1 S condition on an incoming branch AND the state it is coming from OR Q0 + = H & S3 # S0 S3 S2 S1 S4 H H H H H H H / 1 H H H&m3 H&m3 / 1

10 EXAMPLE Q0 Q1 Q2 S0 S3 S2 S1 S condition on an incoming branch AND the state it is coming from OR Q0 + = H & S3 # H & S4 S0 S3 S2 S1 S4 H H H H H H H / 1 H H H&m3 H&m3 / 1

11 EXAMPLE Q0 Q1 Q2 S0 S3 S2 S1 S Find the first ‘1’, find the corresponding state Q1 + = Q0 + = H & S3 # H & S4 S0 S3 S2 S1 S4 H H H H H H H / 1 H H H&m3 H&m3 / 1

12 EXAMPLE Q0 Q1 Q2 S0 S3 S2 S1 S conditions on incoming branches ANDed with the states they are coming from OR Q1 + = H & S1 # H & S2 # Q0 + = H & S3 # H & S4 S0 S3 S2 S1 S4 H H H H H H H / 1 H H H&m3 H&m3 / 1

13 EXAMPLE Q1 + = H & S1 # H & S2 # H & m3 & S2 # H & S3 Q0 Q1 Q2 S0 S3 S2 S1 S conditions on incoming branches ANDed with the states they are coming from OR Q0 + = H & S3 # H & S4 S0 S3 S2 S1 S4 H H H H H H H / 1 H H H&m3 H&m3 / 1

14 EXAMPLE  The output logic for Mealy is derived as the logical sum of ‘1’ output conditions anded with the states they coming from Q0 Q1 Q2 S0 S3 S2 S1 S Q2 + = H & S0 # H & S1 # H & m3 & S2 # H & S3 Out1 = H & S4 # H & m3 & S2 Q1 + = H & S1 # H & S2 # H & m3 & S2 # H & S3 Q0 + = H & S3 # H & S4 S0 S3 S2 S1 S4 H H H H H H H / 1 H H H&m3 H&m3 / 1

15 EXAMPLE Q0 Q1 Q2 S0 S3 S2 S1 S Q2 + = H & S0 # H & S1 # H & m3 & S2 # H & S3 Out1 = H & S4 # H & m3 & S2 Q1 + = H & S1 # H & S2 # H & m3 & S2 # H & S3 Q0 + = H & S3 # H & S4  Modulo 5/3 counter with Hold (Mealy machine) S0 S3 S2 S1 S4 H H H H H H H / 1 H H H&m3 H&m3 / 1

16 FSM state assignment Q1 + = H & S1 # H & S2 # H & m3 & S2 # H & S3 # H & S3 # H & S4 Q0 Q1 Q2 S0 S3 S2 S1 S Q2 + = H & S0 # H & S1 # H & S1 # H & S2 Out1 = H & S4 # H & m3 & S2 Q0 + = H & S3 # H & S4 # H & S0 # H & S1  Bad state encoding can result in larger next state logic. S0 S3 S2 S1 S4 H H H H H H H / 1 H H H&m3 H&m3 / 1

17 FSM state assignment by heuristics (educated guess)  How does the next state and output logic depend on the codes assigned to the states ?  Can we optimise logic better if we assign state codes in a smart way ?  What is the smart way to assign the state codes ?  Is it worth to try randomly and pick up the best code ?  What are the guidelines to assign good codes ?  When is it important to optimise the state codes ?  NOTICE : operator NOT from now on is in two forms : ' ' and '!'

18 FSM state assignment  Golden Rules of good state encoding (for D FFs). 1. States with most incoming branches should be assigned least '1's in their codes since they potentially contribute most product terms. contributes S0 = 1000 contributes S4 = 0001 Q0 + =... # A & S1 # b & S2 # C & S3 # d & S4 # H & S0 #... S4 S0 H H A b C d A S1 S2 S3 Q3 + =... # A & S3

19 FSM state assignment b &( Q1&Q2&Q3&Q4 # Q1&Q2&Q3&Q4)  Golden Rules of good state encoding (for D FFs). 2. States with common next state on the same input condition should be assigned adjacent codes. S1 = 1100 S2 = 0100 S3 = 1000 Q0 + =... # b & S1 # b & S2 # =... # b & (S1 # S2) #... b S1 S2 S3 b = b & Q2 & Q3 & Q4 adjacent codes contributes

20 FSM state assignment  Golden Rules of good state encoding (for D FFs). 3. Next states of the same state should be assigned adjacent codes according to adjacency of branch conditions. Q0 + = a & b & S0 # a & !b & S0 = a & S0 Q1 + = a & b & S0 # !a & b & S0 = b & S0 Q3 + = a & b & S0 # a & !b & S0 # ! a & b & S0 # ! a & !b & S0 = S0 S0 = 0001 S1 = 1101 S2 = 0101 S3 = 1001 adjacent codes contributes a&ba&b S1 S2 S3 a&ba&b S0 a&ba&b a&ba&b

21 FSM state assignment  Golden Rules of good state encoding (for D FFs). Rules 4. States that form a chain on the same branch condition should be assigned adjacent codes. Q0 + = !H & S0 # H & S1 # !H & S1 # H & S2 = !H & (S0 # S1) # H & (S1 # S2) = !H & !Q1 & Q2 # H & Q0 & Q2 Q1 + = !H & S1 # H & S2 = !H & !Q0 & Q1 & Q2 #H & Q0 & Q1 & Q2 Q2 + = H & S0 # !H & S0 # H & S1 #! H & S1 # H & S2 = (S0 # S1) # H & S2 = !Q1 & Q2 # H & Q0 & Q1 & Q2 S0 = 001 S1 = 101 S2 = 111 adjacent codes contributes S1 S0 H S2 H H H H

22 Design Flow of Finite State Machine design

23 What have we learnt?  Flip-Flops are trivial FSMs.  Next State and Output Logic of FSMs can be easily derived by inspection of the State Diagram.  State assignment can be performed by applying simple heuristics.  State assignment is important since it can lead to substantial savings of next state and output logic.  There are several methods of state assignment.

24 What else have we learnt?  Inputs, states, and/or outputs can be encoded.  Partition-based assignment methods give very good results with special properties but are hard computationally  Partition-based methods are linked to decomposition  Hypercube-embedding methods are fast and can give good results, but require usually computers  Rule-based methods are not very good but allow for hand design  Various encoding/decomposition methods can be combined for better results