1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.

Slides:



Advertisements
Similar presentations
Verilog HDL -Introduction
Advertisements

Verilog.
Simulation executable (simv)
Supplement on Verilog adder examples
Chap. 6 Dataflow Modeling
Verilog Intro: Part 1.
Hardware Description Language (HDL)
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
ECE 353 Computer Systems Lab I Verilog Hardware Description Language.
CSE241 RTL Performance.1Kahng & Cichy, UCSD ©2003 CSE241A VLSI Digital Circuits Winter 2003 Recitation 2.5: Performance Coding.
CSE241 R1 Verilog.1Kahng & Cichy, UCSD ©2003 CSE241 VLSI Digital Circuits Winter 2003 Recitation 1: Verilog Introduction.
Reconfigurable Computing (EN2911X, Fall07) Lecture 05: Verilog (1/3) Prof. Sherief Reda Division of Engineering, Brown University
Workshop Topics - Outline
Computer Organization Lecture Set – 03 Introduction to Verilog Huei-Yung Lin.
Digital System Design EEE344 Lecture 3 Introduction to Verilog HDL Prepared by: Engr. Qazi Zia, Assistant Professor EED, COMSATS Attock1.
More Examples Dataflow/Behavioral Modeling Section 4.12.
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.
INTRODUCTION TO VERILOG HDL Presented by m.vinoth.
1 VERILOG Fundamentals Workshop סמסטר א ' תשע " ה מרצה : משה דורון הפקולטה להנדסה Workshop Objectives: Gain basic understanding of the essential concepts.
 Delay values control the time between the change in a right-hand-side operand and when the new value is assigned to the left- hand side.  Three ways.
Introduction to FPGA AVI SINGH. Prerequisites Digital Circuit Design - Logic Gates, FlipFlops, Counters, Mux-Demux Familiarity with a procedural programming.
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
Workshop Topics - Outline
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Combinational Logic. Digital Circuits Introduction Logic circuits for digital systems may be combinational or sequential. A combinational circuit.
C ONTINUOUS A SSIGNMENTS. C OMBINATIONAL L OGIC C IRCUITS each output of a Combinational Logic Circuit  A function of the inputs - Mapping functions.
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.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
CH71 Chapter 7 Hardware Description Language (HDL) By Taweesak Reungpeerakul.
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.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Under-Graduate Project Logic Design with Behavioral Models Speaker: Darcy Tsai Adviser:
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.
Introduction to ASIC flow and Verilog HDL
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 4: Testing, Dataflow Modeling Spring 2009.
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.
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.
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,
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 99-1 Under-Graduate Project Logic Design with Behavioral Models Speaker: 銀子駒 Adviser:
Digital System Design Verilog ® HDL Dataflow Modeling Maziar Goudarzi.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Exp#5 & 6 Introduction to Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.
Introduction to Verilog COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals.
Hardware Description Languages: Verilog
Reg and Wire:.
Verilog Introduction Fall
Lecture 2 Supplement Verilog-01
Verilog-HDL-3 by Dr. Amin Danial Asham.
Hardware Description Languages: Verilog
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Chapter 4 Combinational Logic
Behavioral Modeling in Verilog
Chapter 3: Dataflow Modeling
OUTLINE Introduction Basics of the Verilog Language
Introduction to Verilog
COE 202 Introduction to Verilog
Supplement on Verilog adder examples
COE 202 Introduction to Verilog
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System Workshop 5 - Data types A Workshop 6 - Data types B Workshop 7 - Operators Workshop 8 - Signed arithmetic Workshop 9 - Behavioral modeling A Workshop 10 - Behavioral modeling B Workshop 11 - Behavioral modeling C Workshop 12 - Data flow modeling Workshop 13 - Coding Styles

2 Workshop 12 – Data flow Modeling Continuous assignments Implicit Continuous Assignment Implicit Net Declaration Delays Regular Assignment Delay Implicit continuous assignment delay Net declaration delay Conditional Operator

3 Data Flow Modeling Data Flow Modeling provides a powerful way to implement a design. Verilog allows a circuit to be designed in terms of the data flow between registers and how the design processes data. logic synthesis tools are used to create a Gate-Level circuit from the data flow design description. In the digital design community, the term Register Transfer Level (RTL) design is commonly used for a combination of Data Flow modeling and Behavioral modeling.

4 Continuous Assignments There are two type of assignments in Verilog:  Continuous assignments.  Procedural assignments. Continuous assignments are used outside sequential blocks and can be applied only on nets. Procedural assignments can be used in sequential blocks only. Can be applied on regs not on nets. Continuous assignment is an abstract model of combinational HW driving values onto nets. Continuous assignment keyword assign Continuous assignment is always active. If any input to the assign statement, changes at any time, the assign statement will be re-evaluated and the output will be propagated.

