Overview of Verilog Part 1

Similar documents
Chapter 3 Part 2 Combinational Logic Design

Chapter 3 Part 2 Combinational Logic Design

Design Using Verilog

Hardware Description Language VHDL (1) Introduction

14:332:231 DIGITAL LOGIC DESIGN. Hardware Description Languages

Combinational Logic II

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

Verilog for Combinational Circuits

Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design

What is Verilog HDL? Lecture 1: Verilog HDL Introduction. Basic Design Methodology. What is VHDL? Requirements

Computer Aided Design Basic Syntax Gate Level Modeling Behavioral Modeling. Verilog

Logic and Computer Design Fundamentals VHDL. Part 1 Chapter 4 Basics and Constructs

Contents. Appendix D Verilog Summary Page 1 of 16

Hardware description languages

ECE/Comp Sci 352 Digital Systems Fundamentals. Charles R. Kime Section 2 Fall Logic and Computer Design Fundamentals

Hardware Description Languages (HDLs) Verilog

Digital Systems Design

Verilog Tutorial (Structure, Test)

Introduction to Verilog HDL. Verilog 1

Speaker: Shao-Wei Feng Adviser: Prof. An-Yeu Wu Date: 2010/09/28

Chapter 2 Using Hardware Description Language Verilog. Overview

Introduction to Verilog

Combinational Logic. Prof. Wangrok Oh. Dept. of Information Communications Eng. Chungnam National University. Prof. Wangrok Oh(CNU) 1 / 93

Chapter 2 Basic Logic Circuits and VHDL Description

C-Based Hardware Design

Verilog Design Principles

Verilog Design Principles

Verilog HDL Introduction

Lecture 2: Data Types, Modeling Combinational Logic in Verilog HDL. Variables and Logic Value Set. Data Types. Why use an HDL?

EECS 427 Lecture 14: Verilog HDL Reading: Many handouts/references. EECS 427 W07 Lecture 14 1

Verilog. Reminder: Lab #1 due tonight! Fall 2008 Lecture 3

Department of Computer Science and Electrical Engineering. Intro to Verilog II

Chap 6 Introduction to HDL (d)

Introduction to Verilog. Garrison W. Greenwood, Ph.D, P.E.

EECS150 - Digital Design Lecture 10 Logic Synthesis

Verilog Overview. The Verilog Hardware Description Language. Simulation of Digital Systems. Simulation of Digital Systems. Don Thomas, 1998, Page 1

ECEN 468 Advanced Digital System Design

IT T35 Digital system desigm y - ii /s - iii

Online Verilog Resources

Digital Design (VIMIAA01) Introduction to the Verilog HDL

Where We Are. Quick History Lesson. Lecture 8: Combinational Verilog. Specifying Circuits. Last lecture: Minimization with K!maps

Schematic design. Gate level design. 0 EDA (Electronic Design Assistance) 0 Classical design. 0 Computer based language

A Verilog Primer. An Overview of Verilog for Digital Design and Simulation

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

structure syntax different levels of abstraction

Here is a list of lecture objectives. They are provided for you to reflect on what you are supposed to learn, rather than an introduction to this

EE 8351 Digital Logic Circuits Ms.J.Jayaudhaya, ASP/EEE

register:a group of binary cells suitable for holding binary information flip-flops + gates

Lecture 8: Combinational Verilog. CSE 370, Autumn 2007 Benjamin Ylvisaker. Where We Are. Last lecture: Minimization with K!maps

N-input EX-NOR gate. N-output inverter. N-input NOR gate

Introduction to Verilog design. Design flow (from the book)

Tutorial on Verilog HDL

Verilog Overview. The Verilog Hardware Description Language. Simulation of Digital Systems. Simulation of Digital Systems. Don Thomas, 1998, Page 1

Verilog Overview. The Verilog Hardware Description Language. Simulation of Digital Systems. Simulation of Digital Systems. Don Thomas, 1998, Page 1

ECE 545 Lecture 5. Data Flow Modeling in VHDL. George Mason University

101-1 Under-Graduate Project Digital IC Design Flow

Hardware description language (HDL)

ECEN 468 Advanced Logic Design

Gate level or structural modeling

Contents. Appendix D VHDL Summary Page 1 of 23

Spiral 1 / Unit 4 Verilog HDL. Digital Circuit Design Steps. Digital Circuit Design OVERVIEW. Mark Redekopp. Description. Verification.

