Verilog Language Concepts

Slides:



Advertisements
Similar presentations
Simulation executable (simv)
Advertisements

Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Supplement on Verilog adder examples
INTRO TO VHDL Appendix A: page page VHDL is an IEEE and ANSI standard. VHDL stands for Very High Speed IC hardware description language.
Chapter 11 Verilog HDL Application-Specific Integrated Circuits Michael John Sebastian Smith Addison Wesley, 1997.
Verilog Intro: Part 1.
Hardware Description Language (HDL)
16/04/20151 Hardware Descriptive Languages these notes are taken from Mano’s book It can represent: Truth Table Boolean Expression Diagrams of gates and.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part3: Verilog – Part 1.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value Z:high-impedance.
ENEE 408C Lab Capstone Project: Digital System Design Spring 2006 Class Web Site:
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value Z:high-impedance.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
ENEE 408C Lab Capstone Project: Digital System Design Spring 2006 Class Web Site:
Reconfigurable Computing (EN2911X, Fall07) Lecture 05: Verilog (1/3) Prof. Sherief Reda Division of Engineering, Brown University
University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
1 Verilog Digital System Design Z. Navabi, 2006 Digital Design Flow  Digital Design Flow begins with specification of the design at various levels of.
ECE 2372 Modern Digital System Design
ECE/CS 352 Digital Systems Fundamentals
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 2: Introduction to Verilog Syntax Spring.
Spring 2007W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 2: Introduction.
Workshop Topics - Outline
C Tokens Identifiers Keywords Constants Operators Special symbols.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
Copyright © 2012 Pearson Education, Inc. Chapter 2: Introduction to C++
Module 1.3 Verilog Basics UNIT 1 : Introduction to Verilog Data Types.
BASICS CONCEPTS OF ‘C’.  C Character Set C Character Set  Tokens in C Tokens in C  Constants Constants  Variables Variables  Global Variables Global.
January Verilog Digital System Design Copyright Z. Navabi, 2006 Verilog Digital System Design Z. Navabi, McGraw-Hill, 2005 Chapter 2 Register Transfer.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
Slide 1 2. Verilog Elements. Slide 2 Why (V)HDL? (VHDL, Verilog etc.), Karen Parnell, Nick Mehta, “Programmable Logic Design Quick Start Handbook”, Xilinx.
Chap. 4 Modules and Ports. 2 Modules and Ports Modules Ports Hierarchical Names Summary.
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,
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
1 Verilog Digital System Design Z. Navabi, 2006 Verilog Language Concepts.
ELEE 4303 Digital II Introduction to Verilog. ELEE 4303 Digital II Learning Objectives Get familiar with background of HDLs Basic concepts of Verilog.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
Introduction to Verilog. Data Types A wire specifies a combinational signal. – Think of it as an actual wire. A reg (register) holds a value. – A reg.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Chapter1: Introduction Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 1-1 Chapter 1: Introduction Prof. Ming-Bo.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
1 University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
2.1 The Part of a C++ Program. The Parts of a C++ Program // sample C++ program #include using namespace std; int main() { cout
Structural Description
Hardware Description Languages: Verilog
Discussion 2: More to discuss
Verilog Introduction Fall
Verilog Digital System Design Z. Navabi, McGraw-Hill, 2005
ITEC113 Algorithms and Programming Techniques
Revision Lecture
Verilog-HDL-3 by Dr. Amin Danial Asham.
Hardware Description Languages: Verilog
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Hardware Descriptive Languages these notes are taken from Mano’s book
Behavioral Modeling in Verilog
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value
Chapter 2 Variables.
Introduction to Digital System and Microprocessor Design
Chapter 2: Introduction to C++.
The Verilog Hardware Description Language
Verilog HDL Basic Syntax
COE 202 Introduction to Verilog
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

