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



Similar documents
FINITE STATE MACHINE: PRINCIPLE AND PRACTICE

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

Finite State Machine Design and VHDL Coding Techniques

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

Chapter 5. Sequential Logic

Lecture 7: Clocking of VLSI Systems

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

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

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

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

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

State Machines in VHDL

RAM & ROM Based Digital Design. ECE 152A Winter 2012

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

Sequential Circuit Design

A New Paradigm for Synchronous State Machine Design in Verilog

Engr354: Digital Logic Circuits

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

Flip-Flops, Registers, Counters, and a Simple Processor

Lecture 8: Synchronous Digital Systems

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Latch Timing Parameters. Flip-flop Timing Parameters. Typical Clock System. Clocking Overhead

Sequential Circuits. Combinational Circuits Outputs depend on the current inputs

Cascaded Counters. Page 1 BYU

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell

DM Segment Decoder/Driver/Latch with Constant Current Source Outputs

Memory unit. 2 k words. n bits per word

Memory Elements. Combinational logic cannot remember

Lecture-3 MEMORY: Development of Memory:

No serious hazards are involved in this laboratory experiment, but be careful to connect the components with the proper polarity to avoid damage.

Digital Logic Design Sequential circuits

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters:

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

路 論 Chapter 15 System-Level Physical Design

CHAPTER 5 FINITE STATE MACHINE FOR LOOKUP ENGINE

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

EC313 - VHDL State Machine Example

Manchester Encoder-Decoder for Xilinx CPLDs

Lecture 11: Sequential Circuit Design

Lecture 10: Sequential Circuits

More Verilog. 8-bit Register with Synchronous Reset. Shift Register Example. N-bit Register with Asynchronous Reset.

Combinational Logic Design Process

Chapter 7. Registers & Register Transfers. J.J. Shann. J. J. Shann

CNC FOR EDM MACHINE TOOL HARDWARE STRUCTURE. Ioan Lemeni

Sequential Logic Design Principles.Latches and Flip-Flops

Theory of Logic Circuits. Laboratory manual. Exercise 3

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

Lecture 10 Sequential Circuit Design Zhuo Feng. Z. Feng MTU EE4800 CMOS Digital IC Design & Analysis 2010

CSE2102 Digital Design II - Topics CSE Digital Design II

(Refer Slide Time: 00:01:16 min)

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

Computer Architecture

Design: a mod-8 Counter

Below is a diagram explaining the data packet and the timing related to the mouse clock while receiving a byte from the PS-2 mouse:

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

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

FSM Decomposition and Functional Verification of FSM Networks

Computer Systems Structure Main Memory Organization

Design Verification & Testing Design for Testability and Scan

Registers & Counters

Counters and Decoders

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

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

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

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

Asynchronous Counters. Asynchronous Counters

Digital Controller for Pedestrian Crossing and Traffic Lights

Flip-Flops and Sequential Circuit Design. ECE 152A Winter 2012

Flip-Flops and Sequential Circuit Design

Module 3: Floyd, Digital Fundamental

Topics. Flip-flop-based sequential machines. Signals in flip-flop system. Flip-flop rules. Latch-based machines. Two-sided latch constraint

Wiki Lab Book. This week is practice for wiki usage during the project.

Digital Design with VHDL

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute. 2nd (Spring) term 2012/2013

ECE232: Hardware Organization and Design. Part 3: Verilog Tutorial. Basic Verilog

ENEE 244 (01**). Spring Homework 5. Due back in class on Friday, April 28.

CHAPTER 3 Boolean Algebra and Digital Logic

Timing Methodologies (cont d) Registers. Typical timing specifications. Synchronous System Model. Short Paths. System Clock Frequency

Multiple clock domains

CSE140: Components and Design Techniques for Digital Systems

8-ch RAID0 Design by using SATA Host IP Manual Rev1.0 9-Jun-15

8254 PROGRAMMABLE INTERVAL TIMER

ASYNCHRONOUS COUNTERS

1. Memory technology & Hierarchy

Register File, Finite State Machines & Hardware Control Language

EE552. Advanced Logic Design and Switching Theory. Metastability. Ashirwad Bahukhandi. (Ashirwad Bahukhandi)

Design and Implementation of Vending Machine using Verilog HDL

Informatique Fondamentale IMA S8

User s Manual HOW TO USE DDR SDRAM

Modeling a GPS Receiver Using SystemC

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

DM74LS169A Synchronous 4-Bit Up/Down Binary Counter

Instruction Set Architecture. Datapath & Control. Instruction. LC-3 Overview: Memory and Registers. CIT 595 Spring 2010

Upon completion of unit 1.1, students will be able to

Counters. Present State Next State A B A B

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012

CHAPTER 11: Flip Flops

Computer Architecture

Transcription:

Finite State Machine Chapter 10 1

Outline 1. Overview 2. FSM representation 3. Timing and performance of an FSM 4. Moore machine versus Mealy machine 5. VHDL description of FSMs 6. State assignment 7. Moore output buffering 8. FSM design examples Chapter 10 2

1. Overview on FSM Contain random logic in next-state logic Used mainly used as a controller in a large system Mealy vs Moore output Chapter 10 3

2. Representation of FSM State diagram Chapter 10 4

E.g. a memory controller Chapter 10 5

