FSM model for sequential circuits

Similar documents
Design at the Register Transfer Level

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

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

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

Models for representing sequential circuits

Finite State Machine. By : Ali Mustafa

Finite State Machine (FSM)

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

or 0101 Machine

Sequential Synchronous Circuit Analysis

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

EECS150 - Digital Design Lecture 23 - FSMs & Counters

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

Synchronous Sequential Logic. Chapter 5

Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

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

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

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

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


Lecture (08) Synchronous Sequential Logic

EEE2135 Digital Logic Design

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

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

CSE 140 Midterm 2 Tajana Simunic Rosing. Spring 2008

15.1 Elimination of Redundant States

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

Analysis of clocked sequential networks

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

Chapter 6. Synchronous Sequential Circuits

CPE100: Digital Logic Design I

Logic Design II (17.342) Spring Lecture Outline

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

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

Analysis of Clocked Sequential Circuits

L10 State Machine Design Topics

Synchronous Sequential Logic

Synchronous Sequential Circuit Design

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

Chapter 6 Introduction to state machines

Review for B33DV2-Digital Design. Digital Design

Fundamentals of Digital Design

Lecture 10: Synchronous Sequential Circuits Design

ELCT201: DIGITAL LOGIC DESIGN

Lecture 8: Sequential Networks and Finite State Machines

Chapter 7. Synchronous Sequential Networks. Excitation for

Logical design of digital systems

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

14.1. Unit 14. State Machine Design

6. Finite State Machines

Chapter 7. Sequential Circuits Registers, Counters, RAM

Problem Set 9 Solutions

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

Synchronous Sequential Circuit Design. Digital Computer Design

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

Sequential Circuit Design

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

CprE 281: Digital Logic

CSE140: Digital Logic Design Registers and Counters

Digital Electronics Sequential Logic

Chapter 5 Synchronous Sequential Logic

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

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

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

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

Sequential logic and design

EGR224 F 18 Assignment #4

CSE370 HW6 Solutions (Winter 2010)

ENGG 1203 Tutorial_9 - Review. Boolean Algebra. Simplifying Logic Circuits. Combinational Logic. 1. Combinational & Sequential Logic

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

CE1911 LECTURE FSM DESIGN PRACTICE DAY 1

( c) Give logic symbol, Truth table and circuit diagram for a clocked SR flip-flop. A combinational circuit is defined by the function

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

Clocked Synchronous State-machine Analysis

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

Chapter 4. Sequential Logic Circuits

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

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

Design Example: 4-bit Sequence Detector

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

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

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

Different encodings generate different circuits

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

Example: vending machine

14:332:231 DIGITAL LOGIC DESIGN

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

Asynchronous sequence circuits

FYSE420 DIGITAL ELECTRONICS

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

Menu. EEL3701 Classical Design

Sequential Logic Circuits

Design of Datapath Controllers

COE 328 Final Exam 2008

Register Transfer Level

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

ELE2120 Digital Circuits and Systems. Tutorial Note 9

Transcription:

1 FSM model for sequential circuits The mathematical model of a sequential circuit is called finite-state machine. FSM is fully characterized by: S Finite set of states ( state ~ contents of FFs) I Finite set of inputs O Finite set of outputs Mapping of S x I into S (Next state function) Mapping of S x I into O (Output function) Inputs I(ti) Combinational logic (functions Z, N) Outputs O(ti) Present State S(ti) Memory Next State S(ti+1) Clk FSM model for clocked networks (Mealy-type) FSMs can be represented in many equivalent forms: - Transition (state) table, state diagram, circuit diagram etc.

2 DESIGN WITH ASM CHARTS ASM = Algorithmic State Machine ~ Flowchart representation of state graph for sequential system Advantages of ASM representation (vs. state graph): - Easier to understand the operation of a system (by inspecting its ASM chart) - Better suitable for describing systems with many inputs and outputs - Provisions for describing both Mealy and Moore-type systems - Easier to implement next-state equations (can read them off directly from ASM chart) Limitation: difficult to perform state reduction.

