Verilog Tutorial. Outline Numbers(A.2.7) Vectors in Verilog (Section 4.1.7) Four value logic (Section 4.2.1) Comments and White Space (A.2.2) Test Methodology.

Slides:



Advertisements
Similar presentations
Verilog HDL -Introduction
Advertisements

Verilog Section 3.10 Section 4.5. Keywords Keywords are predefined lowercase identifiers that define the language constructs – Key example of keywords:
1 The 2-to-4 decoder is a block which decodes the 2-bit binary inputs and produces four output All but one outputs are zero One output corresponding to.
Princess Sumaya University
Chap. 6 Dataflow Modeling
Overview Part 2 – Combinational Logic Functions and functional blocks
Functions and Functional Blocks
Verilog Intro: Part 1.
Hardware Description Language (HDL)
Combinational Logic with Verilog Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer.
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.
Full Adder Section 4.5 Spring, 2014 J.Ou. Schedule 62/3MondayBinary addition: full adder 72/5WednesdayBinary addition: full adder/four-bit adder L2/6ThursdayLab.
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.
Parallel Adder Recap To add two n-bit numbers together, n full-adders should be cascaded. Each full-adder represents a column in the long addition. The.
Chapter 1 Binary Systems 1-1. Digital Systems
CSE-221 Digital Logic Design (DLD)
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
ENEE 408C Lab Capstone Project: Digital System Design Spring 2006 Class Web Site:
2/3/03ΗΥ220 - Μαυροειδής Ιάκωβος1 Delays in Behavioral Verilog - Interassignment Delay  Key idea: unlike blocking delay, RHS is evaluated before delay.
Combinational Logic Design
Digital System Design EEE344 Lecture 3 Introduction to Verilog HDL Prepared by: Engr. Qazi Zia, Assistant Professor EED, COMSATS Attock1.
Combinational Digital Circuits. Measurement Our world is an analog world. Measurements that we make of the physical objects around us are never in discrete.
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
Lecture # 12 University of Tehran
Number Systems and Codes In PLC
Digital Logic Lecture 08 By Amr Al-Awamry. Combinational Logic 1 A combinational circuit consists of an interconnection of logic gates. Combinational.
Decoder Mano Section 4.9. Outline Decoder Applications Verilog.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
CS231 Fundamentals1 Fundamentals What kind of data do computers work with? – Deep down inside, it’s all 1s and 0s What can you do with 1s and 0s? – Boolean.
CS 151: Digital Design Chapter 3 3-8: Encoding. CS 151 Encoding Encoding - the opposite of decoding - the conversion of a maximum of 2 n input code to.
Outline Analysis of Combinational Circuits Signed Number Arithmetic
Combinational Circuit – Arithmetic Circuit
ECE 2372 Modern Digital System Design
COE 405 Introduction to Logic Design with Verilog
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
Combinational Logic. Digital Circuits Introduction Logic circuits for digital systems may be combinational or sequential. A combinational circuit.
Verilog Language Concepts
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
Data TypestMyn1 Data Types The type of a variable is not set by the programmer; rather, it is decided at runtime by PHP depending on the context in which.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
CS151 Introduction to Digital Design
1 Verilog Digital System Design Z. Navabi, 2006 Verilog Language Concepts.
Outline Binary Addition 2’s complement Binary Subtraction Half Adder
CO5023 Introduction to Digital Circuits. What do we know so far? How to represent numbers (integers and floating point) in binary How to convert between.
1 Fundamentals of Computer Science Combinational Circuits.
ECE 171 Digital Circuits Chapter 8 Hardware Description Language Herbert G. Mayer, PSU Status 11/23/2015 Copied with Permission from prof. Mark
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.
Number Representation (Part 2) Computer Architecture (Fall 2006)
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
LECTURE V TEST BENCHES. As your projects become more complex and multiple modules are employed, it will no longer be possible to simulate them as we did.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patterson and Hennessy Text.
Hardware Description Languages: Verilog
Adapted from Krste Asanovic
Discussion 2: More to discuss
Digital System Verification
KARTHIK.S Lecturer/ECE S.N.G.C.E
Verilog-HDL-3 by Dr. Amin Danial Asham.
Hardware Description Languages: Verilog
Introduction to Verilog
Behavioral Modeling in Verilog
Chapter 3: Dataflow Modeling
Introduction to Verilog
Number Systems and Circuits for Addition
Digital Electronics and Microprocessors
Chapter 10.3 and 10.4: Combinatorial Circuits
Digital System Design Combinational Logic
COE 202 Introduction to Verilog
Verilog Tutorial.
Presentation transcript:

Verilog Tutorial

Outline Numbers(A.2.7) Vectors in Verilog (Section 4.1.7) Four value logic (Section 4.2.1) Comments and White Space (A.2.2) Test Methodology (Section 4.2.2) Propagation Delay (Section 4.3)

Number Format N’Bvalue – N is the size in bits If the size is not known, the number is assumed to have as many bits as the expression in which it is being used. Zeros are automatically padded on the front to bring it up to full size. – B is the base ‘b for binary (base 2) ‘o for octal (base 8) ‘d for decimal (base 10) ‘h for hexadecimal (base 16) If the base is omitted, the base defaults to decimal – value gives the value

Numbers 3’b101 – 3 bits, binary, 101 ‘b11 – 000…0011 8’b11 – ’hAB –

Vector in Verilog A vector in Verilog is denoted by square brackets, enclosing a contiguous range of bits. – e.g. sum[3:0] – The leftmost index in the bit range is the most significant bit – The rightmost index is the least significant bit

A Vector Example vect_word[7:0]= – vect_word[2]=1 – vect_word[3:0]=0100 ↔4 – vect_word[5:1]=00010 ↔2

Four-Value Logic 0 1 X – Represents a condition of ambiguity – X happens when a net is driven by two primitives that have opposing output values Z – Three state primitives produce an output value of Z when they are not enabled. Great care must be taken to ensure that a bus does not have contending drivers active at the same time.

Modeling Tip A verilog simulator assigns an initial value of z to all nets, which then inherit the value of their drivers. A simulator assigns an initial value of x to variables that have type reg.

Example

Comments A pair of slashes – // comment – Forms a comment from the text that follows it on the same line /* */ – /* comment */

Test Methodology Organization – Stimulus Generator – UUT – Response Monitor

A Sample Test Bench

Output

Propagation Delay Physical logic gates have a propagation delay between the time that an input changes and the time that the output responds to the change. The primitives in verilog have a default propagation delay of 0. Use 0 delay to verify functionality of a model quickly. Use a unit delay to expose the time sequence of signal activity, which can be masked by a 0-delay simulation Circuit designers do not attempt to create accurate gate level timing model of a circuit by manual methods. Instead, they rely on a synthesis tool to implement a design that will satisfy timing constraints.

Add Propagation Delay