Verilog Module Module declaration Module instantiation module Add_full (sum, c_out, a, b, c_in); // parent module input a, b, c_in; output c_out, sum;

Slides:



Advertisements
Similar presentations
Counters Discussion D8.3.
Advertisements

CDA 3100 Recitation Week 11.
//HDL Example 4-10 // //Gate-level description of circuit of Fig. 4-2 module analysis (A,B,C,F1,F2); input.
Verilog.
The Verilog Hardware Description Language
Supplement on Verilog adder examples
ELEN 468 Lecture 21 ELEN 468 Advanced Logic Design Lecture 2 Hardware Modeling.
Verilog Modules for Common Digital Functions
Verilog Intro: Part 1.
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
//HDL Example 5-1 // //Description of D latch (See Fig.5-6) module D_latch (Q,D,control); output Q; input.
Verilog. 2 Behavioral Description initial:  is executed once at the beginning. always:  is repeated until the end of simulation.
1 Brief Introduction to Verilog Weiping Shi. 2 What is Verilog? It is a hardware description language Originally designed to model and verify a design.
How to get a Circuit in verilog converted to hspice, connected to the micron package models, and simulating in hspice and hsimplus.
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
Lecture 1 Design Hierarchy Chapter 1. Digital System Design Flow 1.Register-Transfer Levl (RTL) – e.g. VHDL/Verilog 2.Gate Level Design 3.Circuit Level.
Half Adder ( / ) Structural description: Data flow description:
ELEN 468 Lecture 151 ELEN 468 Advanced Logic Design Lecture 15 Synthesis of Language Construct I.
Lecture 2: Hardware Modeling with Verilog HDL
1 Lecture 1: Verilog HDL Introduction. 2 What is Verilog HDL? Verilog Hardware Description Language(HDL)? –A high-level computer language can model, represent.
1 Brief Introduction to Verilog Weiping Shi. 2 What is Verilog? It is a hardware description language Allows designers to quickly create and debug large.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
Arbitrary Waveform Discussion 12.2 Example 34. Recall Divide-by-8 Counter Use q2, q1, q0 as inputs to a combinational circuit to produce an arbitrary.
Counters Discussion 12.1 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
CS 61C Discussion 10 (1) Jaein Jeong Fall input MUX °Out = in0 * select’ + in1 * select in0in1selectout
ELEN468 Lecture 11 ELEN468 Advanced Logic Design Lecture 1Introduction.
ECEN ECEN475 Introduction to VLSI System Design Verilog HDL.
ELEN468 Lecture 11 ELEN468 Advanced Logic Design Lecture 1Introduction.
D Flip-Flops in Verilog Discussion 10.3 Example 27.
More Examples Dataflow/Behavioral Modeling Section 4.12.
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
COE 405 Introduction to Logic Design with Verilog
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
Digital System 數位系統 Verilog HDL Ping-Liang Lai (賴秉樑)  
Module 2.1 Gate-Level/Structural Modeling UNIT 2: Modeling in Verilog.
ECE/CS 352 Digital System Fundamentals© 2001 C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapters 3 and 4: Verilog – Part 2 Charles R.
1 Lecture 2: Data Types, Modeling Combinational Logic in Verilog HDL.
Module 1.2 Introduction to Verilog
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
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 2 2.1: Verilog – The Basics 2.2: Verilog – Simulation and Testbenches.
Introduction to ASIC flow and Verilog HDL
M.Mohajjel. Objectives Learn How to write synthesizable Verilog code Common mistakes and how to avoid them What is synthesized for what we code Digital.
HDL Model Combinational circuits. module halfadder(s, cout, a, b); input a, b; output s, cout; xor g1(s, a, b); and g2(cout, a, b); endmodule.
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,
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part4: Verilog – Part 2.
Verilog 강의자료 REAL TIME ARCHITECTURE LAB Advanced Digital Design with the Verilog HDL Chapter 1 ~ 5.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
1 Lecture 1: Verilog HDL Introduction. 2 What is Verilog HDL? Verilog Hardware Description Language(HDL)? –A high-level computer language can model, represent.
Hardware Description Languages: Verilog
ELEN 468 Advanced Logic Design
Verilog Introduction Fall
Behavioral Modeling Structural modeling Behavioral modeling
Verilog-HDL-3 by Dr. Amin Danial Asham.
Hardware Description Languages: Verilog
Verilog HDL.
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Verilog.
COE 202 Introduction to Verilog
The Verilog Hardware Description Language
COE 202 Introduction to Verilog
Presentation transcript:

Verilog Module Module declaration Module instantiation module Add_full (sum, c_out, a, b, c_in); // parent module input a, b, c_in; output c_out, sum; wire w1, w2, w3; Add_half M1 (w1, w2, a, b);// child module Add_half M2 (sum, w3, w1, c_in);// child module or (c_out, w2, w3);// primitive instantiation endmodule

Module Port Connections By position By name Empty port module child(a,b,c); … endmodule module parent; wire u,v,w; child m1 (u,v,w); child m2 (.c(w),.a(u),.b(v)); child m3 (u,,w); endmodule

Descriptive Styles Explicit structural description module Add_half (sum, c_out, a, b); inputa,b; outputsum, c_out; wirec_out_bar; xor (sum, a, b); nand (c_out_bar, a, b); not (c_out, c_out_bar); endmodule

module compare_2_str (A_lt_B, A_gt_B, A_eq_B, A0, A1, B0, B1); inputA0, A1, B0, B1; outputA_lt_B, A_gt_B, A_eq_B; wirew1, w2, w3, w4, w5, w6, w7; or(A_lt_B, w1, w2, w3); nor(A_gt_B, A_lt_B, A_eq_B); and(A_eq_B, w4, w5); and(w1, w6, B1); and(w2, w6, w7, B0); and(w3, w7, B0, B1); not(w6, A1); not(w7, A0); xnor(w4, A1, B1); xnor(w5, A0, B0); endmodule

Descriptive Styles Behavioral description module Flip_flop (q, data_in, clk, rst); input data_in, clk, rst; output q; reg q; (posedge clk) begin if (rst == 1) q = 0; else q = data_in; end endmodule

module compare_2_algo (A_lt_B, A_gt_B, A_eq_B, A, B); input[1:0]A, B; outputA_lt_B, A_gt_B, A_eq_B; regA_lt_B, A_gt_B, A_eq_B; (A or B)// Behavior and event expression begin A_lt_B = 0; A_gt_B = 0; A_eq_B = 0; if (A==B) A_eq_B = 1; else if (A > B) A_gt_B = 1; else A_lt_B = 1; end endmodule

Descriptive Styles Continuous Assignment module adder (a, b, sum, c_out); output sum, c_out; inputa, b; assign {c_out, sum} = a + b; endmodule

module compare_2ca (A_lt_B, A_gt_B, A_eq_B, A, B); input[1:0]A, B; outputA_lt_B, A_gt_B, A_eq_B; assign A_lt_B = (A < B); assign A_gt_B = (A > B); assign A_eq_B = (A == B); endmodule

Descriptive Styles Structural Predefined primitive Combinational circuits only User-defined primitive Instantiated modules Behavioral Continuous assignment Combinational circuits only Always construct Initial construct

Priority Encoder module PE (y0,y1,y2,y3, c0, c1); inputy0,y1,y2,y3; outputc0, c1; assign c0=y0|y1; assign c1=y0|(~y1 & y2); endmodule