L10 State Machine Design Topics

Similar documents
15.1 Elimination of Redundant States

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

FSM model for sequential circuits

Final Exam. ECE 25, Spring 2008 Thursday, June 12, Problem Points Score Total 90

or 0101 Machine

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

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

Analysis of Clocked Sequential Circuits

Lecture 10: Synchronous Sequential Circuits Design

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Different encodings generate different circuits

ELCT201: DIGITAL LOGIC DESIGN

Sequential logic and design

Lecture (08) Synchronous Sequential Logic

Design Example: 4-bit Sequence Detector

EECS150 - Digital Design Lecture 23 - FSMs & Counters

State Graphs FSMs. Page 1

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

Finite State Machine (FSM)

ECE380 Digital Logic. Synchronous sequential circuits

Logical design of digital systems

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

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

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

Sequential Circuit Design

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

Example: vending machine

Sequential Logic Circuits

Lecture 14 Finite state machines

CPE100: Digital Logic Design I

Models for representing sequential circuits

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

Synchronous Sequential Circuit Design. Digital Computer Design

Chapter 6. Synchronous Sequential Circuits

Lecture 17: Designing Sequential Systems Using Flip Flops

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

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

Synchronous Sequential Circuit Design

EGR224 F 18 Assignment #4

EET 310 Flip-Flops 11/17/2011 1

Let s now begin to formalize our analysis of sequential machines Powerful methods for designing machines for System control Pattern recognition Etc.

Digital Design. Sequential Logic

Computers also need devices capable of Storing data and information Performing mathematical operations on such data

Chapter 4. Sequential Logic Circuits

Sequential Synchronous Circuit Analysis

CprE 281: Digital Logic

ELCT201: DIGITAL LOGIC DESIGN

EE 209 Logic Cumulative Exam Name:

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

14.1. Unit 14. State Machine Design

6. Finite State Machines

Digital Control of Electric Drives

CSE 140 Midterm 2 Tajana Simunic Rosing. Spring 2008

Ch 9. Sequential Logic Technologies. IX - Sequential Logic Technology Contemporary Logic Design 1

Digital Circuits ECS 371

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

Sequential Circuit Analysis

Lecture 8: Sequential Networks and Finite State Machines

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

CSE 140: Components and Design Techniques for Digital Systems. Lecture 9: Sequential Networks: Implementation

Clocked Synchronous State-machine Analysis

EEE2135 Digital Logic Design

FYSE420 DIGITAL ELECTRONICS

Department of Electrical & Electronics EE-333 DIGITAL SYSTEMS

Boolean cubes EECS150. Mapping truth tables onto cubes. Simplification. The Uniting Theorem. Three variable example

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

Analysis of clocked sequential networks

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

Fundamentals of Digital Design

Department of Electrical and Computer Engineering University of Wisconsin Madison. Fall Final Examination

Synchronous Sequential Logic Part I. BME208 Logic Circuits Yalçın İŞLER

Chapter 6 Introduction to state machines

VLSI Physical Design Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Topic 8: Sequential Circuits

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

Sequential Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

Finite State Machine. By : Ali Mustafa

ALUs and Data Paths. Subtitle: How to design the data path of a processor. 1/8/ L3 Data Path Design Copyright Joanne DeGroat, ECE, OSU 1

EECS 270 Midterm Exam 2 Fall 2009

Menu. Excitation Tables (Bonus Slide) EEL3701 EEL3701. Registers, RALU, Asynch, Synch

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

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

ELE2120 Digital Circuits and Systems. Tutorial Note 9

State Machines ELCTEC-131

CHW 261: Logic Design

Q: Examine the relationship between X and the Next state. How would you describe this circuit? A: An inverter which is synched with a clock signal.

Memory Elements I. CS31 Pascal Van Hentenryck. CS031 Lecture 6 Page 1

Module 10: Sequential Circuit Design

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

Vidyalankar S.E. Sem. III [CMPN] Digital Logic Design and Analysis Prelim Question Paper Solution

Mealy & Moore Machines

ECE 341. Lecture # 3

Latches. October 13, 2003 Latches 1

Adders allow computers to add numbers 2-bit ripple-carry adder

Generalized FSM model: Moore and Mealy

Week-5. Sequential Circuit Design. Acknowledgement: Most of the following slides are adapted from Prof. Kale's slides at UIUC, USA.

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

Logic Design II (17.342) Spring Lecture Outline

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

Chapter 5 Synchronous Sequential Logic

Transcription:

L State Machine Design Topics

