Digital System Design using VHDL

Slides:



Advertisements
Similar presentations
Introduction to Sequential Circuits
Advertisements

General Sequential Design
Finite State Machines (FSMs)
State-machine structure (Mealy)
Analysis of Clocked Sequential Circuits
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Circuits require memory to store intermediate data
1 © 2014 B. Wilkinson Modification date: Dec Sequential Logic Circuits – I Flip-Flops A sequential circuit is a logic components whose outputs.
Lecture 22: Sequential Circuits Today’s topic –Clocks and sequential circuits –Finite state machines 1.
DISCUSSION CSE 140L 3 rd November 2010 Vikram Murali.
ECE 331 – Digital System Design
Dr. Turki F. Al-Somani VHDL synthesis and simulation – Part 3 Microcomputer Systems Design (Embedded Systems)
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts,
ECE 301 – Digital Electronics Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #17)
ECE 331 – Digital Systems Design Introduction to Sequential Logic Circuits (aka. Finite State Machines) and FSM Analysis (Lecture #19)
Sequential Circuit  It is a type of logic circuit whose output depends not only on the present value of its input signals but on the past history of its.
Lecture 21 Overview Counters Sequential logic design.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
Sequential Logic in Verilog
Digital Computer Design Fundamental
1 COMP541 State Machines Montek Singh Feb 8, 2012.
EE434 ASIC & Digital Systems
Unit 14 Derivation of State Graphs
Sequential Logic Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer Organization and.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Ders 8: FSM Gerçekleme ve.
Introduction to Sequential Logic Design Finite State-Machine Design.
1 © 2014 B. Wilkinson Modification date: Dec Sequential Logic Circuits Previously, we described the basic building blocks of sequential circuits,
Finite State Machines CT101 – Computing Systems. FSM Overview Finite State Machine is a tool to model the desired behavior of a sequential system. The.
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
Lecture 5. Sequential Logic 2 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education & Research.
DLD Lecture 26 Finite State Machine Design Procedure.
Digital Logic Design.
ANALYSIS OF SEQUENTIAL CIRCUITS by Dr. Amin Danial Asham.
VHDL Discussion Finite State Machines
VHDL Discussion Finite State Machines IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology 1.
Registers; State Machines Analysis Section 7-1 Section 5-4.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
Digital System Design using VHDL
Latches and Flip-Flops
© 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.
Finite State Machine. Clock Clock cycle Sequential circuit Digital logic systems can be classified as combinational or sequential. – Combinational circuits.
Interrupt, again! Lin Zhong ELEC424, Fall 2010.
COMBINATIONAL AND SEQUENTIAL CIRCUITS Guided By: Prof. P. B. Swadas Prepared By: BIRLA VISHVAKARMA MAHAVDYALAYA.
Govt. Engineering College- Gandhinagar. It is all about……  STATE MACHINE.
1 Lecture 13: Sequential Circuits, FSM Today’s topics:  Sequential circuits  Finite state machines  Single-cycle CPU Reminder: midterm on Tue 10/20.
Lecture #17: Clocked Synchronous State-Machine Analysis
Digital Design - Sequential Logic Design
Finite State Machines (part 1)
Lecture 4. Sequential Logic #2
ANALYSIS OF SEQUENTIAL CIRCUITS
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
FIGURE 5.1 Block diagram of sequential circuit
Asynchronous Inputs of a Flip-Flop
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Assistant Prof. Fareena Saqib Florida Institute of Technology
FINITE STATE MACHINES (FSMs)
Lecture 13: Sequential Circuits, FSM
CSE 370 – Winter Sequential Logic-2 - 1
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
Finite State Machines (part 1)
Lecture 20 Logistics Last lecture Today HW6 due Wednesday
ECE 352 Digital System Fundamentals
Lecture 17 Logistics Last lecture Today HW5 due on Wednesday
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.
EGR 2131 Unit 12 Synchronous Sequential Circuits
Finite State Machine Continued
Presentation transcript:

Digital System Design using VHDL ECOM 4311 Digital System Design using VHDL Chapter 10 Finite State Machines

F INITE STATE MACHINES (FSM) is a digital system whose outputs are a function of both its present input values and its past history of input values. Information characterizing the effect of a FSM’s past history of input values is provided by its state (present state ). Physically, a FSM’s state is represented by the value stored in a register called the state register.

Logic Diagram

Fully Synchronous FSM

Present State The present state is stored as a binary value in the state register. The number of memory elements in the state register is finite. If the state register has n memory elements, the maximum number of unique states the FSM can have is 2n. This number is also finite, hence the name finite state machine.

Next State The combinational logic also computes the next state value from the FSM’s inputs and present state. This value is provided to the inputs of the state register. At each triggering clock edge, the next state value is clocked into the state register and becomes the new present state value.

Outputs A FSM’s outputs are computed by combinational logic that receives two sets of inputs. One set is the external inputs to the FSM. The other set is the FSM’s present state. FSMs can be classified as either Mealy or Moore. These two kinds of FSMs differ in how their outputs are computed.

Mealy FSMs Mealy FSM’s outputs are a function of both its inputs and its present state. Because of this, the outputs of a Mealy FSM can change as soon as any of its inputs change. However, its state still cannot change until a triggering clock edge.

Moore FSMs A Moore FSM’s outputs are a function of only its present state. since a Moore FSM’s outputs are a function of only its present state, they can change only at a triggering clock edge. In general, any sequential function can be implemented by either a Mealy FSM or a Moore FSM. However, while a Moore FSM is often conceptually simpler, it usually requires more states than a Mealy FSM to implement the same function. A FSM does not have to be exclusively Mealy or Moore. It can be a combination of both, having some outputs (Mealy outputs) and other outputs (Moore outputs).

FSM STATE DIAGRAMS A state diagram provides an abstract graphical representation of the operation of FSM. It allows the conceptualization of the FSM’s operation to be separated from its implementation. Each individual state of the FSM is represented by a state circle, with the state’s name or its encoding located inside. Directed arcs show the possible transitions from one state to another and under what input conditions each transition will occur.

FSM STATE DIAGRAMS A state diagram must have a reset state

FSM STATE DIAGRAMS For a state diagram to be completely specified, for every state the output and next state transition must be shown for all possible input combinations. In some FSMs a transition from one particular state to another may be unconditional. The directed arc for such a transition will not be labeled with an input value.

State Table The same information presented in a state diagram can be presented in a state table

THREE-PROCESS FSM VHDL TEMPLATE Once a FSM’s state diagram has been created, its VHDL code can be written. There are many ways a FSM can be described in VHDL. One straightforward way is to code each block in Figure 10.1.2 as a separate process. The result is a description consisting of three processes: One describes the state register. The other two describe the output combinational logic and the next state combinational logic.

Two- and One- Process FSM Templates The three-process FSM template has the advantage that it is a one-to-one conceptual mapping to the FSM block diagram in Figure 10.1.2. It also has the advantage, from the coding perspective, that it is very readable and easy to modify and maintain. However, it is certainly not the only template that we can use for an FSM.

Two- Process FSM Templates One common variation is to use two processes and a set of conditional signal assignment statements. In this approach, the state register and next state logic are implemented using processes as before. The output logic is implemented by the set of conditional signal assignment statements using one statement for each output. .

One- Process FSM Templates Another FSM template variation uses one process to describe both the state register and next state logic, and uses conditional signal assignment statements for the output logic. Regardless of the approach used, if the same FSM is described, the resulting synthesized logic is the same.

Positive Edge Detector State Diagram

Positive Edge Detector State Diagram The purpose of the positive edge detector is to detect a 0 to 1 transition on input a. There are two conditions that must be met to detect a 0 to 1 transition on a. First, a must be 0 at a triggering clock edge. Second, a must be 1 at the next triggering clock edge.

Positive Edge Detector State Diagram First we need a state for the FSM to be placed in when it is reset by asserting clr_bar. This state was abstractly named state_a. in state_a, if a is 1 at the next triggering clock edge, nothing of interest has occurred and the FSM transitions back to state_a. However, if a is 0 at the next triggering clock edge, we have met the first condition. The FSM must denote this event by transitioning to a new state. We can name this state state_b.

Positive Edge Detector State Diagram In state_b, if a is 0 at the next triggering clock edge, nothing of significance has occurred while in this state, so the transition is back to state_b. However, if a is a 1 at the next triggering clock edge, the FSM has detected a positive edge. This event is denoted by transitioning to a new state, state_c. In state_c, output a_pe is 1.

Positive Edge Detector State Diagram Since the output is to be 1 for only one clock period after a positive edge on a has been detected, we must transition out of state_c at the next triggering clock edge, regardless of the value of a. If a is 0 at the next triggering clock edge, we have met the first condition for a new positive edge on a, so the transition is to state_b. If instead, a is 1 at the next triggering clock edge, we must wait for it to become 0 before we can detect the next positive edge, so the transition is to state_a.

Positive Edge Detector VHDL description From the state diagram, a description of the edge detector can be written. This description, which follows the template in Listing 10.3.1, is given in Listing 10.4.1.

Mealy FSM Edge Detector

COUNTERS AS MOORE FSMS A simple counter is a special case of a Moore FSM where there are no inputs (other than the clock and reset) and the outputs are taken directly from the state register.

2-bit Binary Counter FSM

Counter with state encoding defined by constants

Finally…. ? Any Questions