Sharif University of Technology Department of Computer Engineering Verilog ® HDL Basic Concepts Alireza Ejlali.

Slides:



Advertisements
Similar presentations
Verilog HDL -Introduction
Advertisements

1/8/ VerilogCopyright Joanne DeGroat, ECE, OSU1 Verilog Overview An overview of the Verilog HDL.
Simulation executable (simv)
The Verilog Hardware Description Language
1 Introduction to VHDL (Continued) EE19D. 2 Basic elements of a VHDL Model Package Declaration ENTITY (interface description) ARCHITECTURE (functionality)
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Chap. 6 Dataflow Modeling
Chapter 11 Verilog HDL Application-Specific Integrated Circuits Michael John Sebastian Smith Addison Wesley, 1997.
Verilog Intro: Part 1.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part3: Verilog – Part 1.
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value Z:high-impedance.
CSE 341 Verilog HDL An Introduction. Hardware Specification Languages Verilog  Similar syntax to C  Commonly used in  Industry (USA & Japan) VHDL 
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
CS 3850 Lecture 4 Data Type. Physical Data Types The primary data types are for modeling registers (reg) and wires (wire). The reg variables store the.
Verilog and VeriWell Bo Cheng.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
ENEE 408C Lab Capstone Project: Digital System Design Spring 2005 Class Web Site: e408c.
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
Digital System Design Verilog ® HDL Tasks and Functions Maziar Goudarzi.
B. RAMAMURTHY Hardware Description Language 8/2/
Tasks and Functions Programmable Logic Design (40-493) Fall 2001 Computer Engineering Department Sharif University of Technology Maziar Gudarzi.
Chap. 3 Basic Concepts. 2 Basic Concepts Lexical Conventions Data Types System Tasks and Compiler Directives Summary.
Digital System Design Verilog ® HDL Basic Concepts Maziar Goudarzi.
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
Programmable Logic Architecture Verilog HDL FPGA Design Jason Tseng Week 2-3.
Lecture Note on Verilog, Course # , EE, NTU, C.H Tsai Basic Logic Design with Verilog TA: Chen-han Tsai.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
ECE 2372 Modern Digital System Design
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
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Verilog HDL: A solution for Everybody By, Anil Kumar Ram Rakhyani
Verilog Language Concepts
1 An Update on Verilog Ξ – Computer Architecture Lab 28/06/2005 Kypros Constantinides.
Digital System Design Introduction to Verilog ® HDL Maziar Goudarzi.
Module 1.3 Verilog Basics UNIT 1 : Introduction to Verilog Data Types.
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
1 Verilog Digital System Design Z. Navabi, 2006 Verilog Language Concepts.
The Verilog Hardware Description Language. GUIDELINES How to write HDL code: How to write HDL code:
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.
Introduction to Verilog
© 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.
Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-1 Chapter 3: Dataflow Modeling.
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.
Sharif University of Technology Department of Computer Engineering Digital System Design Verilog ® HDL Basic Concepts Digital System Design Verilog ® HDL.
Introduction to FPGAs Getting Started with Xilinx.
Structural Description
Hardware Description Languages: Verilog
Reg and Wire:.
Discussion 2: More to discuss
Hardware Description Languages: Verilog
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Chapter 3: Dataflow Modeling
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value
Introduction to Verilog® HDL
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value
Introduction to Digital System and Microprocessor Design
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value
Supplement on Verilog adder examples
The Verilog Hardware Description Language
Introduction to Verilog® HDL
COE 202 Introduction to Verilog
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

Sharif University of Technology Department of Computer Engineering Verilog ® HDL Basic Concepts Alireza Ejlali

Net Data Types (wire) Nets represent physical connections between structural entities. Nets represent physical connections between structural entities. A net value shall be determined by the values of its drivers. A net value shall be determined by the values of its drivers. A net may have 0,1,2 or more drivers. A net may have 0,1,2 or more drivers. If no driver is connected to a net, its value shall be high-impedance (z). If no driver is connected to a net, its value shall be high-impedance (z).