3 ASM NOTATION AND RULES An ASM chart follows specific conventions and rules. When these rules are followed, the ASM chart is equivalent to a state graph (or transition diagram). Three Components used in ASM: ASM Notation uses 3 types of boxes : (a) The state is represented by a state box, which may contain an output list ( Moore outputs) (b) Decision box implements conditional branches (based on the values of input variables) (c) Conditional output box (for Mealy outputs)

4 ASM BLOCKS An SM chart consists of SM blocks Each block describes FSM operation in a given state. ASM Block ~ state An SM block has one entrance and one or more exit paths Example 1 A path from entrance to exit is called a link path In state S 1 : Outputs Z 1 = Z 2 = 1 If X 1 = X 2 = 0 then Z 3 = Z 4 = 1 and the machine goes to next state via path 1

5 Example 2 Equivalent SM blocks Note: The order in which the inputs are tested may affect the complexity of ASM chart Example 3 Equivalent SM charts for a combinational network Z 1 = 1 if A+BC =1 else Z 1 = 0

6 Rules for constructing valid SM blocks For every valid combination of input variables there must be exactly one exit path (because an exit path must lead to a single next state). There should be no internal feedback within an SM block

7 Note: Within a single SM block, several parallel paths can be active at the same time (unlike in a flowchart for a program in a serial computer) 3 link paths (marked) are active when X1 = X2 = 1 and X3 = 0 Equivalent Serial Form: Only one active link path between entrance and exit Note: All of the tests for input variables (within a block) take place within one clock time.

CONVERTING STATE GRAPH INTO ASM Given the state graph of a sequential machine with a single input (X) and five outputs, with both Moore outputs (Za, Zb, Zc) and Mealy outputs (Z1, Z2) 8 Its equivalent ASM chart is Note: Moore outputs are placed in the state boxes Mealy outputs appear in conditional output boxes

9 A timing chart for X = 111000 Note: - The Moore outputs Za, Zb, Zc change immediately following the state change - The Mealy outputs (Z1, Z2) can change after the state change or an input change - All outputs have their correct values at the time of the active clock edge

10 Examples of ASM for sequence detector Show an ASM chart for the sequence detector: X Z Clk Z = 1 iff an input sequence ends in 101 (a) Mealy state graph: 0/0 S2 S0 0/0 1/0 1/1 0/0 S0 = Starting state Also two or more 0 s received S1 = Sequence ending in 1 has been received S2 = Sequence ending in 10 has been received S1 1/0

11 ASM chart: S0 0 X 1 S1 0 X 1 S2 0 1 X Z Note: Output Z is a conditional output

12 (b) Moore state graph for the same sequence detector 0 1 S0/0 S1/0 1 1 0 0 S3/1 1 S2/0 0 Present State S0 = Starting state Next State X=0 X=1 S0 S0 S1 0 S1 S2 S1 0 S2 S0 S3 0 S1 = Sequence ending in 1 S2 = Sequence ending in 10 S3 = Sequence ending in 101 Present Output(Z) S3 S2 S1 1

13 ASM Chart: S0 0 X 1 S1 X 1 0 S2 0 X 1 S3 Z X 0 Note: Output Z is associated with states 1

DERIVATION OF ASM CHARTS 14 The process is similar to deriving a state diagram from the word description: - understand the problem - define required inputs/outputs - define states - construct ASM chart - test it using example input sequences Possible ambiguity in - interpreting word specs - selecting Moore vs. Mealy implementation

Simple Example: Single state (Z) machine. Construct an SM block that has 3 input variables (A,B,C), 4 outputs (W,X,Y,Z), and 2 exit paths. For this block, output Z is always 1(~Moore), and W is 1 iff A and B are both 1(~Mealy). If C = 1 and A = 0, Y = 1 and exit path 1 is taken. If C = 0 or A = 1, X=1(~Mealy) and exit path 2 is taken 15 Z 1 0 A X 0 C 1 X Y 1 0 B W EXIT 2 EXIT 1

