Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-1 Chapter 3: Dataflow Modeling.

Slides:



Advertisements
Similar presentations
Verilog HDL -Introduction
Advertisements

Reconfigurable Computing S. Reda, Brown University Reconfigurable Computing (EN2911X, Fall07) Lecture 06: Verilog (2/3) Prof. Sherief Reda Division of.
Simulation executable (simv)
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.
ECE2030 Introduction to Computer Engineering Lecture 13: Building Blocks for Combinational Logic (4) Shifters, Multipliers Prof. Hsien-Hsin Sean Lee School.
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.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
ELEN 468 Lecture 41 ELEN 468 Advanced Logic Design Lecture 4 Data Types and Operators.
ELEN 468 Lecture 151 ELEN 468 Advanced Logic Design Lecture 15 Synthesis of Language Construct I.
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.
The Multicycle Processor II CPSC 321 Andreas Klappenecker.
Assembly Language and Computer Architecture Using C++ and Java
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value Z:high-impedance.
Reconfigurable Computing (EN2911X, Fall07) Lecture 05: Verilog (1/3) Prof. Sherief Reda Division of Engineering, Brown University
Computer Organization Lecture Set – 03 Introduction to Verilog Huei-Yung Lin.
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.
each of these is an instantiation of “full_adder”
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Chapter 6. Dataflow Modeling. Continuous Assignments The left hand side always be a scalar or vector net or a concatenation of scalar and vector nets.
Programmable Logic Architecture Verilog HDL FPGA Design Jason Tseng Week 5.
Outline Analysis of Combinational Circuits Signed Number Arithmetic
ECE 2372 Modern Digital System Design
Workshop Topics - Outline
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Chapter 4: Behavioral Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 4-1 Ders – 4: Davranışsal Modelleme.
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
Module 1.3 Verilog Basics UNIT 1 : Introduction to Verilog Data Types.
EEE2243 Digital System Design Chapter 3: Verilog HDL (Combinational) by Muhazam Mustapha, January 2011.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
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 Verilog Digital System Design Z. Navabi, 2006 Verilog Language Concepts.
CEC 220 Digital Circuit Design Introduction to VHDL Wed, February 25 CEC 220 Digital Circuit Design Slide 1 of 19.
M.Mohajjel. Continuous Assignments Continuously Drive a value onto a net Left hand side must be net Right hand side registers nets function calls Keyword.
Chapter 2: Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 2-1 Chapter 2a: Structural Modeling.
Introduction to ASIC flow and Verilog HDL
Sharif University of Technology Department of Computer Engineering Verilog ® HDL Basic Concepts Alireza Ejlali.
Number Representation and Arithmetic Circuits
Chapter 8: Combinational Logic Modules Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 8-1 Chapter 8: Combinational.
Introduction to Verilog
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Chapter 5: Tasks, Functions, and UDPs Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 5-1 Chapter 5: Tasks, Functions,
Chapter 6: Hierarchical Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 6-1 Chapter 6: Hierarchical.
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,
CEC 220 Digital Circuit Design Introduction to VHDL Wed, Oct 14 CEC 220 Digital Circuit Design Slide 1 of 19.
Digital System Design Verilog ® HDL Dataflow Modeling Maziar Goudarzi.
Exp#5 & 6 Introduction to Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.
Hardware Description Languages: Verilog
ELEN 468 Advanced Logic Design
Lecture 2 Supplement Verilog-01
Hardware Description Languages: Verilog
Chapter 4 Combinational Logic
Behavioral Modeling in Verilog
Chapter 3: Dataflow Modeling
Logic Values 0:logic 0 / false 1:logic 1 / true X:unknown logic value
COE 202 Introduction to Verilog
Chapter 4: Behavioral Modeling
Supplement on Verilog adder examples
COE 202 Introduction to Verilog
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-1 Chapter 3: Dataflow Modeling Prof. Ming-Bo Lin Department of Electronic Engineering National Taiwan University of Science and Technology

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-2 Features of Dataflow  Any digital system  interconnecting registers  combinational logic circuits  A powerful way to implement a design  Logic synthesis tools can be used to create a gate- level netlist  RTL (register transfer level) is a combination of dataflow and behavioral modeling

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-3 Continuous Assignments  Syntax assign [delay] net_lvalue = expression; assign #5 {c_out, sum[3:0]} = a[3:0] + b[3:0] + c_in;

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-4 Expressions  expression = operators + operands  Operators  Operands

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-5 Operators

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-6 Regular Assignment Delays  The inertial delay model is defaulted wire in1, in2, out; assign #10 out = in1 & in2;

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-7 Integer Constants  Simple decimal form  Base format notation 16’habcd ’sb1001 // -7

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-8 Real Constants  Decimal notation 1.5 //.3 // illegal //  Scientific notation 15E12 32E _45_e-12

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-9 String Constants  A sequence of characters enclosed by double quotes ("")  Can only be specified in a single line  Each character is represented as an 8-bit ASCII code

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-10 Data Types  Nets  Any hardware connection points  Variables  Any data storage elements

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-11 The reg Variable  Hold a value between assignments  May be used to model hardware registers  Examples reg a, b; reg [7:0] data_a; reg [0:7] data_b; reg signed [7:0] d;

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-12 The integer Variable  Contains integer values  Has at least 32 bits  Is treated as a signed reg variable with the LSB being bit 0 integer i, j; integer data[7:0];

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-13 The time Variable  Used for storing and manipulating simulation time  Used in conjunction with the $time system task  Only unsigned value and at least 64 bits, with the LSB being bit 0 time events; time current_time;

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-14 The real and realtime Variables  Cannot use range declaration  Defaulted to zero (0.0) real events; realtime current_time;

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-15 Vectors  A vector = multiple bit width  [high:low] or [low:high]  The leftmost bit is the MSB  include nets and reg data types  A scalar = 1-bit vector

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-16 Bit-Select and Part-Select  integer and time are allowed  real and realtime are not allowed  Constant part select: data_bus[3:0], bus[3]  Variable part select: [ +:width]: data_bus[8+:8] [ -:width]: data_bus[15-:8]

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-17 Array and Memory Elements  All net and variable data types are allowed  An array element can be a scalar or a vector wire a[3:0]; reg d[7:0]; wire [7:0] x[3:0]; reg [31:0] y[15:0]; integer states [3:0]; time current[5:0];

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-18 Memory  Memory  model ROM, RAM, or register files  Reference  a whole word or  a portion of a word of memory reg [7:0] mema [7:0]; reg [7:0] memb [3:0][3:0]; wire sum [7:0][3:0]; mema[4][3] mema[5][7:4] memb[3][1][1:0] sum[5][0]

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-19 Bitwise Operators  A bit-by-bit operation  A z is treated as x  The shorter operand is zero-extended

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-20 An Example --- A 4-to-1 MUX // using basic and, or, not logic operators assign out = (~s1 & ~s0 & i0) | (~s1 & s0 & i1) | (s1 & ~s0 & i2) | (s1 & s0 & i3) ;

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-21 Arithmetic Operators  The result is x if any operand bit has a value x  Negative numbers are represented as 2’s complement

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-22 Concatenation/Replication Operators  Concatenation operator y = {a, b[0], c[1]};  Replication operator y = {a, {4{b[0]}}, c[1]};

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-23 An Example --- A 4-Bit Full Adder // specify the function of a 4-bit adder assign {c_out, sum} = x + y + c_in;

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-24 A 4-Bit Two’s Complement Adder // specify the function of a two's complement adder assign t = y ^ {4{c_in}}; assign {c_out, sum} = x + t + c_in;

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-25 Reduction Operators  Perform only on one vector operand  Carry out a bit-wise operation  Yield a 1-bit result  Work bit by bit from right to left

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-26 A 9-Bit Parity Generator // dataflow modeling using reduction operator assign ep = ^x; // even parity generator assign op = ~ep; // odd parity generator

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-27 An All-Bit-Zero/One Detector // dataflow modeling assign zero = ~(|x); // all-bit zero assign one = &x; // all-bit one

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-28 Logical Operators  Always evaluate to a 1-bit value, 0, 1, or x  The result is x (a false condition) if any operand bit is x or z

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-29 Relational Operators  The result is 1 if the expression is true and 0 if the expression is false  Return x if any operand bit is x or z

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-30 Equality Operators  Compare the two operands bit by bit  The shorter operand is zero-extended  Return 1 if the expression is true and 0 if the expression is false

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-31 Equality Operators  The operators (==, !=)  yield an x if any operand bit is x or z  The operators (===, !==)  yield a 1 if the two operands exactly match  0 if the two operands not exactly match

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-32 A 4-B Magnitude Comparator // dataflow modeling using relation operators assign Oaeqb = (a == b) && (Iaeqb == 1); // = assign Oagtb = (a > b) || ((a == b)&& (Iagtb == 1)); // > assign Oaltb = (a < b) || ((a == b)&& (Ialtb == 1)); // <

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-33 Shift Operators  Logical shift operators  Arithmetic shift operators

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-34 An Example of Shift Operators input signed [3:0] x; output [3:0] y; output signed [3:0] z; assign y = x >> 1; assign z = x >>> 1;

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-35 The Conditional Operator  Usage: condition_expr ? true_expr: false_expr;  If condition_expr = x or z: the result = true_expr & false_expr (0 and 0 gets 0, 1 and 1 gets 1, others gets x )  For example assign out = selection ? in_1: in_0;

Chapter 3: Dataflow Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 3-36 An Example --- A 4-to-1 MUX // using conditional operator (?:) assign out = s1 ? ( s0 ? i3 : i2) : (s0 ? i1 : i0) ;