Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 3: Structural Modeling Spring 2009 W. Rhett.

Slides:



Advertisements
Similar presentations
Verilog HDL -Introduction
Advertisements

Verilog Fundamentals Shubham Singh Junior Undergrad. Electrical Engineering.
Verilog.
Simulation executable (simv)
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Supplement on Verilog adder examples
Verilog Intro: Part 1.
Hardware Description Language (HDL)
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.
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
Multiplexer as a Universal Function Generator Lecture L6.7 Section 6.2.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part3: Verilog – Part 1.
Decoders/DeMUXs CS370 – Spring Decoder: single data input, n control inputs, 2 outputs control inputs (called select S) represent Binary index of.
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.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 8: Sequential Design Spring 2009 W. Rhett.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 1: Introduction Spring 2009 W. Rhett Davis.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 21: Where do you go from here? Spring 2009.
Spring 20067W. Rhett Davis with minor modifications by Dean Brock ECE 406 at UNASlide 1 ECE 406 Design of Complex Digital Systems Lecture 10: 9: State.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
ECE 353 Computer Systems Lab I Verilog Hardware Description Language.
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
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 13: Regression Testing, MemAccess Block.
Spring 2007W. Rhett Davis with minor modification by Dean Brock UNCA ECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 7: Design Example,
ECE 2372 Modern Digital System Design
ECE/CS 352 Digital Systems Fundamentals
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.
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
Digital System 數位系統 Verilog HDL Ping-Liang Lai (賴秉樑)  
Module 2.1 Gate-Level/Structural Modeling UNIT 2: Modeling in Verilog.
Module 1.2 Introduction to Verilog
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 7: Design Example, Modeling Flip-Flops Spring.
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
Introduction to VHDL Spring EENG 2920 Digital Systems Design Introduction VHDL – VHSIC (Very high speed integrated circuit) Hardware Description.
Spring 2007 W. Rhett Davis with minor editing by J. Dean Brock UNCA ECE Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 1: Introduction.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
Chap. 4 Modules and Ports. 2 Modules and Ports Modules Ports Hierarchical Names Summary.
Chapter 2: Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 2-1 Chapter 2a: Structural Modeling.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
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.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 6: Procedural Modeling Spring 2009 W. Rhett.
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.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 12: Intro to the LC-3 Micro-architecture.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 9: State Machines & Reset Behavior Spring.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 20: Cache Design Spring 2009 W. Rhett Davis.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 10: Data-Converter Example Spring 2009 W.
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 18: More Complex Interfaces Spring 2009.
1 Lecture 1: Verilog HDL Introduction. 2 What is Verilog HDL? Verilog Hardware Description Language(HDL)? –A high-level computer language can model, represent.
Exp#5 & 6 Introduction to Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.
1 A hardware description language is a computer language that is used to describe hardware. Two HDLs are widely used Verilog HDL VHDL (Very High Speed.
Introduction to Verilog COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals.
Reg and Wire:.
Discussion 2: More to discuss
Verilog-HDL-3 by Dr. Amin Danial Asham.
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Behavioral Modeling in Verilog
Combinatorial Logic Design Practices
Introduction to Verilog
Levels in computer design
Lecture 8 Logistics Last lecture Last last lecture Today
Chapters 4 – Part3: Verilog – Part 1
COE 202 Introduction to Verilog
Presentation transcript:

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 3: Structural Modeling Spring 2009 W. Rhett Davis NC State University with significant material from Paul Franzon, Bill Allen, & Xun Liu

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 2 Announcements l Labs start next week l HW#1 Due in Tuesday » Please put the section number next to your name! » Problem 2 (a) and (b) –Please convert to binary manually » Problem 7 –See Sutherland, section 19.0 for an example of the `define compiler directive

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 3 Summary of Last Lecture l What characters are allowed in identifiers? l What kinds of circuits would generate the values 0, 1, x, and z? l What is the difference between wire and reg variables? l What parts of the module description do you need to create a test-bench?

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 4 Parts of a Verilog Module l Header: module ( ); l Parameter, Port, & Variable declarations l Functionality description » Structural –Instantiations of basic gates –Instantiations of lower-level modules » Behavioral –Data-Flow (continuous assignments) –Procedural (initial & always blocks) l Terminator: endmodule

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 5 wire vs. reg l An easy way to understand the difference between wire and reg variables: l The right-hand side may contain wires or reg’s If the functionality description is… Then the left-hand side of an assignment must be a… Structural (basic gate or module instantiations) wire Data-Flowwire Proceduralreg

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 6 Today’s Lecture l Gate-Level Modeling l Hierarchy l Demuxes and Decoders

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 7 Gate-Level Modeling l Gate-level modeling is the lowest level of design description in Verilog. l Verilog models at the gate level consists of directly specifying the interconnections of fundamental logic elements (AND, OR, etc.). l The available logic elements at the gate level are: and, nand, or, nor, xor, xnor, not, buf, notif & bufif. (All these are keywords.) » What is the significance of a keyword?

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 8 Gate Instantiation l By declaring a series of instances, we can describe a gate-level structure l The basic format of a gate-level instantiation is: (, ); l Instance name is optional l Write out the following instantiations:

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 9 Gate Instantiation

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 10 2-to-1 Multiplexer x1 n_sel x2 out 2-to-1 Mux i0 i1 sel i0 sel i1 out Write the module header, port & variable declarations:

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 11 2-to-1 Multiplexer x1 n_sel x2 i0 sel i1 out Write the instantiations and terminator:

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 12 2-to-1 Multiplexer So the complete module description is: Where are the Instance Names?

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 13 Today’s Lecture l Gate-Level Modeling l Hierarchy l Demuxes and Decoders

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 14 4-bit Multiplexer Consider a 4-bit 2-to-1 multiplexer: mux_2 A[2] B[2] Out[2] mux_2 A[1] B[1] Out[1] mux_2 A[0] B[0] Out[0] sel mux_2 A[3] B[3] Out[3] Which can be constructed with four 2-to-1 multiplexers. 4-bit mux A B sel Out 4 4 4

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 15 Module Instantiation l Module instantiation looks the same as gate-level instantiation: ( ); l Port list follows same order as module header module mux_2 (out, i0, i1, sel); l Instance name is optional, but I suggest you use it » Why? Because you can examine a modules internal signals in the test-bench using the syntax: instance_name.signal_name

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 16 4-bit Multiplexer mux_2 A[2] B[2] Out[2] mux_2 A[1] B[1] Out[1] mux_2 A[0] B[0] Out[0] sel mux_2 A[3] B[3] Out[3] Write the module header, port & variable declarations:

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 17 4-bit Multiplexer m3 m2 m1 m0 mux_2 A[2] B[2] Out[2] mux_2 A[1] B[1] Out[1] mux_2 A[0] B[0] Out[0] sel mux_2 A[3] B[3] Out[3] Write the instantiations and terminator:

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 18 Alternative Port-List Format Using the 4-bit multiplexer as an example, the instantiations could be written as: mux_2 m3(.sel(sel),.i0(A[3]),.i1(B[3]),.out(Out[3])); mux_2 m2(.i0(A[2]),.i1(B[2]),.out(Out[2]),.sel(sel)); Alternatively, a port-list can contain a list of port-name references with the following format:. ( ) This is more verbose, but the port-order doesn’t matter.

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 19 4-bit Multiplexer So the complete module description is: How would you reference signal x1 in instance m2? Is sel a reg or a wire? What would happen if you declared sel… as a wire? as a reg?

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 20 Port Connection Rules l Verilog has rules about what kinds of variables can be connected to certain ports (see T&M 1.4.4, S&F 2.3.1) » assignment in procedural blocks are made to reg variables » all other assignments are made to net (wire) variables l As a result, there are restrictions on the variables used for port connections, as illustrated below: port in a module port on an instance inputnetreg | net outputreg | netnet inoutnet

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 21 Port Connection Rules l An intuitive way to think about it: » A reg cannot be connected to a port that is considered to be a “driver” » The following ports are considered to be drivers: –input port in a module –output port on an instance –inout port, both in a module and on an instance

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 22 Port Connection Rules l Which signals cannot be declared as reg? x1 n_sel x2 i0 sel i1 out

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 23 Today’s Lecture l Gate-Level Modeling l Hierarchy l Demuxes and Decoders

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 24 Demultiplexer l A demultiplexer (DEMUX) passes a single input to one of many output lines, depending on a control input sz0z1 0in0 10 Draw a gate-level schematic for a DEMUX:

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 25 Larger DEMUXes l Cascade Smaller DEMUXes to make larger ones

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 26 Decoder l A decoder sets one output line high and all others low, depending on an input signal sz0z How can you turn a DEMUX into a decoder?

Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 27 Summary l What is the format of a Verilog instantiation? l Are all parts of the instantiation required? l What is the order of the port-names in a gate instantiation? A module instantiation? l Can a reg variable be connected to the input port of an instance?