16 Example: ASM Chart for the multiplier control Recall the problem: Multiplier control Final state graph for add-shift control

17 SM chart for Add-Shift control In S0: When St=1 the registers are loaded. In S1: test M to determine whether to add or just shift. In S2: The Shift signal is generated (since the Add is always followed by Shift). In S3: The Done signal is turned on. SM Chart for Binary Multiplier NOTE: - M input is tested first (before K) - Sh implemented as Mealy for M=0 and as Moore for M=1

18 Example ASM chart for Multiplier control (multiplication of two 4-bit numbers). State Diagram:

An equivalent SM chart 19

20 Implementation of ASM charts Similar to realization of sequential networks using transition diagrams: Transition diagram / ASM chart State assignment Output and next-state equations FF input logic / PAL equations / etc. Circuit implementation But the output and next-state equations can be derived directly from ASM charts

21 For the example of ASM chart introduced earlier: Equivalent SM chart Moore outputs: Za = A B Zb = A B Zc = AB

22 Conditional outputs: Z1 = ABX Z2 = ABX Rules for deriving the next-state equation for a flip-flop Q from the ASM chart: 1. Identify all of the states in which Q = 1. 2. For each of these states, find all of the link paths that lead into the state. 3. For each of these link paths, find a term that is 1 when the link path is followed. That is, for a link path from S i to S j, the term will be 1 if the machine is in state S i and the conditions for exiting to S j are satisfied. 4. The expression for Q + (the next state of Q) is formed by ORing together the terms found in step 3. For our example: Two links lead to a state with A = 1 A + = A BX + ABX Two states where B = 1, and 3 links lead to these states B + = A B X + A BX + ABX Link 1 Link 2 Link 3

23 Example Continued: Implement the ASM chart using a PLA and two D flip-flops Derive the next state equations and output equations: A + = A BX + ABX B + = A B X + A BX + ABX Z a = A B Z 1 = ABX Z b = A B Z 2 = ABX Z c = AB Simplify these equations using the unused state (AB = 10) as a don t care condition: X AB 0 1 00 01 1 11 1 10 X X X AB 0 1 00 1 01 1 11 1 10 X X A + = BX B + = B X + BX Final equations in SOP form suitable for PLA A + = BX Z a = A B Z 1 = ABX B + = B X + BX Z b = A B Z 2 = ABX Z c = AB

24 PLA program table: X A B A + B + Za Zb Zc Z1 Z2 1-1 1 1 0 0 0 0 0 1-0 0 1 0 0 0 0 0-0 0 0 0 1 0 0 0 0-0 1 0 0 0 1 0 0 0-1 1 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 1

25 Example: Realize the following SM chart using a PLA and D flipflops that trigger on the falling edge of the clock pulse. Draw a block diagram and give the PLA table. (Do not simplify the equations.) Next State equations and output equations: A + = A B X 1 X 3 + A BX 1 B + = A B X 1 X 2 + A B X 1 X 3 + A BX 1 + AB X 2 Z 1 = A B ~ Moore Z 2 = A B X 1 + AB Z 3 = A B X 1 + A BX 1 ~ Mealy

26 X1 Z1 X2 Z2 Z3 X3 A B PLA A + B + FF FF A B X1 X2 X3 A + B + Z1 Z2 Z3 0 0 1-1 1 0 0 0 0 0 1 1 - - 1 0 0 0 0 0 0 0 1-0 1 0 0 0 0 0 1-0 0 1 0 0 0 0 1 0 - - 0 1 0 0 1 1 0-0 - 0 1 0 0 0 0 0 - - - 0 0 1 0 0 0 0 0 - - 0 0 0 1 0 1 0 - - - 0 0 0 1 0 0 0 1 - - 0 0 0 0 1