Introduction to Digital VLSI Design מבוא לתכנון VLSI ספרתי

EECS150 - Digital Design Lecture 10 Logic Synthesis

Modeling Concepts. Introduction

Concurrent Signal Assignment Statements (CSAs)

ECE468 Computer Organization & Architecture. The Design Process & ALU Design

ENGIN 241 Digital Systems with Lab

ECE Digital System Design & Synthesis Exercise 1 - Logic Values, Data Types & Operators - With Answers

Synthesis of Combinational and Sequential Circuits with Verilog

Verilog Dataflow Modeling

Lecture #2: Verilog HDL

Verilog Design Entry, Synthesis, and Behavioral Simulation

Lecture 3 Introduction to VHDL

FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language. Reference: [1]

Lecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1

Introduction to Verilog design. Design flow (from the book) Hierarchical Design. Lecture 2

Lab 0: Introduction to the FPGA Development Board

Verilog introduction. Embedded and Ambient Systems Lab

Chapter 6: Hierarchical Structural Modeling

Lab 0: Introduction to the FPGA Development Board

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

Why Should I Learn This Language? VLSI HDL. Verilog-2

Verilog modeling* for synthesis of ASIC designs * for native speakers of VHDL. ELEC 4200 Victor P. Nelson

HDL for Combinational Circuits. ENEL211 Digital Technology

Chapter 2a: Structural Modeling

Lab 4: Arithmetic Logic Unit (ALU)

Chap 6 - Introduction to HDL (b)

Gate-Level Minimization

CDA 4253 FPGA System Design Introduction to VHDL. Hao Zheng Dept of Comp Sci & Eng USF

Advanced Digital Design Using FPGA. Dr. Shahrokh Abadi

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 4 Introduction to VHDL

Advanced Digital Design with the Verilog HDL

VLSI Design 13. Introduction to Verilog

CSE241 VLSI Digital Circuits Winter Recitation 1: RTL Coding in Verilog

VHDL Structural Modeling II

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1

HDLs and SystemVerilog. Digital Computer Design

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

Transcription:

University of Wisconsin - Madison ECE/Comp ci 352 Digital ystems Fundamentals Charles R. Kime ection 2 Fall 2001 Chapters 3 and 4 Verilog Part 1 Minor Updates on 11/9/01 are shown in red. Charles Kime Overview of Verilog Part 1 Objectives Verilog Basics Notation Keywords & Constructs Operators Types of Descriptions tructural Dataflow Boolean Equations Conditions using Binary Combinations Conditions using Binary Decisions Behavioral & Hierarchical Process (Procedural) Chapter 4-Part 6 2 1

Objectives To become familiar with the hardware description language (HDL) approach to specifying designs Be able to read a simple Verilog HDL description Be able to write a simple Verilog HDL description using a limited set of syntax and semantics Understanding the need for a hardware view when reading and writing an HDL Chapter 4-Part 6 3 Verilog Notation - 1 Verilog is: Case sensitive Based on the programming languages C & Ada Comments ingle Line // [end of line] Multiple Line /* */ List element separator:, tatement terminator: ; Chapter 4-Part 6 4 2

Verilog Notation - 2 Binary Values for Constants and Variables 0 1 X,x -Unknown Z,z High impedance state (open circuit) Constants n b[integer]: 1 b1 = 1, 8 b1 = 000000001, 4 b0101= 0101, 8 bxxxxxxxx, 8 bxxzz = xxxxxxzz n h[integer]: 8 ha9 = 10101001, 16 hf1= 0000000011110001 Identifier Examples calar: A,C,RUN,stop,m,n Vector: sel[0:2], f[0:5], ACC[31:0], UM[15:0], sum[15:0] Chapter 4-Part 6 5 Verilog Keywords & Constructs - 1 Keywords are lower case module fundamental building block for Verilog designs Used to construct design hierarchy Cannot be nested ends a module not a statement => no ; Module Declaration module module_name (module_port, module_port, ); Example: module full_adder (A, B, c_in, c_out, ); Chapter 4-Part 6 6 3

