FSM Optimization. Counter Logic Diagram Q1 Q2 Q3. Counter Implementation using RS FF 10/13/2015

Similar documents
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

ECE380 Digital Logic

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

Ch 7. Finite State Machines. VII - Finite State Machines Contemporary Logic Design 1

Sequential logic and design

Digital Logic and Design (Course Code: EE222) Lecture 19: Sequential Circuits Contd..

14:332:231 DIGITAL LOGIC DESIGN

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Models for representing sequential circuits

Generalized FSM model: Moore and Mealy

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

EEE2135 Digital Logic Design

Digital Design. Sequential Logic

FSM model for sequential circuits

Clocked Sequential Circuits UNIT 13 ANALYSIS OF CLOCKED SEQUENTIAL CIRCUITS. Analysis of Clocked Sequential Circuits. Signal Tracing and Timing Charts

Synchronous Sequential Circuit Design. Dr. Ehab A. H. AL-Hialy Page 1

Last lecture Counter design Finite state machine started vending machine example. Today Continue on the vending machine example Moore/Mealy machines

Synchronous Sequential Logic

Synchronous Sequential Circuit Design. Digital Computer Design

Parity Checker Example. EECS150 - Digital Design Lecture 9 - Finite State Machines 1. Formal Design Process. Formal Design Process

Chapter 6. Synchronous Sequential Circuits

Lecture 10: Synchronous Sequential Circuits Design

The Design Procedure. Output Equation Determination - Derive output equations from the state table

CprE 281: Digital Logic

CS221: Digital Design. Dr. A. Sahu. Indian Institute of Technology Guwahati

Department of Electrical & Electronics EE-333 DIGITAL SYSTEMS

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Lecture 14: State Tables, Diagrams, Latches, and Flip Flop

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

Different encodings generate different circuits


Synchronous Sequential Circuit Design

Analysis of clocked sequential networks

ELCT201: DIGITAL LOGIC DESIGN

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

Chapter 5 Synchronous Sequential Logic

Total time is: 1 setup, 2 AND, 3 XOR, 1 delay = (1*1) + (2*2) + (3*3) + (1*1) = 15ns

CSE 140 Midterm 2 Tajana Simunic Rosing. Spring 2008

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

Vidyalankar S.E. Sem. III [ETRX] Digital Circuits and Design Prelim Question Paper Solution

Finite State Machines CS 64: Computer Organization and Design Logic Lecture #15 Fall 2018

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

Sequential Logic Circuits

Present Next state Output state w = 0 w = 1 z A A B 0 B A C 0 C A C 1

Finite State Machine. By : Ali Mustafa

ALU, Latches and Flip-Flops

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

Digital Electronics Circuits 2017

Finite State Machine (FSM)

PGT104 Digital Electronics. PGT104 Digital Electronics

Chapter 15 SEQUENTIAL CIRCUITS ANALYSIS, STATE- MINIMIZATION, ASSIGNMENT AND CIRCUIT IMPLEMENTATION

(Boolean Algebra, combinational circuits) (Binary Codes and -arithmetics)

CPE/EE 422/522. Chapter 1 - Review of Logic Design Fundamentals. Dr. Rhonda Kay Gaede UAH. 1.1 Combinational Logic

EET 310 Flip-Flops 11/17/2011 1

ENGG 1203 Tutorial _03 Laboratory 3 Build a ball counter. Lab 3. Lab 3 Gate Timing. Lab 3 Steps in designing a State Machine. Timing diagram of a DFF

11.1 As mentioned in Experiment 10, sequential logic circuits are a type of logic circuit where the output of

ECE380 Digital Logic. Synchronous sequential circuits

ECE/Comp Sci 352 Digital Systems Fundamentals. Charles R. Kime Section 2 Fall Logic and Computer Design Fundamentals

6 Synchronous State Machine Design

IE1204 Digital Design. L10: State Machines (Part 2) Masoumeh (Azin) Ebrahimi Elena Dubrova

Digital Logic Design - Chapter 5

Chapter 4. Sequential Logic Circuits

Show that the dual of the exclusive-or is equal to its compliment. 7

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters)

ELCT201: DIGITAL LOGIC DESIGN

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Sample Test Paper - I

Chapter 7. Sequential Circuits Registers, Counters, RAM

Sequential Circuits Sequential circuits combinational circuits state gate delay

10/12/2016. An FSM with No Inputs Moves from State to State. ECE 120: Introduction to Computing. Eventually, the States Form a Loop

ASYNCHRONOUS SEQUENTIAL CIRCUITS

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec 09 Counters Outline.

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