Verilog Language Concepts Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Module Basics Now we are going to see: How modules are developed How names, numbers and operators are used Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Module Basics Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Code Format Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Code Format Verilog code is free format. Spaces and new lines are served as separators. It is case sensitive. Language keywords use lowercase characters. A comment designator start with // makes the rest of line comment. The symbols /* … */ bracket the section of code which is in between as a comment. Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Logic Value System Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Logic Value System Bit type, or bits of vectors or arrays, of Verilog wires and variables take the 4-value logic value system. Values in this system are 0, 1, Z and X. The values 0 and 1 logic low and high. The Z value represents an undriven, high impedance value. The X value represent a conflict in multiple driving values, an unknown or value of a variable not initialized. Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Logic Value System Logic Values and Examples Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Wires and Variables Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Wires and Variables Wires and Variables: net: represents a wire driven by a hardware structure or output of a gate. reg: represents a variable that can be assigned values in behavior description of a component in a Verilog procedural block. Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Modules Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Modules Module is the main structure of definition of hardware components and testbenchs. Begins with module keyword and end with endmodule. Immediately following the module keyword, port list of the module appears enclosed in parenthesis. Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Modules `timescale 1ns/100ps module FlipFlop (preset, reset, din, clk, qout); input preset, reset, din, clk; output qout; reg qout; always @ (posedge clk) begin if (reset) qout <= #7 0; else if (preset) qout <= #7 1; else qout <= #8 din; end endmodule Ports are only listed in the port list and declared as separate input and output ports inside the body of the Flip-Flop module. Separate Port Declarations Statements Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Module Ports Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Module Ports Inputs and outputs of a model must be declared as: input output inout By default, all declared ports are regarded as nets and the default net type is used for the ports. Ports declared as output may be declared as reg. This way they can be assigned values in procedural blocks. An inout port can be used only as a net. Transfers signal from and to module. Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Names Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Names A stream of characters starting with a letter or an underscore forms a Verilog identifier. The $ character and underscore are allowed in an identifier. Verilog uses keywords that are all formed by streams of lowercase characters. The names of system tasks and functions begin with a $ character. Compiler directive names are preceded by the ` (back single quote) character. Example: `timescale Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Names The following are valid names for identifiers: a_name , name1 , _name , Name, Name$ , name55 , _55name , setup, _$name. The following are Verilog keywords or system tasks. $display, default, $setup, begin Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Numbers Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Numbers Constants in Verilog are integer or real. Specification of integers can include X and Z in addition to the standard 0 and 1 logic values. Integers may be Sized: Begins with the number of equivalent bits Unsized: Without the number of bits specification The general format for a sized integers is: number_of_bits ‘ base_identifier digits example: 6’b101100 The base specifier is a single lower or uppercase character b, d, o or h which respectively stand for binary, decimal, octal and hexadecimal bases. Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Numbers Optionally, the base-identifier can be preceded by the single character s (or S) to indicate a signed quantity. A plus or minus operator can be used on the left of the number specification to change the sign of the number. The underscore character (_) can be used anywhere in a number for grouping its bits or digits for readability purposes. Real constants in Verilog use the standard format as described by IEEE std 754-1985, the IEEE standard for double precision floating-point numbers. Examples: 1.9, 2.6E9, 0.1e-6, 315.96-12. Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Arrays Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Arrays Verilog allows declaration and usage of multidimensional arrays for nets or regs. The following declares a_array as a two-dimensional array of 8-bit words: reg [7:0] a_array [0:1023][0:511]; In an array declaration, the address range of the elements of the array comes after the name of the array. Range specifications are enclosed in square brackets. The size and range specification of the elements of an array come after the net type (e.g., wire) or reg keyword. In the absence of a range specification before the name of the array, an element size of one bit is assumed. Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Arrays Array Structures Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Arrays Array Structures (Continued) Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Arrays Array Structures Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Verilog Operators Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Verilog Operators Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Basic Operators Verilog Digital System Design Z. Navabi, 2006

Verilog Digital System Design Z. Navabi, 2006 Basic Operators Arithmetic Operations in Verilog take bit, vector, integer and real operands. Basic operators of Verilog are +, -, *, / and **. An X or a Z value in a bit of either of the operands of a multiplication causes the entire result of the multiply operation to become X. Unary plus (+) and minus (−) are allowed in Verilog. These operators take precedence over other arithmetic operators. If any of the operands of a relational operator contain an X or a Z, then the result becomes X. Verilog Digital System Design Z. Navabi, 2006