Verilog Keywords & Constructs - 2 Input Declaration calar input list of input identifiers; Example: input A, B, c_in; Vector input[range] list of input identifiers; Example: input[15:0] A, B, data; Output Declaration calar Example: output c_out, OV, MINU; Vector Example: output[7:0] ACC, REG_IN, data_out; Chapter 4-Part 6 7 Verilog Keywords & Constructs - 3 Primitive Gates buf, not, and, or, nand, nor, xor, xnor yntax: gate_operator instance_identifier (output, input_1, input_2, ) Examples: and A1 (F, A, B); //F = A B or O1 (w, a, b, c), O2 (x, b, c, d, e); //w=a+b+c,x=b+c+d+e Chapter 4-Part 6 8 4

Verilog Operators - 1 Bitwise Operators ~ NOT & AND OR ^ XOR ^~ or ~^ XNOR Example: input[3:0] A, B; output[3:0] Z ; assign Z = A ~B; Chapter 4-Part 6 9 Verilog Operators - 2 Arithmetic Operators +, -, (plus others) Logical, Equality & Relational Operators!, &&,, = =,!=, >=, <=, >, < (plus others) Concatenation & Replication Operators {identifier_1, identifier_2, } {n{identifier}} Examples: {REG_IN[6:0],erial_in}, {8 {1 b0}} Chapter 4-Part 6 10 5

tructural Verilog Circuits can be described by a netlist as a text alternative to a diagram - Example (ee Figure 3-59 in text): module fig359s (A0, B0, C0, C1, 0); input A0, B0, C0; output C1, 0; //even internal wires needed wire[1:7] N; //Ports on primitive gates listed output port first not G1 (N[3],C0), G2 (N[5],N[2]), G3 (N[6],N[3]); nand G4 (N[1],A0,B0); nor G5 (N[2],A0,B0), G6 (C1,N[2],N[4]); and G7 (N[4],N[1],N[3]), G8 (N[7],N[1],N[5]); xor G9 (0,N[6],N[7]); Chapter 4-Part 6 11 Dataflow Verilog - 1 Circuit function can be described by continuous assignment statements using Boolean equations (ee Figure 3-59 in text): module fig359d (A0, B0, C0, C1, 0); input A0, B0, C0; output C1, 0; wire[1:2] N; assign N[1] = ~(A0 & B0); /*Note: Cannot write ~& for NAND */ assign N[2] = ~(A0 B0); assign C1 = ~((N[1] & ~C0) N[2]); assign 0 = (~N[2] & N[1])^(~(~C0)); Chapter 4-Part 6 12 6

Dataflow Verilog - 2 Circuit function can be described by continuous assignment statements using the conditional operator with binary combinations as in a truth table (ee Figure 3-14 in text): module fig314dm (A, E_n, D_n); input[1:0] A; input E_n; output[3:0] D_n; //Conditional: (X)? Y: Z - if X is true, then Y,else Z assign D_n = {4{E_n}} ( (A == 2'b00)? 4'b1110: (A == 2'b01)? 4'b1101: (A == 2'b10)? 4'b1011: (A == 2'b11)? 4'b0111: 4'bxxxx); //Note that & is now Chapter 4-Part 6 13 Dataflow Verilog - 3 Circuit function can be described by continuous assignment statements using the conditional operator for binary decisions on inputs(ee Figure 3-14 in text): module fig314dc (A, E_n, D_n); input[1:0] A; input E_n; output[3:0] D_n; /* Conditional: (X)? Y: Z - if X is true, then Y,else Z */ assign D_n = {4{E_n}} (A[1]? (A[0]? 4'h7 : 4'hB): (A[0]? 4'hD : 4'hE));/* Note that & is now. */ Chapter 4-Part 6 14 7

Behavioral & Hierarchical Verilog Circuit function can be described by continuous assignment statements at higher than the logic level (ee Figure 3-31 in text): module addsub (A, B, R, sub) ; input [3:0] A, B ; output [3:0] R ;//ee Fig. 3-51 for carry out input sub ; wire [3:0] data_out; add A1 (A, data_out, sub, R); M1comp C1 (B, data_out, sub); Chapter 4-Part 6 15 Behavioral & Hierarchical Verilog module add (X, Y, C_in, ); input [3:0] X, Y; input C_in; output [3:0] ; assign = X + Y + {3'b0, C_in}; module M1comp (data_in, data_out, comp); input[3:0] data_in; input comp; output [3:0] data_out; assign data_out = {4{comp}} ^ data_in; Chapter 4-Part 6 16 8