Supplement on Verilog Sequential circuit examples: FSM

Slides:



Advertisements
Similar presentations
VERILOG: Synthesis - Combinational Logic Combination logic function can be expressed as: logic_output(t) = f(logic_inputs(t)) Rules Avoid technology dependent.
Advertisements

Supplement on Verilog adder examples
EE 361 Fall 2003University of Hawaii1 Hardware Design Tips EE 361 University of Hawaii.
Combinational Logic.
Table 7.1 Verilog Operators.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
FSM Revisit Synchronous sequential circuit can be drawn like below  These are called FSMs  Super-important in digital circuit design FSM is composed.
CSE Spring Verilog for Sequential Systems - 1 Today: Verilog and Sequential Logic zFlip-flops yrepresentation of clocks - timing of state.
FSM examples.
FSMs 1 Sequential logic implementation  Sequential circuits  primitive sequential elements  combinational logic  Models for representing sequential.
ENEE 408C Lab Capstone Project: Digital System Design Fall 2005 Sequential Circuit Design.
Advanced Verilog EECS 270 v10/23/06.
Overview Logistics Last lecture Today HW5 due today
Sequential Logic in Verilog
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
ECE 551 Digital System Design & Synthesis Fall 2011 Midterm Exam Overview.
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 551 Digital Design And Synthesis
Slide 1 6. VHDL/Verilog Behavioral Description. Slide 2 Verilog for Synthesis: Behavioral description Instead of instantiating components, describe them.
Register Transfer Level & Design with ASM
Review of Digital Logic Design Concepts OR: What I Need to Know from Digital Logic Design (EEL3705)
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
Finite State Machine (FSM) Nattha Jindapetch December 2008.
Introduction to ASIC flow and Verilog HDL
Verilog hdl – II.
Introduction to Verilog
ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Fall 2000 Chapter 5 – Part 2 Tom Kaminski & Charles.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Chapter 11: System Design.
EMT 351/4 DIGITAL IC DESIGN Verilog Behavioral Modeling  Finite State Machine -Moore & Mealy Machine -State Encoding Techniques.
1 Lecture 3: Modeling Sequential Logic in Verilog HDL.
Figure Implementation of an FSM in a CPLD..
Exp#5 & 6 Introduction to Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.
Exp#7 Finite State Machine Design in Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.
Overview Logistics Last lecture Today HW5 due today
EECE6017C - Lab 0 Introduction to Altera tools and Basic Digital Logic
Verilog Tutorial Fall
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
Lecture 11 Registers and Counters
Reg and Wire:.
© Copyright 2004, Gaetano Borriello and Randy H. Katz
Lecture 12 Analysis of Clocked Sequential Network
Verilog Introduction Fall
Lecture 2 Supplement Verilog-01
Verilog Coding Guideline
EEL 3705 / 3705L Digital Logic Design
Typical Timing Specifications
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
CS Fall 2005 – Lec. #5 – Sequential Logic - 1
COMP541 State Machines Montek Singh Feb 4, 2010.
EEL 3705 / 3705L Digital Logic Design
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
VHDL (VHSIC Hardware Description Language)
Verilog.
EECS Components and Design Techniques for Digital Systems Lec 08 – Using, Modeling and Implementing FSMs David Culler Electrical Engineering.
332:437 Lecture 8 Verilog and Finite State Machines
COE 202 Introduction to Verilog
6. Registers and Counters
Supplement on Verilog Sequential circuit examples: FSM
Figure 8.1. The general form of a sequential circuit.
Dr. Tassadaq Hussain Introduction to Verilog – Part-3 Expressing Sequential Circuits and FSM.
ASM and Micro-programmed State Machines
Supplement on Verilog adder examples
The Verilog Hardware Description Language
Supplement on Verilog combinational circuit examples
Dr. Tassadaq Hussain Introduction to Verilog – Part-4 Expressing FSM in Verilog (contd) and FSM State Encoding Dr. Tassadaq Hussain.
332:437 Lecture 8 Verilog and Finite State Machines
Lecture 7: Verilog Part II
Presentation transcript:

Supplement on Verilog Sequential circuit examples: FSM Based on Fundamentals of Digital Logic with Verilog Design and Fundamental of Logic Design Chung-Ho Chen

A Simple Circuit Using Blocking Assignment module simple (x1, x2, x3, Clock, f, g); input x1, x2, x3, Clock; output reg f, g; always @(posedge Clock) begin f = x1 & x2; g = f | x3; end endmodule A rising edge, latch f = x1&X2, and latch g = (x1&x2) | x3.

Non-Blocking Assignment module simple (x1, x2, x3, Clock, f, g); input x1, x2, x3, Clock; output reg f, g; always @(posedge Clock) begin f <= x1 & x2; g <= f | x3; end endmodule taking previous f // reversing f and g statement makes no difference in result. // Non-blocking assignment, f and g are updated at the same time. Meaning that, g must take a previous f.

Moore Machine FSM y: present state Y: next state When y = 11, Y is don’t care // enter A after reset // at State C, z = 1

Moore Machine FSM y: present state Y: next state //Combinational using blocking assignment

Moore Machine FSM y: present state // non-blocking assignment for sequential ckt.

Mealy Machine FSM Output z depends on input (w) and state y.

Arbiter FSM Arbiter: who arbitrates the requests and issues grants. requests from bus masters Arbiter FSM grant signals to requesters y present S, Y next S Arbiter: who arbitrates the requests and issues grants. In this example, r1: highest priority, then r2, then r3. r1>r2>r3

Mealy-Type Serial Adder: Use State to Keep Carryout Use shift register to keep operand X and Y x y

Serial Adder Block Diagram Shift register with enable control Load initial value Shift w into the left most bit

Shift Registers for X, Y, and Sum module serial_adder (X, Y, Reset, Clock, Sum); input [7:0] X, Y; input Reset, Clock; output wire [7:0] Sum; reg [3:0] Count; reg s, PS, NS; wire [7:0] QX, QY; // for connection to FSM wire Run; parameter S0 = 1’b0, S1 = 1’b1; shiftrne shift_X (X, Reset, 1’b1, 1’b0, Clock, QX); shiftrne shift_Y (Y, Reset, 1’b1, 1’b0, Clock, QY); shiftrne shift_Sum (8’b0, Reset, Run, s, Clock, Sum); Shift 0 into the lsb Shift s into the SUM reg

The Rest s = x xor y xor cin |x //equivalent to 1 | 0 | 1 | 0 // Adder FSM // Output and next state combinational circuit always @(QX, QY, PS) case (PS) S0: begin s = QX[0] ^ QY[0]; // current state C is zero if (QX[0] & QY[0]) NS = S1; else NS = S0; end S1: begin s = QX[0] ~^ QY[0]; // if (~QX[0] & ~QY[0]) NS = S0; else NS = S1; default: NS = S0; endcase // Sequential block always @(posedge Clock) if (Reset) PS <= S0; else PS <= NS;   // Control the shifting process if (Reset) Count = 8; else if (Run) Count = Count - 1; assign Run = |Count; endmodule s = x xor y xor cin |x //equivalent to 1 | 0 | 1 | 0 if x=4’b 1010

Moore Type Serial Adder S00 and S01 for ci-1 = 0 S10 and S11 for ci-1 = 1 xiyi