Example: vending machine

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

Lecture 8: Sequential Networks and Finite State Machines

Module 10: Sequential Circuit Design

5 State Minimisation. university of applied sciences hamburg. Digital Systems. Prof. Dr. J. Reichardt Prof. Dr. B. Schwarz

Chapter 3 Digital Logic Structures

Clocked Synchronous State-machine Analysis

Logical design of digital systems

Counters. We ll look at different kinds of counters and discuss how to build them

Time Allowed 3:00 hrs. April, pages

BER KELEY D AV IS IR VINE LOS AN GELES RIVERS IDE SAN D IEGO S AN FRANCISCO

Sequential Logic Optimization. Optimization in Context. Algorithmic Approach to State Minimization. Finite State Machine Optimization

University of Minnesota Department of Electrical and Computer Engineering

14.1. Unit 14. State Machine Design

15.1 Elimination of Redundant States

Review for B33DV2-Digital Design. Digital Design

EECS150 - Digital Design Lecture 15 SIFT2 + FSM. Recap and Outline

Lecture 7: Sequential Networks

ECE 341. Lecture # 3

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec09 Counters Outline.

Chapter 7. Synchronous Sequential Networks. Excitation for

Transcription:

/3/5 CS: Digital Design http://jatinga.iitg.ernet.in/~asahu/cs FSM Optimization A. Sahu Dept of Comp. Sc. & Engg. Indian Institute of Technology Guwahati Outline Last Class: Comb. Cirt. Complexity (CCC) Optimization JK FF gives the best: For next State logic FSM : Type of Machine Moore: depends on State Mealy: depends on State FSM : State minimization ow Implication Method, Implication chart method, FSM Partitioning FSM Encoding: andom, Sequential, Gray, One Hot, Oriented, Heuristics FF Counter Logic Diagram 3 FF Logic Network 3 J= 3 K= J= 3 K= J3= K3= Counter Implementation using D FF D = + 3 3 FF D C D C D C D = + 3 D 3 = + 3 Same as FSM Controller equire more Logic as JK FF Based Counter Implementation using T FF 3 FF T C T C T C T = + 3 T = + 3 T 3 = + 3 Still equire more Logic as JK FF Based Counter Implementation using S FF 3 FF S C S C S C S = 3 = S = 3 = S 3 = 3 3 = 3 equire more Logic as JK FF Based

