Verilog Introduction Fall 2004-2005.

Slides:



Advertisements
Similar presentations
Simulation executable (simv)
Advertisements

The Verilog Hardware Description Language
Supplement on Verilog adder examples
Combinational Logic.
Verilog Intro: Part 1.
Hardware Description Language (HDL)
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
1 Brief Introduction to Verilog Weiping Shi. 2 What is Verilog? It is a hardware description language Allows designers to quickly create and debug large.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
Verilog Sequential Circuits Ibrahim Korpeoglu. Verilog can be used to describe storage elements and sequential circuits as well. So far continuous assignment.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
Silicon Programming--Intro. to HDLs1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities.
Reconfigurable Computing (EN2911X, Fall07) Lecture 05: Verilog (1/3) Prof. Sherief Reda Division of Engineering, Brown University
ECEN ECEN475 Introduction to VLSI System Design Verilog HDL.
B. RAMAMURTHY Hardware Description Language 8/2/
Digital System Design EEE344 Lecture 3 Introduction to Verilog HDL Prepared by: Engr. Qazi Zia, Assistant Professor EED, COMSATS Attock1.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
Overview Logistics Last lecture Today HW5 due today
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
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
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
Digital System 數位系統 Verilog HDL Ping-Liang Lai (賴秉樑)  
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Module 1.2 Introduction to Verilog
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Under-Graduate Project Logic Design with Behavioral Models Speaker: Darcy Tsai Adviser:
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.
Brief Verilog.
Introduction to ASIC flow and Verilog HDL
Multiplexers Section Topics Multiplexers – Definition – Examples – Verilog Modeling.
Introduction to Verilog
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
Modern VLSI Design 3e: Chapter 8 Copyright  1998, 2002 Prentice Hall PTR Topics n Verilog register-transfer modeling: –basics using traffic light controller;
Structural Description
Overview Logistics Last lecture Today HW5 due today
Hardware Description Languages: Verilog
Hardware Description Language
Verilog Tutorial Fall
Supplement on Verilog FF circuit examples
Reg and Wire:.
Discussion 2: More to discuss
‘if-else’ & ‘case’ Statements
Behavioral Modeling Structural modeling Behavioral modeling
Supplement on Verilog Sequential circuit examples: FSM
Lecture 2 Supplement Verilog-01
Hardware Description Languages: Verilog
TODAY’S OUTLINE Procedural Assignments Verilog Coding Guidelines
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Introduction to Verilog
Behavioral Modeling in Verilog
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
101-1 Under-Graduate Project Logic Design with Behavioral Models
332:437 Lecture 8 Verilog and Finite State Machines
Supplement on Verilog Sequential circuit examples: FSM
The Verilog Hardware Description Language
Supplement on Verilog adder examples
The Verilog Hardware Description Language
332:437 Lecture 8 Verilog and Finite State Machines
COE 202 Introduction to Verilog
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

Verilog Introduction Fall 2004-2005

Module module <module-type> (<ports>); <components> endmodule

Module module myadder (Cout, Sum, a,b, cin); input [3:0] a,b; input cin; output [3:0] Sum; output cout; <components> endmodule

Structural code Behavioral code Ex1: module mynand (x, a, b); input a, b; output x; wire x,y; and A1 (y,a,b); not A2 (x,y); endmodule Ex2: module mynand (x, a, b); input a, b; output x; wire x,y; assign y = (a==1 & b==1)?1:0; assign x = (y==0)?1:0; endmodule

Components Definitions Declarations Procedural assignments Parameters Nets Registers Tasks and functions Declarations Primitives and Instances Continuous assignments Procedural assignments One pass Cyclic

Parameters Used to define constants e.g: parameter width = 8;

Nets Used to connect components Are driven and can change at any time. Types: wires, wand, wor, supply0, supply1 E.g.: wire x; wire [width-1:0] a, b; //both a and b are buses

Registers Used to hold values. Can change only at discrete time. Types: reg, integer, time, real e.g.: reg r1, r2; reg [width-1:0] r3;

Primitives basic logic gates and, or, not, xor …. Pre-defined User-defined primitives are also possible. The order of the ports is fixed. nand A1 (<output>, <input1>, <input2>, <input3>,….);

Tasks/functions Used to organize code Functions - encapsulate combinational logic. Tasks – can encapsulate sequential logic.

Continuous assignments Data flow between wires and registers. Express combinational logic. Data “propagates” through the wires. Not executed in source order. “net” is always the LHS of a CA e.g. wire x; assign x = (a==b)?1:0;

example wire x, y; //In response to a change in either “a” or “b” assign x = (a==b)?1:0; //x changes first assign z = (y==0)?1:0; //z changes third assign y = (x==1)?1:0; //y changes second

Procedural blocks Represent both combinational and sequential logic. More than one procedural block. All run concurrently. Within a block, can be concurrent or sequential. LHS must always be a register. Two types: One pass: initial Cyclic behavior: always

One Pass A single block of statements. Executed just one time. Begin at time 0. Use of the keyoword: initial e.g.: reg x; initial x = 0;

example initial begin x = 1; y = f(x); #1 x = 0; //After a delay of 1 time unit y = f(x); //Sequential behavior. end

Cyclic behavior Begin at time 0. Executed a number of times. Event driven. Use of keyword: always Can be blocking (sequential execution) or non-blocking (non-sequential execution). e.g.: always #10 clock = ~clock;

Example of combinational logic //nand operation reg x, y; always @ (a or b) begin //x =~y; //If this statement is present, then x will be evaluated first //and the code will not give the expected behavior. if(a & b) //As it is, y will be evaluated first, followed by x. y = 1; else y = 0; x = ~y; end

Example of sequential logic //shift register reg a,b; always @ (posedge clock or posedge reset) begin if(reset) begin a =0; b=0; end else a = b; //Shift the value of b to a b = c; //Shift the value of c to b end end // behavior is different if we switch // the two commented statements.

Blocking assignment Consecutive statements are blocked until the current statement is evaluated (sequential evaluation). Use of “=“. Previous example Preferred usage for combinational logic, where the data must propagate.

Non-blocking assignment Ex. 5: reg a,b; always @ (posedge clock or posedge reset) begin if(reset) begin a =0; b=0; end else a <= b; //Shift the value of b to a b <= c; //Shift the value of c to b end end // behavior is the same even if we // switch the two statements.

Non-blocking assignment All the statements are executed in parallel. Use of “<=“ Preferred usage for sequential logic.

To do Include a Verilog file in a project. Examples 1 to 5, create Verilog files and simulate them.