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.

Slides:



Advertisements
Similar presentations
Counters Discussion D8.3.
Advertisements

CPSC 321 Computer Architecture Andreas Klappenecker
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
CSCI 660 EEGN-CSCI 660 Introduction to VLSI Design Lecture 7 Khurram Kazi.
Supplement on Verilog adder examples
Synchronous Sequential Logic
EE 361 Fall 2003University of Hawaii1 Hardware Design Tips EE 361 University of Hawaii.
Combinational Logic.
Hardware Description Language (HDL)
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part3: Verilog – Part 1.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
//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.
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
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.
Digital System Design by Verilog University of Maryland ENEE408C.
Verilog Sequential Circuits Ibrahim Korpeoglu. Verilog can be used to describe storage elements and sequential circuits as well. So far continuous assignment.
Silicon Programming--Intro. to HDLs1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities.
Advanced Verilog EECS 270 v10/23/06.
Digital System Design Verilog ® HDL Behavioral Modeling (1) Maziar Goudarzi.
D Flip-Flops in Verilog Discussion 10.3 Example 27.
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior : initial blocks execute.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapter 4 – Part 3 Tom Kaminski & Charles.
Overview Logistics Last lecture Today HW5 due today
Spring 2007W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 7: Design Example,
Sequential Logic in Verilog
1 Chapter 5 Synchronous Sequential Logic 5-1 Sequential Circuits Every digital system is likely to have combinational circuits, most systems encountered.
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
ECE 2372 Modern Digital System Design
ECE/CS 352 Digital Systems Fundamentals
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
Chapter 4: Behavioral Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 4-1 Ders – 4: Davranışsal Modelleme.
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.
EEE2243 Digital System Design Chapter 4: Verilog HDL (Sequential) by Muhazam Mustapha, January 2011.
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 7: Design Example, Modeling Flip-Flops Spring.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Verilog Part 3 – Chapter.
3/4/20031 ECE 551: Digital System Design * & Synthesis Lecture Set 3 3.1: Verilog - User-Defined Primitives (UDPs) (In separate file) 3.2: Verilog – Operators,
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
Verilog A Hardware Description Language (HDL ) is a machine readable and human readable language for describing hardware. Verilog and VHDL are HDLs.
M.Mohajjel. Structured Procedures Two basic structured procedure statements always initial All behavioral statements appear only inside these blocks Each.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
M.Mohajjel. Objectives Learn How to write synthesizable Verilog code Common mistakes and how to avoid them What is synthesized for what we code Digital.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
Multiplexers Section Topics Multiplexers – Definition – Examples – Verilog Modeling.
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.
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.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 9: State Machines & Reset Behavior Spring.
1 University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part4: Verilog – Part 2.
1 Lecture 3: Modeling Sequential Logic in Verilog HDL.
Figure Implementation of an FSM in a CPLD..
Supplement on Verilog FF circuit examples
TODAY’S OUTLINE Procedural Assignments Verilog Coding Guidelines
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
Chapter 4: Behavioral Modeling
Dr. Tassadaq Hussain Introduction to Verilog – Part-3 Expressing Sequential Circuits and FSM.
Supplement on Verilog adder examples
The Verilog Hardware Description Language
Introduction to Verilog – Part-2 Procedural Statements
Presentation transcript:

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. Kime

ECE/CS 352 Digital System Fundamentals Chapter 4 Page 2 Overview of Verilog – Part 2 Process (Procedural) Description Verilog Keywords and Constructs Process Verilog for a Positive Edge-triggered D Flip-flop Process Verilog for Figure 4-23 Process Verilog for a Combinational Circuit

ECE/CS 352 Digital System Fundamentals Chapter 4 Page 3 Process (Procedural) Description So far, we have done dataflow and behavioral Verilog using continuous assignment statements ( assign ) Continuous assignments are limited in the complexity of what can be described A process can be viewed as a replacement for a continuous assignment statement that permits much more complex descriptions A process uses procedural assignment statements much like those in a typical programming language