/3/5 FSM Types Two main types of FSMs 7 Moore FSM : output is only function of state Mealy FSM: output is function of state and inputs Set Theoretic Description Moore Machineis an ordered quintuple M o o r e = S, I, O, δ, λ where ( ) S = Finiteit set of states tt Φ I= Finite set of inputs Φ O = Finite set of outputs Φ, { s,s, L,s n,{ i,i, L,i m,{ o,o, L,o δ = Next state function w hich maps S I S λ= function w hich maps S O l Set Theoretic Description Mealy Machineis an ordered quintuple Mealy = where ( S, I, O, δ, β ) S = Finiteit set of states tt Φ, I = Finite set of inputs Φ, O = Finite set of outputs Φ β = function which maps { s,s, L,sn { i, i, L, im,{ o, o, L, o δ = Next state function which maps l S I S S I O Clocked synchronous FSM Clocked All storage elements employ a clock input (i.e. all storage elements are flipflops) Synchronous All of the flip flops use the same clock signal Clocked synchronous FSM FSM State machine is simply another name for sequential circuits. Finite refers to the fact that the number of states the circuit can assume if finite AsyncFSM: A synchronous clocked FSM changes state only when a triggering edge (or tick) occurs on the clock signal Clocked synchronous FSM structure States: determined by possible values in sequential storage elements Transitions: change of state Clock: controls when state can change by controlling storage elements I nputs Current State or State Combinational Logic Storage Elements s t Next State Clock

/3/5 Moore machine Mealy machine A Much better name of State Memory is State Storage Inputs Next State Logic F Excitation State Memory Current State OutPutLogic F s Inputs Next State Logic F Excitation State Memory Current State OutPutLogic F s Clock Signal s Next state = F (current state, inputs) = G (current state) Out put logic may cause glitches Clock Signal s State Storage= Set of n FFs n State can be stored Out put logic may cause glitches Next state = F (current state, inputs) = F (current state, inputs) 3 Example of Moore & Melay Machine Parity Checker Solution :(Moore) Even [] Odd [] Input is dependent only on current state Moore Machine: is associated with the state and hence appears afterthe state transition take place. 5 Example of Moore & Mealy Machine Parity Checker Transition Arc / Even Odd Solution :(Mealy) / / Input O/Pisdependent on current state and input in Mealy / Mealy Machine: is associated with the state transition, and appears beforethe state transition is completed (by the next clock pulse). D FF x= Parity Checker: Moore M/C Implementation D A y T FF x Moore O/P is synchronized with clock. T A y x= D FF Parity Checker: Mealy M/C Implementation D A y x T FF T Mealy O/P is not synchronized with clock. y 8 3

/3/5 Comparison : Mealy FSM Vs Moore FSM Mealymachines have less states s are on transitions (n ) rather than states (n) Mooremachines are saferto use s changeat at clock edge(always onecycle later) Mealy machines: input change can cause output change as soon as logic is done A big problemwhen two machines are interconnected Asynchronous feedback mayoccur if one isn t careful 9 Comparison : Mealy FSM Vs Moore FSM Mealymachines react fasterto inputs react in same cycle don't need to wait for clock outputs maybe considerably shorter than the clock cycle in Moore machines, more logic maybe necessary to decode state into outputs there maybe more gate delays after clock edge FSM Example : Mealy vsmoore Design a system that outputs a whenever it receives a multiple of 3 # of s (i.e.,, 3, 6, 9, etc. # of s) on a serial input line x. FSM Example: Moore Machine Design a system that outputs a whenever it receives a multiple of 3 # of s (i.e.,, 3, 6, 9, etc. # of s) on a serial input line x. i= [] i= [] i= [] Moore Machine FSM Example: Moore Machine Design a system that outputs a whenever it receives a multiple of 3 # of s (i.e.,, 3, 6, 9, etc. # of s) on a serial input line x. / i= Input / / i= / Mealy Vs Moore : Problem Σo = {t, f ΣI ={, s t at least last input digits are same i= / / Mealy Machine 3 4

/3/5 Solutions to Problem Mealy implementation Needs only 3 states Moore implementation Needs more almost duplicated states justinordertotheoutputvaluetthere. /t FSM: Mealy Machine /f S /f /f /t /f FSM: Moore Machine FSM: Moore Machine s true if at least last input digits are same Is it possible to design Moore FSM of the same problem with 3 state? /f /t /f S/f You can try now.. /t FSM State Minimization Minimizing number of state reduce equirement of bigger size state register Possibly reduce the CCC Some Definitions State Equivalence: S and S are equivalent if for every input sequence applied to machine goes to same NS and If S(t+)=S(t+) and Z=Z then S=S Distinguishable States: Two states S and S are Distinguishableiffthere exist at least one finite input sequence which produce different outputs from S and S 9 3 5

/3/5 Methods ow Matching Method or Partitioning Method Completely specified machine (n edges) Partially specified machine Implication Chart tmthd Method 3 Form an initial partition (P ) that includes all states. Form a nd partition (P ) by separating the states into two blocks based upon their output values. Form a third partition (P 3 ) by separating the states into blocks corresponding to the next state values. Continue partitioning until two successive partitions are the same (i.e. P N = P N ). All states in any one block are equivalent Equivalent states can be combined into a single state. 3 Example of State Minimization: Partitioning A/ B/ C/ State Diagram D/ E/ G/ F/ Present Next state state w = w = z A B C B D F C F E D B G E F C F E D G F G 33 34 Separate states based on output value. P = (ABD)(CEFG) Initial Partition: Present Next state state w = w = z P = (ABCDEFG) The initial partition contains all states in the state diagram / table. 35 A B C B D F C F E D B G E F C F E D G F G 36 6

/3/5 P = (ABD) (CEFG) Separate states based on next state values. ABD CEFG D is not from set CEFG, otherare from CEFG P 3 = (ABD) (CEG) (F) Separate states based on next state values. F is not from ABD CEG set CEG, but CG are from CEG BDB CFG FFEF ECDG P 3 = (ABD) (CEG) (F) unique state 37 BDB CFG FFF ECG P 4 = (AD) (CEG) (F) (B) unique states 38 P 4 = (AD)(CEG) (F)(B) Separate states based on next state values. AD CEG BB CG FFF ECG P 5 = (AD)(CEG)(F)(B) Since P 4 = P 5, state minimization is complete. The equivalent states are: A = D C = E = G P 4 = (AD) (CEG) (F) (B) B F Thus, the FSM can be realized with just 4 states. Same as previous partition (P 4 ) 39 4 FSM: State Minimization Present Next state state w = w = z A B C B A F C F C F C A Minimized State Table 4 FSM: State Minimization B/ A/ C/ F/ Minimized State Diagram 4 7