5 Continuous Assignements cont. ● Syntax: assign #delay = ; ● Where to write them: ● Outside procedures ● Inside a module ● Properties: ● They all execute in parallel ● Are order independent ● Are continuously active // optionalnet type !!

6 Regular Continuous assignment examples assign #5 a = b ; // 5 time units delay assign #(5,4) a = b ; // 5 (rise), 4 (fall) time units delays assign {a,b} = {c,d} ; // concatenation assign a[5:3] = b[2:0] ; // sub-vectors connections assign out = in1 & in2 ; // out is a net, i1 and i2 are nets assign addit[15:0] = addit1[15:0] ^ addit2[15:0] ; /* Continuous assign for vector nets, addit is a 16 bit vector net. addi1 and addit2 are 16-bit vector registers */ assign {cout, sum[3:0]} = a[3:0] + b[3:0] + cin ; /* Left-hand side is a concatenation of a scalar net and a vector net

7 Continuous Assignment example - Adders module Half_Adder(sum, carry, A, B) ; input A, B ; output sum, carry ; /* Verilog default to a net data type on the left-hand side of any continuous assignment */ assign sum = (~A&B) + (A&~B) ; assign carry = A&B ; endmodule module Full_Adder (Cout, Sum, A, B, Cin) ; output Cout, Sum ; // default to a net data type input A, B, Cin ; assign Sum = A ^ B ^ Cin ; assign Cout = (A & B) | (B & Cin) | (A & Cin) ; endmodule

8 1-bit Comparator example module Compare1(A, B, Equal, Alarger, Blarger) ; input A, B ; output Equal, Alarger, Blarger ; assign Equal = (A & B) | (~A & ~B) ; assign Alarger = (A & ~B) ; assign Blarger = (~A & B) ; endmodule A B Alarger Blarger Equal Compare1

9 Implicit Continuous Assignment / Net Declaration Implicit Continuous Assignment Verilog provides a shortcut by which a continuous assignment can be placed on a net when it is declared. Example: wire out ; // regular continuous assignment. declare a net assign out = in1 & in2 ; // continuous assignment on the net wire out = in1 & in2 ; // = implicit continuous assignment Implicit Net Declaration wire in1, in2 ; assign out = in1 & in2 ; /* out not declared as a net but an implicit net declaration is inferred for that signal name */ If the net is connected to the module port, the width of the inferred net is equal to the width of the module port.

10 Delays Nets do not store values but they inflict signal delays. # indicates delay and value. Delay can specify both rise and fall times. #(, ) Delay values control the time between the change in any of the right-hand-side operands (input signals) and when the new value is assigned to the left-hand side. Delay types: 1. Regular assignment delay. 2. Implicit continuous assignment delay. 3. Net declaration delay

11 Delay types 1. Regular Assignment Delay Delay value is specified after the keyword assign. Any change in one of the input signals, will be reflected on the output net, times later. An input pulse shorter than the assignment delay, does not propagate to the output. Example: assign #10 out = in1 & in2 ; 2. Implicit continuous assignment delay Used to specify both delay and an assignment on the net. wire #10 out = in1 & in2 ; // same as: wire out ; assign #10 out = in1 & in2 ; 3. Net declaration delay A delay can be specified on a net when declared without putting continuous assignment on the net. wire #10 out ; assign out = in1 & in2 ;

12 Conditional Operator – Conditional Assignment ● Conditional Operators are frequently used in dataflow modeling to model conditional assignments. The conditional expression acts as a switching control. ● The Conditional Operator ( ? : ) takes three operands. Usage: condition_expr ? true_expr : false_expr ; ● The condition_expr is first evaluated. If the result is true (logical 1) then the true_expr is evaluated. If the result is false (logical 0) then the false_expr is evaluated. ● The action of a conditional operator is similar to a multiplexer.

13 Conditional Assignment examples // model functionality of a tri-state buffer assign addr_bus = drive_enable ? Addr_out : 32’bZ ; // model functionality of a 2-to-1 mux assign out = control ? in1 : in0 ; // more elegant than: assign out = (control & in1) | (~ control & in0) ; ● Conditional operators can be nested. Each true_expr or false_expr can itself be conditional operation. // Nested condition operator (4:1 mux). Input [1:0] sel ; assign out = sel[1] ? (sel[0] ? in3 : in2) : (sel[0] ? in1 : in0) ;

14 Exercise 4 Implement 7- Segment Decoder, in dataflow modeling. Description: converter between Hex number to 7-Segment Display. Applying a low logic level to a segment, will light it up and applying high logic level turns it off. Write the code for the module and its Test Bench.