States Machine Design Other topics on state machine design Equivalent sequential machines Incompletely specified machines One Hot State Machines Ref: text Unit 15.4, 15.5, 15.8 Copyright 2012 - Joanne DeGroat, ECE, OSU 2

Equivalent State Machines So far have seen that equivalent states in the state table of a sequential machine are equivalent and can be removed. How about the equivalence between two sequential circuits? Two sequential circuits are equivalent if they are capable of doing the same work. Copyright 2012 - Joanne DeGroat, ECE, OSU 3

Formally Definition 15.2 Sequential circuit N 1 is equivalent to sequential circuit N 2 if for each state p in N 1, there is a state q in N 2 such that p q, and conversely, for each state s in N 2 there is a state t in N 1 such that s t. Simply said they have the same states which can be seen if the circuit is small enough. An implication table can be used to prove this. Copyright 2012 - Joanne DeGroat, ECE, OSU 4

An example State tables and state graphs of two sequential machines. Figure 15-6 from the text. Equivalent? Copyright 2012 - Joanne DeGroat, ECE, OSU 5

Proving equivalence Again will use an implication table. Only this time, it is the full square. Along bottom are the states of one machine Along the side are the states of the second. Start by removing output incompatible states. Copyright 2012 - Joanne DeGroat, ECE, OSU 6

The equivalence implication table X squares where the outputs are incompatible Enter implied equivalence pairs for remaining states. Copyright 2012 - Joanne DeGroat, ECE, OSU 7

Step 2 Go back through and remove the implied equivalence pairs that were Xed on the first pass. Continue until no further Xs are entered. If there is one square not Xed in each row and each column, the state machines are equivalent. (When both are minimal) Consider problem 15-17 in text Does this work if the state tables are of different size? Copyright 2012 - Joanne DeGroat, ECE, OSU 8

Problem 15.17 The problem statement Copyright 2012 - Joanne DeGroat, ECE, OSU 9

Problem 15.17 Can be Worked on board Or here in the slides Start with an equivalence implication table A B C D E F S0 S1 S2 S3 Copyright 2012 - Joanne DeGroat, ECE, OSU

Output compatible Go through and X output incompatible states A B C D E F S0 S1 S2 S3 Copyright 2012 - Joanne DeGroat, ECE, OSU 11

Next State Fill in the next state pairs on the table A B C D E F S0 S3 E S1 D S3 E S1 C S3 B S1 D S3 B S1 C S1 S0 E S1 D S0 E S1 C S0 B S1 D S0 B S1 C S2 S3 S0 E S2 - A S0 E S3 - A S0 F S2 B S0 F S3 B Copyright 2012 - Joanne DeGroat, ECE, OSU 12

1 st Pass through table Check implied pairs (S3-E)x (S0-B)x Remainder are compatible. It seems machine has redundant states A B C D E F S0 S3 E S1 D S3 E S1 C S3 B S1 D S3 B S1 C S1 S0 E S1 D S0 E S1 C S0 B S1 D S0 B S1 C S2 S3 S0 E S2 - A S0 E S3 - A S0 F S2 B S0 F S3 B Copyright 2012 - Joanne DeGroat, ECE, OSU 13

Minimize both machines? Start with the Sx machine can it be minimized? If so, what are implications? S1 S2 S3 S0 S1 S2 Copyright 2012 - Joanne DeGroat, ECE, OSU 14

Minimize both machines Implied Next States S1 S1 S3-S0 S1-S1 S2 S2 S3 S3 S0-S0 S2-S3 S0 S1 S2 S0 S1 S2 Copyright 2012 - Joanne DeGroat, ECE, OSU 15

Minimize both machines Can it be reduced? S1 S1 S3-S0 S1-S1 S1 S3-S0 S1-S1 S2 S2 S2 S3 S3 S0-S0 S2-S3 S3 S0-S0 S2-S3 S0 S1 S2 S0 S1 S2 S0 S1 S2 Copyright 2012 - Joanne DeGroat, ECE, OSU 16

Reduced machine Can be seen from state graph States S2 and S3 are equivalent in fact S2 is not reachable unless the machine comes up in that state at startup and it can never reach S2 again. Copyright 2012 - Joanne DeGroat, ECE, OSU 17

Now for the A,B,..,E machine Start with incompatible outputs Copyright 2012 - Joanne DeGroat, ECE, OSU 18

And then implied next state And run though algorithm Copyright 2012 - Joanne DeGroat, ECE, OSU 19

Result is reduced state table Find that D C E F A B So state table reduces to AND for Sx version Copyright 2012 - Joanne DeGroat, ECE, OSU 20

