Exp#7 Finite State Machine Design in Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.

Slides:



Advertisements
Similar presentations
Digital System Design-II (CSEB312)
Advertisements

Counters Discussion D8.3.
Traffic light contoller using FSM
Synchronous Sequential Logic
//HDL Example 5-1 // //Description of D latch (See Fig.5-6) module D_latch (Q,D,control); output Q; input.
Verilog. 2 Behavioral Description initial:  is executed once at the beginning. always:  is repeated until the end of simulation.
FSM Revisit Synchronous sequential circuit can be drawn like below  These are called FSMs  Super-important in digital circuit design FSM is composed.
TOPIC : Finite State Machine(FSM) and Flow Tables UNIT 1 : Modeling Module 1.4 : Modeling Sequential circuits.
How to get a Circuit in verilog converted to hspice, connected to the micron package models, and simulating in hspice and hsimplus.
COE 202: Digital Logic Design Sequential Circuits Part 3
CSE Spring Verilog for Sequential Systems - 1 Today: Verilog and Sequential Logic zFlip-flops yrepresentation of clocks - timing of state.
FSM examples.
Spring 20067W. Rhett Davis with minor modifications by Dean Brock ECE 406 at UNASlide 1 ECE 406 Design of Complex Digital Systems Lecture 10: 9: State.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
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.
Digital System Design by Verilog University of Maryland ENEE408C.
ENEE 408C Lab Capstone Project: Digital System Design Fall 2005 Sequential Circuit Design.
Sequential Logic in Verilog
1 COMP541 State Machines Montek Singh Feb 8, 2012.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Ders 8: FSM Gerçekleme ve.
ECE/CS 352 Digital System Fundamentals© 2001 C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapters 3 and 4: Verilog – Part 2 Charles R.
Register Transfer Level & Design with ASM
Finite State Machine (FSM) Nattha Jindapetch December 2008.
Sequential Circuit: Analysis BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL State Machines Anselmo Lastra.
1 COMP541 Finite State Machines - 1 Montek Singh Sep 22, 2014.
ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapter 4 – Part 4 Tom Kaminski & Charles.
Introduction to Verilog
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Chapter 11: System Design.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patterson and Hennessy Text.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 99-1 Under-Graduate Project Design of Datapath Controllers Speaker: Shao-Wei Feng Adviser:
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 9: State Machines & Reset Behavior Spring.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part4: Verilog – Part 2.
Finite State Machine. Clock Clock cycle Sequential circuit Digital logic systems can be classified as combinational or sequential. – Combinational circuits.
1 COMP541 Sequential Logic – 2: Finite State Machines Montek Singh Feb 29, 2016.
Lecture 5. Verilog HDL #3 Prof. Taeweon Suh Computer Science & Engineering Korea University COSE221, COMP211 Logic Design.
1 Lecture 3: Modeling Sequential Logic in Verilog HDL.
Finite State Machines Mealy machine inputs Outputs next state function
Supplement on Verilog FF circuit examples
Supplement on Verilog for Algorithm State Machine Chart
Figure 8.1. The general form of a sequential circuit.
Lecture L5.1 Mealy and Moore Machines
Last Lecture Talked about combinational logic always statements. e.g.,
© Copyright 2004, Gaetano Borriello and Randy H. Katz
EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10.
Introduction to Advanced Digital Design (14 Marks)
Supplement on Verilog Sequential circuit examples: FSM
COMP541 Sequential Logic – 2: Finite State Machines
ECEN 248 Lab 9: Design of a Traffic Light Controller
Digital Design Lecture 9
Digital Logic Design Digital Design, M. Morris Mano and Michael D
HDL Compiler Unsupport (Do NOT use in your verilog code)
COMP541 State Machines Montek Singh Feb 4, 2010.
Chapter 6 – Part 4 SYEN 3330 Digital Systems SYEN 3330 Digital Systems
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
April 3 Fun with MUXes Implementing arbitrary logical functions
COE 202 Introduction to Verilog
Topics Verilog styles for sequential machines. Flip-flops and latches.
Supplement on Verilog Sequential circuit examples: FSM
Register-Transfer Level Components in Verilog
Sequential logic implementation
Dr. Tassadaq Hussain Introduction to Verilog – Part-3 Expressing Sequential Circuits and FSM.
The Verilog Hardware Description Language
SYEN 3330 Digital Systems Chapter 6 – Part 3 SYEN 3330 Digital Systems.
Dr. Tassadaq Hussain Introduction to Verilog – Part-4 Expressing FSM in Verilog (contd) and FSM State Encoding Dr. Tassadaq Hussain.
Verilog Synthesis & FSMs
Mr. Pradeep J NATIONAL INSTITUTE OF TECHNOLOGY,
COE 202: Digital Logic Design Sequential Circuits Part 3
Lecture 4: Finite State Machines
Presentation transcript:

Exp#7 Finite State Machine Design in Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009

Sequential Circuits Sequential circuits consist of both combinational logic and storage elements. Sequential circuits can be –Mealy-type: outputs are a combinatorial function of both Current State signals and primary inputs. –Moore-type: outputs are a combinatorial function of Current State signals. Combinational Logic FFs ^ Inputs Outputs CLK Current State Next State

Generalized Verilog Mealy Model reg Y, D, Z; // register (current state) (posedge CLK or posedge Reset) begin if (Reset) Y = 0 else Y = D; end; // next state logic (X or Y) begin D = F1(X, Y); End; // output logic (X or Y) begin Z = F2(X, Y); end; X F2 F1 Z Register Y D CLKReset

Generalized Verilog Moore Model reg Y, D, Z; // register (current state) (posedge CLK or posedge Reset) begin if (Reset) Y = 0 else Y = D; end; // next state logic (X or Y) begin D = F1(X, Y); end; // output logic (Y) begin Z = F2(Y); end; X F2 F1 Z Register Y D CLKReset

2-Way Traffic Controller N S EW operation

Design EW (1) S=10 NS (0) S=01 INPUTS Sensors X[1:0] X[0] : car coming on NS X[1] : car coming on EW Clock and Reset. X = 11 X = 10 X = 00 X = 01 X = 00 X = 10 X = 11 X = 01 OUTPUTS Signals S[1:0]: S[0] : NS is green S[1] : EW is green Rese t

Verilog Template module Traffic_Controller (Clock, Reset, X, S); input[1:0] X; input Clock, Reset; output[1:0] S; reg currentState, nextState; reg[1:0] S; // register (Current State) … ) begin end // next state logic … ) begin end // output logic … ) begin end endmodule You need to debounce the clock! Hint: Check Lab4