Dr. H.v.d.Biggelaar / Mar3-Ver2 / 1 Engineering Technology Dr. H.v.d.Biggelaar March 22, 2000 State Machines in VHDL.

Slides:



Advertisements
Similar presentations
VHDL 5 FINITE STATE MACHINES (FSM) Some pictures are obtained from FPGA Express VHDL Reference Manual, it is accessible from the machines in the lab at.
Advertisements

Chapter #8: Finite State Machine Design 8
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
Circuits require memory to store intermediate data
Finite State Machine Chapter 10 RTL Hardware Design by P. Chu.
CS 151 Digital Systems Design Lecture 25 State Reduction and Assignment.
6/12/20151 Sequence Detectors Lecture Notes – Lab 4 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
The Control Unit: Sequencing the Processor Control Unit: –provides control signals that activate the various microoperations in the datapath the select.
ECE C03 Lecture 101 Lecture 10 Finite State Machine Design Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Embedded Systems Hardware:
Dr. Turki F. Al-Somani VHDL synthesis and simulation – Part 3 Microcomputer Systems Design (Embedded Systems)
Give qualifications of instructors: DAP
Contemporary Logic Design Finite State Machine Design © R.H. Katz Transparency No Chapter #8: Finite State Machine Design Finite State.
Spring 2002EECS150 - Lec15-seq2 Page 1 EECS150 - Digital Design Lecture 15 - Sequential Circuits II (Finite State Machines revisited) March 14, 2002 John.
ENEE 408C Lab Capstone Project: Digital System Design Fall 2005 Sequential Circuit Design.
Embedded Systems Hardware: Storage Elements; Finite State Machines; Sequential Logic.
ELEN 468 Advanced Logic Design
Algorithmic State Machine (ASM) Charts
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts,
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.
Lecture 17 General finite state machine (FSM) design
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Finite State Machines. Binary encoded state machines –The number of flip-flops is the smallest number m such that 2 m  n, where n is the number of states.
Sequential Logic Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer Organization and.
Chapter 10 State Machine Design. 2 State Machine Definitions State Machine: A synchronous sequential circuit consisting of a sequential logic section.
George Mason University ECE 545 – Introduction to VHDL ECE 545 Lecture 5 Finite State Machines.
CprE / ComS 583 Reconfigurable Computing
Digital Design Lectures 11 & 12 Shift Registers and Counters.
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,
Introduction to State Machine
Review of Digital Logic Design Concepts OR: What I Need to Know from Digital Logic Design (EEL3705)
George Mason University Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code ECE 448 Lecture 6.
DLD Lecture 26 Finite State Machine Design Procedure.
Digital Logic Design.
ANALYSIS OF SEQUENTIAL CIRCUITS by Dr. Amin Danial Asham.
Lecture 7 Chap 9: Registers Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Finite State Machine (FSM) Nattha Jindapetch December 2008.
Datapath - performs data transfer and processing operations The control unit sends: – Control signals – Control outputs The control unit receives: – External.
1 COMP541 State Machines – 2 Registers and Counters Montek Singh Feb 11, 2010.
Controllers ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering Dr. Filip Cuckov.
Digital System Design using VHDL
Digital System Design using VHDL
CEC 220 Digital Circuit Design Mealy and Moore State Machines Friday, March 27 CEC 220 Digital Circuit Design Slide 1 of 16.
ENG241 Digital Design Week #7 Sequential Circuits (Part B)
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
ECE DIGITAL LOGIC LECTURE 21: FINITE STATE MACHINE Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/24/2015.
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 99-1 Under-Graduate Project Design of Datapath Controllers Speaker: Shao-Wei Feng Adviser:
EMT 351/4 DIGITAL IC DESIGN Verilog Behavioral Modeling  Finite State Machine -Moore & Mealy Machine -State Encoding Techniques.
Pusat Pengajian Kejuruteraan Mikroelektronik EMT 351/4 DIGITAL IC DESIGN Verilog Behavioural Modeling (Part 4) Week #
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
Figure 8.1. The general form of a sequential circuit.
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code.
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Hao Zheng Comp Sci & Eng USF
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
EEL 3705 / 3705L Digital Logic Design
ECE 545 Lecture 12 Design of Controllers Finite State Machines and Algorithmic State Machine (ASM) Charts.
CSE 370 – Winter Sequential Logic-2 - 1
Dr. Tassadaq Hussain Introduction to Verilog – Part-3 Expressing Sequential Circuits and FSM.
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code.
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL code ECE 448 – FPGA and ASIC Design.
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Lecture 22 Logistics Last lecture Today HW7 is due on Friday
CSE 370 – Winter Sequential Logic-2 - 1
Presentation transcript:

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 1 Engineering Technology Dr. H.v.d.Biggelaar March 22, 2000 State Machines in VHDL

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 2 State Machines Moore Mealy

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 3 similarities between the clocking of a bank of flip-flops and the flip-flops in a state machine

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 4 An example of an FSM used as a controller for two counters

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 5 case ps is when s0 => if x='1' then ns<=s0; else ns<=s1; end if; when s1 => if x='0 then ns<=s1; else ns<=s2; end if; when s2 => ns<=s0; when others => ns<=s0; end case;

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 6