ECE/CS 352 Digital System Fundamentals Chapter 4 Page 4 Verilog Keywords & Constructs - 1 Because of the use of procedural rather than continuous assignment statements, assigned values must be retained over time.  Register type: reg  The reg in contrast to wire stores values between executions of the process  A reg type does not imply hardware storage! Process types initial – executes only once beginning at t = 0. always – executes at t = 0 and repeatedly thereafter. Timing or event control is exercised over an always process using, for example, followed by an event control statement in ( ).

ECE/CS 352 Digital System Fundamentals Chapter 4 Page 5 Verilog Keywords & Constructs - 2 Process begins with begin and ends with end. The body of the process consists of procedural assignments  Blocking assignments Example: C = A + B; Execute sequentially as in a programming language  Non-blocking assignments Example: C <= A + B; Evaluate right-hand sides, but do not make any assignment until all right-hand sides evaluated. Execute concurrently unless delays are specified.  Syntax: gate_operator instance_identifier (output, input_1, input_2, …)  Examples: and A1 (F, A, B); //F = A B or O1 (w, a, b, c) O2 (x, b, c, d, e); //w=a+b+c,x=b+c+d+e

ECE/CS 352 Digital System Fundamentals Chapter 4 Page 6 Verilog Keywords & Constructs - 3 Conditional constructs  The if-else If (condition) begin procedural statements end {else if (condition) begin procedural statements end} else begin procedural statements end  The case case expression {case expression : statements} endcase;  Syntax: gate_operator instance_identifier (output, input_1, input_2, …)  Examples: and A1 (F, A, B); //F = A B or O1 (w, a, b, c) O2 (x, b, c, d, e); //w=a+b+c,x=b+c+d+e

ECE/CS 352 Digital System Fundamentals Chapter 4 Page 7 Examples always begin B = A; C = B; end Suppose initially A = 0, B = 1, and C = 2. After execution, B = 0 and C = 0. always begin B <= A; C <= B; end Suppose initially A = 0, B = 1, and C = 2. After execution, B = 0 and C = 1.

ECE/CS 352 Digital System Fundamentals Chapter 4 Page 8 Verilog for Positive Edge-Triggered D Flip-Flop module dff (CLK, RESET, D, Q) input CLK, RESET, D; output Q; reg Q; (posedge CLK or posedge RESET) begin if (RESET) Q <= 0; else Q <= D; end endmodule

ECE/CS 352 Digital System Fundamentals Chapter 4 Page 9 Describing Sequential Circuits There are many different ways to organize models for sequential circuits. We will use a model that corresponds to the following diagram: A process corresponds to each of the 3 blocks in the diagram. Next State Function Output Function CLK RESET FFs State Register

ECE/CS 352 Digital System Fundamentals Chapter 4 Page 10 Verilog for Figure 4-23 State Diagram module fig423 (CLK, RESET, X, Y) input CLK, RESET, X; output Y; reg[1:0] state, next state; //state register CLK or posedge RESET) begin if (RESET == 1) state <= 2’b00; else state <= next_state; end

ECE/CS 352 Digital System Fundamentals Chapter 4 Page 11 Verilog State Diagram (continued) //next state function or state) begin case (state) 2’b00: if (X == 1) next_state <= 2’b01; else next_state <= 2’b00; 2’b01: if (X == 1) next_state <= 2’b01; else next_state <= 2’b10; 2’b10: if (X == 1) next_state <= 2’b11; else next_state <= 2’b10; 2’b11: if (X == 1) next_state <= 2’b00; else next_state <= 2’b11; default: next_state <= 2’bxx; end

ECE/CS 352 Digital System Fundamentals Chapter 4 Page 12 Verilog State Diagram (continued) //output function or state) begin case (state) 2’b00: if (X == 1) Z <= 1’b1; else Z <= 1’b0; 2’b01: Z <= 0; 2’b10: if (X == 1) Z <= 1’b1; else Z <= 1’b0; 2’b11: Z <= 0; default: Z <= 1’bx; end endmodule