Significance Now consider the equivalence implication table. What is the implication if S2 replaces state S2 and S3? A B C D E F S0 S3 E S1 D S3 E S1 C S3 B S1 D S3 B S1 C S1 S0 E S1 D S0 E S1 C S0 B S1 D S0 B S1 C S2 S3 S0 E S2 - A S0 E S3 - A S0 F S2 B S0 F S3 B Copyright 2012 - Joanne DeGroat, ECE, OSU 21

Incompletely Specified Incompletely Specified State Tables State tables that contain don t cares. Results in reduced logic Determining the best way to fill in the don t cares is another of the n-p complete problems. For this course do the most logical approach. Copyright 2012 - Joanne DeGroat, ECE, OSU 22

One Hot CPLDs and FPGAs have a good number of F/Fs onboard. The F/Fs are there whether they are used or not, so a circuit with the minimum number of F/Fs is not the ultimate objective. For these devices the objective is to reduce the total number of logic cells used and the interconnection between cells. One hot encoding is one approach to have shorter signal paths and reduce logic cells. Copyright 2012 - Joanne DeGroat, ECE, OSU 23

What is one hot? One hot is a method where a flip flop is used for each state in the state machine. A state machine with n states will require n flip flops in its realization. One hot realization is excellent for controllers that step through a set sequence of linear steps. Text gives example of a multiplier controller state graph which is not linear. Copyright 2012 - Joanne DeGroat, ECE, OSU 24

Linear one hot Linear one hot sequential controllers requires no next state logic. On Reset the output of the 4 F/F is 00 On clocks 00, then 00, then 0001, then 0000 reset 0 clk D SET CLR Q D Q SET CLR Q D Q SET CLR Q D A B C D Q SET CLR Q Q reset Copyright 2012 - Joanne DeGroat, ECE, OSU 25

One hot use Have been use in such things as Successive approximation A-D converters Various automotive control systems Automated machinery control systems Also commonly used in processor controllers Process controller states F1,F2,F3,F4,F5,F6,F7,F8 always followed by E0,E1,E2,E3,E4,E5,E6,E7 if direct addressing E20,E21,E22,E23,E24,E25,E26,E27 if indirect Copyright 2012 - Joanne DeGroat, ECE, OSU 26

One hot application One hot could have been used in the sequence detector problems Detect an input sequence ending in 1. Construct a shift register that holds the last 3 inputs of an input X. Copyright 2012 - Joanne DeGroat, ECE, OSU 27

The full circuit Desire Z=1 when X -1 X -2 X -3 is 1. Simply construct the combinational logic with inputs from the F/F outputs. Copyright 2012 - Joanne DeGroat, ECE, OSU 28

Compare the gates Traditional implementation for sequence detector (from text) 2 F/Fs 2 2-input AND gates 1 INV One hot implementation 3 F/Fs 1 3-input AND gate Copyright 2012 - Joanne DeGroat, ECE, OSU 29

Another example Design a sequence detector that detects input sequences ending in 0 or 01. Z = 1 when a sequence is detected. Start with a 4 bit shift register to hold the last 4 inputs. Copyright 2012 - Joanne DeGroat, ECE, OSU 30

Now add Z generation logic Construct the combinational logic for Z Copyright 2012 - Joanne DeGroat, ECE, OSU 31

Implementation comparison Traditional 3 F/Fs Need to work problem more than 1 hot One hot 4 F/Fs 2 AND gates (1-3 inp, 1-4 inp) 1 OR gate (2 inp) Copyright 2012 - Joanne DeGroat, ECE, OSU 32

The state table For the Mealy Machine NEXT STATE OUTPUT Present State X=0 X=1 X=0 X=1 S0 S1 S4 0 0 S1 S1 S2 0 0 S2 S3 S4 1 0 S3 S5 S2 0 0 S4 S3 S4 0 0 S5 S1 S2 0 1 7 Copyright 2012 - Joanne DeGroat, ECE, OSU 33

Comparison This was worked to gates in lect 9. 3 D F/Fs 2 3 input AND gates 3 2 input AND gates 2 2 input OR gates 1 3 input OR gate Versus one hot 4 F/Fs 1 3 input AND gate 1 4 input AND gate 1 2 input OR Comments from class?????? Copyright 2012 - Joanne DeGroat, ECE, OSU 34

Lecture summary Have looked at state machine equivalence. Incompletely specified machine implicaiton. One hot encoding and how it may not be all that bad an alternative. Copyright 2012 - Joanne DeGroat, ECE, OSU 35