Example1: a net with two drivers module example; reg i1,i2,i3,i4; reg i1,i2,i3,i4; wire o; wire o; and g1(o,i1,i2); and g1(o,i1,i2); or g2(o,i3,i4); or g2(o,i3,i4); initial initial begin begin i1=0; i2=0; i3=0; i4=0; i1=0; i2=0; i3=0; i4=0; #4 i1=1; i3=1; #4 i1=1; i3=1; #4 i2=1; i4=1; #4 i2=1; i4=1; #4 i1=0; i3=1; #4 i1=0; i3=1; #4 i2=0; i4=1; #4 i2=0; i4=1; end endendmodule

Register Data Types (reg) Registers are data storage elements (like variables in programming languages). Registers are data storage elements (like variables in programming languages). A register shall store a value from one assignment to the next. A register shall store a value from one assignment to the next. The default initialization value for a reg data type shall be the unknown value, x. The default initialization value for a reg data type shall be the unknown value, x.

Example2: Illegal reference to nets module example; reg i1,i2,i3,i4; reg i1,i2,i3,i4; wire o; wire o; and g1(o,i1,i2); and g1(o,i1,i2); or g2(o,i3,i4); or g2(o,i3,i4); initial initial begin begin i1=0; i2=0; o=0; //Illegal reference to net: o i1=0; i2=0; o=0; //Illegal reference to net: o i3=0; i4=0; i3=0; i4=0; #4 i1=1; i3=1; #4 i1=1; i3=1; #4 i2=1; i4=1; #4 i2=1; i4=1; #4 i1=0; i3=1; #4 i1=0; i3=1; #4 i2=0; i4=1; #4 i2=0; i4=1; end endendmodule

Assignment 1 Design a 4-bit binary adder using top-down methodology. Design a 4-bit binary adder using top-down methodology. Write a behavioral description for HA units. Write a behavioral description for HA units. Delay (S)= 5, Delay (C)=2 Delay (S)= 5, Delay (C)=2 Use structural description for all the other parts. Use structural description for all the other parts. Write a testbench for your design. Write a testbench for your design. What is the delay of the 4-bit binary adder (use ModelSim). What is the delay of the 4-bit binary adder (use ModelSim).

Integer Keyword: integer Keyword: integer integer variables are signed numbers integer variables are signed numbers Bit width: implementation-dependent (at least 32- bits) Bit width: implementation-dependent (at least 32- bits) Designer can also specify a width: Designer can also specify a width: integer [7:0] tmp; integer [7:0] tmp; Examples: Examples: integer counter; initial counter = -1; counter = -1;

Real Keyword: real Keyword: real Values: Values: Default value: 0 Default value: 0 Decimal notation: Decimal notation: Scientific notation: 3e6 (=3x10 6 ) Scientific notation: 3e6 (=3x10 6 ) Cannot have range declaration Cannot have range declaration Example: Example: real delta; initialbegin delta=4e10; delta=4e10; delta=2.13; delta=2.13;end integer i; initial i = delta; // i gets the value 2 (rounded value of 2.13) i = delta; // i gets the value 2 (rounded value of 2.13)

Time Used to store values of simulation time Used to store values of simulation time Keyword: time Keyword: time Bit width: implementation-dependent (at least 64) Bit width: implementation-dependent (at least 64) $time system function gives current simulation time $time system function gives current simulation time Example: Example: time save_sim_time; initial save_sim_time = $time; save_sim_time = $time;

Arrays Only one-dimensional arrays supported Only one-dimensional arrays supported Allowed for reg, integer, time Allowed for reg, integer, time Not allowed for real data type Not allowed for real data type Syntax: Syntax: [start_idx : end_idx]; [start_idx : end_idx]; Examples: Examples: integer count[0:7]; reg bool[31:0]; time chk_point[1:100]; reg [4:0] port_id[0:7]; integer matrix[4:0][4:0]; // illegal count[5]chk_point[100]port_id[3] Note the difference between vectors and arrays Note the difference between vectors and arrays