ASM (algorithmic state machine) chart Flowchart-like diagram Provide the same info as an FSM More descriptive, better for complex description ASM block One state box One ore more optional decision boxes: with T or F exit path One or more conditional output boxes: for Mealy output Chapter 10 6

Chapter 10 7

State diagram and ASM chart conversion E.g. 1. Chapter 10 8

E.g. 2. Chapter 10 9

E.g. 3. Chapter 10 10

E.g. 4. Chapter 10 11

E.g. 6. Chapter 10 12

Difference between a regular flowchart and ASM chart: Transition governed by clock Transition done between ASM blocks Basic rules: For a given input combination, there is one unique exit path from the current ASM block The exit path of an ASM block must always lead to a state box. The state box can be the state box of the current ASM block or a state box of another ASM block. Chapter 10 13

Incorrect ASM charts: Chapter 10 14

Chapter 10 15

3. Performance of FSM Similar to regular sequential circuit Chapter 10 16

Sample timing diagram Chapter 10 17

Chapter 10 18

4. Moore vs Mealy output Moore machine: output is a function of state Mealy machine: output function of state and output From theoretical point of view Both machines have similar computation capability Implication of FSM as a controller? Chapter 10 19

E.g., edge detection circuit A circuit to detect the rising edge of a slow strobe input and generate a short (about 1-clock period) output pulse. Chapter 10 20

Three designs: Chapter 10 21

Chapter 10 22

Comparison Mealy machine uses fewer states Mealy machine responds faster Mealy machine may be transparent to glitches Which one is better? Types of control signal Edge sensitive E.g., enable signal of counter Both can be used but Mealy is faster Level sensitive E.g., write enable signal of SRAM Moore is preferred Chapter 10 23

VHDL Description of FSM Follow the basic block diagram Code the next-state/output logic according to the state diagram/asm chart Use enumerate data type for states Chapter 10 24

E.g. 6. Chapter 10 25

Chapter 10 26

Chapter 10 27

Chapter 10 28

Chapter 10 29

Chapter 10 30

Chapter 10 31

Combine next-state/output logic together Chapter 10 32

Chapter 10 33

Chapter 10 34

6. State assignment State assignment: assign binary representations to symbolic states In a synchronous FSM All assignments work Good assignment reduce the complexity of next-state/output logic Typical assignment Binary, Gray, one-hot, almost one-hot Chapter 10 35

Chapter 10 36

State assignment in VHDL Implicit: use user attributes enum_encoding Explicit: use std_logic_vector for the register Chapter 10 37

Chapter 10 38

Chapter 10 39

Handling the unused state Many binary representations are not used What happens if the FSM enters an unused state? Ignore the condition Safe (Fault-tolerant) FSM: got to an error state or return to the initial state. Easy for the explicit state assignment No portable code for the enumerated data type Chapter 10 40

6. Moore output buffering FSM as control circuit Sometimes fast, glitch-free signal is needed An extra output buffer can be added, but introduce one-clock delay Special schemes can be used for Moore output Clever state assignment Look-ahead output circuit Chapter 10 41

Potential problems of the Moore output logic: Potential hazards introduce glitches Increase the Tco delay (Tco = Tcq + Toutput) Can we get control signals directly from the register? Chapter 10 42

Clever state assignment Assigning state according to output signal patterns Output can be obtained from register directly Extra register bits may be needed Must use explicit state assignment in VHDL code to access individual register bit Difficult to revise and maintain Chapter 10 43

Chapter 10 44

VHDL code Chapter 10 45

Look-ahead output circuit Output buffer introduces one-clock delay The next value of Moore output can be obtained by using state_next signal Buffer the next value cancel out the one-clock delay More systematic and easier to revise and maintain Chapter 10 46

Chapter 10 47

Modification over original VHDL code: Add output buffer Use state_next to replace state_reg in Moore output logic Chapter 10 48

Chapter 10 49

7. FSM design examples Edge detector circuit Arbitrator (read) DRAM strobe signal generation Manchester encoding/decoding (read) FSM base binary counter Chapter 10 50

Edge detecting circuit (Moore) Chapter 10 51

Chapter 10 52

Use clever state assignment Chapter 10 53

Use look-ahead output Chapter 10 54

Edge detecting circuit (Mealy) Chapter 10 55

Chapter 10 56

Edge detecting circuit (direct implementation): edge occurs when previous value is 0 and new value is 1 Same as Mealy design with state assignment: zero => 0, one => 1 Chapter 10 57

Chapter 10 58

DRAM strobe signal generation E.g.,120ns DRAM (Trc=120ns): Tras=85ns, Tcas=20ns, Tpr=35ns Chapter 10 59

3 intervals has to be at least 65ns, 20 ns, and 35 ns A slow design: use a 65ns clock period 195 ns (3*65ns) read cycle The control signal is level-sensitive Chapter 10 60

Chapter 10 61

Should revise the code to obtain glitch-free output Chapter 10 62

A faster design: use a 20ns clock period 140 ns (7*20ns) read cycle mem' idle mem r1 ras_n<=0 c ras_n<=0 cas_n<=0 p1 r2 ras_n<=0 p2 r3 ras_n<=0 r4 ras_n<=0 Chapter 10 63

FSM-based binary counter: Free-running mod-16 counter Chapter 10 64

4-bit binary counter with features: Synchronous clear, load, enable Chapter 10 65

Chapter 10 66