7 Data Types Enumerated (user-defined): This is a list of values generated by the designer. Their synthesis is application-specific. The values of the elements in the list start at ‘0’ at the left “(“ and increment by one from there. Particularly useful in state machines. Example: type states is (idle, detect, send, receive); signal prsnt, next: states; Note: “Boolean” and “bit” are also enumerated types, defined by the IEEE standard. type Boolean is (false, true); type bit is (‘0’, ‘1’);

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 8 State machines Moore Machines A finite state machine in which the outputs change only due to a change of state Mealy Machines A finite state machine in which the outputs can change asynchronously i.e., an input can cause an output to change immediately

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 9 Moore state machine implementations (1) Outputs decoded from state bits Combinatorial decode Outputs are decoded combinatorially from the current state outputs comb = f(present state) Inputs Logic State Registers Output Logic Outputs

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 10 Moore state machine implementations (2) Outputs decoded from state bits Registered decode Outputs are registered; decode of outputs is in parallel with decode of next state outputs reg = f(previous state, inputs) Outputs State Registers Output Logic Output Registers Inputs Next State Logic Current State

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 11 StateOutput 1Output 2State Encoding s10000 s21001 s30110 Moore State Machine Implementations (3) Outputs encoded within state bits Example: Note: Both bits of the state encoding are used as outputs State Registers Outputs Inputs Logic

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 12 Complete code for a Moore machine with outputs q1 and q0 that reflect the value of the state variable.

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 13 Complete code for the same Moore machine as in the previous example, but with a single process.

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 14 One-Hot Encoding One state per flip-flop: in FPGA-type architectures reduces the next state logic requires fewer levels of logic cells enables high-speed state machines (> 100MHz). in CPLD-type architectures reduces the number of product terms can eliminate ‘expander’ product terms (i.e. reduce delays, and increase operating speed). but, uses more macrocells and there may not be enough Flip-Flops

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 15 Again the same Moore machine but this time with “one-hot” encoding Note that the values of the constants are chosen by the designer and thus are not limited to a “one-hot” sequence. For instance to minimize power, one may prefer a Gray code.

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 16 Mealy Machines Outputs may change with a change of state OR with a change of inputs. Mealy outputs are non-registered because they are functions of the present inputs Inputs State Registers Logic Outputs

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 17 ASM chart of a Mealy machine The only output “z” is ‘1’ when the machine is in state “s1” AND the input “x” is ‘1’.

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 18 Complete code for a Mealy machine with only a conditional output.

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 19 This simulation is not very useful. It does not show how “z” depends on the input “x” and the state.

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 20 The same Mealy machine but with output “q” added to show the value of the state variable.

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 21 This simulation is better. It’s clear now that “z” is a ‘1’ only when “x” is a ‘1’ AND the FSM is in state s1. However, the transitions of “x” take place only on the active edge of the clock, so you cannot tell if the response to the change in “x” is synchronous or asynchronous.

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 22 By just moving the transition of “x’ from coinciding with a leading edge of the clock to a level portion, it becomes obvious that when “x” goes from ‘1’ to ‘0’, the output “z” changes immediately, so that action is asynchronous.

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 23 Do you really want to do this?

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 24 reg ROM inputs outputs cen clock ROM-Centered Design top entity

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 25 pwait req ack ret reset clock q0_iq1_i d0_i d1_i ROM16x4 reg2 fsmrom a(0) a(1) a(2) a(3) d(0) d(1) d(2) d(3) clk rst q1 q0 d1 d0 ROM-Centered Design

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 26 Example: for addr = 0, the data is “0110” (B-A-ret-ack) or 6 (hex)

Dr. H.v.d.Biggelaar / Mar3-Ver2 / 27 And that’s IT for State Machines And that’s IT for State Machines