Introduction to Combinational Verilog EECS270 rev 9/25/12.

Slides:



Advertisements
Similar presentations
Verilog.
Advertisements

The Verilog Hardware Description Language
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Synchronous Sequential Logic
ELEN 468 Lecture 21 ELEN 468 Advanced Logic Design Lecture 2 Hardware Modeling.
Chap. 6 Dataflow Modeling
Table 7.1 Verilog Operators.
Verilog Intro: Part 1.
Combinational Logic with Verilog Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer.
Introduction So far, we have studied the basic skills of designing combinational and sequential logic using schematic and Verilog-HDL Now, we are going.
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part3: Verilog – Part 1.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
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.
CSE 341 Verilog HDL An Introduction. Hardware Specification Languages Verilog  Similar syntax to C  Commonly used in  Industry (USA & Japan) VHDL 
التصميم المنطقي Second Course
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
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.
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
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
Computer Organization Lecture Set – 03 Introduction to Verilog Huei-Yung Lin.
University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Figure 1.1 The Altera UP 3 FPGA Development board
Overview Logistics Last lecture Today HW5 due today
Combinational Logic in Verilog
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
ECE 2372 Modern Digital System Design
ECE/CS 352 Digital Systems Fundamentals
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
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.
Electrical and Computer Engineering University of Cyprus LAB 1: VHDL.
1/8/ L2 VHDL Introcution© Copyright Joanne DeGroat, ECE, OSU1 Introduction to VHDL.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Introduction to ASIC flow and Verilog HDL
Verilog hdl – II.
Introduction to VHDL Coding Wenchao Cao, Teaching Assistant Department of EECS University of Tennessee.
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.
Introduction to Verilog
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
Introduction to Verilog. Structure of a Verilog Program A Verilog program is structured as a set of modules, which may represent anything from a collection.
1 University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Exp#5 & 6 Introduction to Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.
Hardware Description Languages: Verilog
COMP541 More on Verilog; Debouncing switches
Introduction to Verilog
Discussion 2: More to discuss
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]
Introduction to Verilog
Behavioral Modeling in Verilog
Week 5, Verilog & Full Adder
COE 202 Introduction to Verilog
Introduction to Digital System and Microprocessor Design
Introduction to Verilog
Supplement on Verilog adder examples
Chapters 4 – Part3: Verilog – Part 1
Introduction to Verilog
The Verilog Hardware Description Language
Introduction to Verilog
Prof. Onur Mutlu ETH Zurich Spring March 2019
EEE2243 Digital System Design Chapter 1: Verilog HDL (Combinational) by Muhazam Mustapha, February 2012.
© Copyright Joanne DeGroat, ECE, OSU
COE 202 Introduction to Verilog
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

Introduction to Combinational Verilog EECS270 rev 9/25/12

What is Verilog? An HDL: Hardware Description Language Another way to express logical function. Fundamental form is an algebraic equation. For example: C = A & B Schematic equivalent:

Anatomy of a Verilog Module Used to organize logical functions Top-Level-Module (just one) Sub-Level-Module 1 (multiple sub modules) Sub-Level-Module 2 Sub-Level-Module 3 Consists of: –Module Declarations –Input Output Declarations –Logic Function output variables = fnc(input variables)

Lets Make a Verilog Half Adder Module Schematic Half AdderVerilog Half Adder

Module Declaration Module Name Inputs (listed first) Outputs (listed last) Marks end of module

Input and Output Declarations Input Declaration Input Connections Listed in Module Declaration Output Declaration Output Connections Listed in Module Declaration Output Data Type Declaration Must be declared as either “wire” or “reg” wire: Does not hold state and depends continuously on input values. reg: (Register) dependent on previous values or state. This type will be used later in sequential logic labs.

Assignments Assignments associate output variables to input variables via a logical function. Although the assignment for cout follows s, s and cout respond simultaneously (in parallel) to changes in a and b. Unlike programming languages such as C, these logical statements are not processed in sequential order.

Verilog Operators Available for Lab 3 Verilog is a very powerful language with high level constructs such as: If Then Else, Case Statements, Arithmetic operators, Etc For Lab 3 you are only allowed to use: 1.Bitwise AND & 2.Bitwise OR | 3.Bitwise negation ~ Can be combined with other logical functions ie NOR of A, B is ~(A | B). 4.Bitwise XOR ^

Literals Literals are constants. The syntax for a constant is: size: size of number in bits, optional base: numeric base, b (binary), d (decimal, default), h (hex) number: Constant to be specified For example: 549 decimal number, no size specified 'h8FF hex number, no size specified 4'b11 4-bit binary number (0011) 5'd3 5-bit decimal number (00011)

Literals, continued Defining constant references can be very helpful and makes your HDL readable. For example, `define CONST3 3’b011 a = b & `CONST3;

Sets Sets are a way to express a collection of signals For example, lets say we want to set the seven segment HEX0 display to the pattern 7. 1st, declare the seven segments as a set: Output [6:0] H0; 2nd, set each element to the appropriate level to give the pattern 7.

Sets, continued assign H0[0] = 0; assign H0[1] = 0; assign H0[2] = 0; assign H0[3] = 1; assign H0[4] = 1; assign H0[5] = 1; assign H0[6] = 1; Member AssignmentGroup Assignment assign H0 = 7’b assign H0 = 7’h78 `define N7 7’b assign H0 = `N7; or Clearest and easiest

Module Hierarchy HDL project are typically organized into one top level module and several supporting sub modules. Sub modules generally represent the various functions needed to support your design. The top level module defines the inputs and outputs of your application and the organization of the supporting functions or sub modules.

Module Hierarchy Example Consider a two-bit adder built with a half adder and full adder. add_2bit module (top) add_half module (sub) add_full module (sub)

Half Adder Module Sub Module

Full Adder Module Sub Module

Two Bit Adder Module Top Level Module Application IO on top level Pass values between modules with “wire” types module “call” syntax ( ); Module name is the name declared in module Instance name is one you make up. Each must be unique. Inputs and Outputs must follow order set in module declaration.

Final Verilog File add_2bit module (top) add_half module (sub) add_full module (sub) sub module top module

Quartus Particulars As with schematic projects, the top-level-module and project name must be the same. Top-level-module and file (.v) should be the same name. Although it is acceptable to place modules in separate files, it is recommended to put the top- level-module and sub modules in the same file. FPGA pin assignments are made to IO names established in the top-level-module with either pin assignment editor or editing the qsf file.