ECE UMass, Amherst. Verilog tutorial

Size: px
Start display at page:

Download "ECE UMass, Amherst. Verilog tutorial"

Transcription

1 ECE UMass, Amherst Verilog tutorial 1. In this tutorial, we are going to design and implement a 2-bit comparator in Verilog and simulate it using the service provided on In the following, you could find the step by step description of the design, implementation and simulation: (a) Design of a single bit comparator The comparator we are designing here, is a simple equality comparator. It has 2 inputs: a and b and 1 output: eq. The output is asserted (gets the value of 1) when a is equal to b. Otherwise, it is 0. As you recall, the functionality of 2- input XOR gate is very similar but with different polarity (the output is 0 when inputs are equal and it is 1 when inputs are not equal). So if using an Inverter gate we change the polarity of the output, it would work exactly the same way as the comparator does. The gate level design of such comparator is shown in Fig.??. Since we are going to describe this design in Verilog, we need to name every single entity in the design. That is why, we have named the XOR gate as g1 and the Inverter gate as g2. Another point worth mentioning is that since we need to connect the input of the Inverter to the output of the XOR, we need a connection. That s why we also named the connection between them (here w). Now, we are ready to describe this module int Verilog. (b) Implementation of the comparator in Verilog For this part, you need to go to the website, The layout of the website is shown in Fig.??. On the right hand side of the page, we could enter the Verilog code of our comparator. On the first line, we should describe the way our module looks like from outside world. Using module keyword,

2 Figure 1: Design of a single bit comparator Figure 2: Verilog code describing the comparator Figure 3: Layout of the page 2

3 we name our module (here we name it CMP) and in a pair of parentheses, we name the ports of the module (here, a, b, and eq). After that, we should define the direction of each port which has been done on lines 3 and 4. After that, we need to define the intermediate signals if needed (here we need to define w). If those signals get assigned in concurrent body of the module, they should be defined as wire, otherwise, they should be defined as reg. After defining the intermediate signals, it s time to instantiate our gates or other building blocks of our design. Here, we just used XOR and NOT primitive gates of Verilog. After specifying the type of each gate, we named them and in a pair of parentheses we defined their port connections. In all Verilog primitive gates, the first port is assigned to the output of the gate and the rest are assigned to the inputs. Finally, we finish the description of our module by using endmodule keyword. The Verilog code describing the comparator is shown if Fig.?? (c) Development of the testbench When we are done with the design, it s time to test it in a simulation environment. To do so, we need to develop a testbench. A testbench is also a module which has no ports. It just instantiates other modules inside it and applies the stimulus to their inputs to observe their behavior in terms of their outputs. In the testbench, we need to define 3 signals to connect to the ports of our comparator. Since we are going to change the value of the inputs of the instantiated module in a sequential manner inside a sequential block, we need to define the signals connected to the inputs of the instantiated module as reg. For the output ports of the module, since the signals are just carrying the values, they need to be defined as wire. After defining the signals, we have to instantiate the module we want to test. Instantiating a user defined module is exactly the same as instantiating a Verilog primitive gate except for the port ordering which is as it is defined in the module definition 3

4 for user defined ones. Finally, it s time to apply the stimulus and check the outputs. We assign and change the values of the inputs in a sequential manner inside an initial block. Before applying the stimulus, we need to make the simulator to show the values of the signals in a visual form. In order to do so, we use $dumpfile ( dump.vcd ); and $dumpvars(1);. In order to assign a value to a signal, we use equal sign (=). After applying a set of test values (also known as test vector) we should wait for some time to see the outputs. Waiting is done using # followed by the time needed to wait. Here, after applying a new test vector to the inputs, we wait for 10ns before applying the next test vector. When dealing we edaplayground simulator, it draws the waveform until when the last assignment takes place which leaves us no time to see the outputs resulted from that input assignment. To address this issue, we always finish the testing by assigning some dummy values to the inputs. The Verilog code testing the comparator is shown in Fig.??. (d) Checking the waveform Now by clicking on the run button, we could see the simulation waveform and make sure our system is working as it is intended. The waveform extracted from simulation of the comparator is shown in Fig.??. As it can be seen, the output is equal to 1 whenever the inputs are equal and it is 0 otherwise. (e) Implementation of a 2-bit comparator Design of a 2-bit comparator is shown in Fig.??. As it can be seen, we instantiated two instances of the comparator developed in the previous parts. The inputs here are not single bits anymore. Instead they are 2-bit buses. Each comparator is checking the equality of a pair of bits from the inputs. The two numbers are equal if both pairs are equal. Hence, the output is generated by using an AND gate fed by the output of each comparator. (f) Verilog code for the 2-bit comparator The Verilog code, describing the 2-bit comparator in shown in 4

5 Figure 4: Testbench for testing the comparator module Figure 5: Testbench for testing the comparator module 5

6 Figure 6: Design of a 2-bit comparator Fig.??. Since it s instantiating the CMP module, it has to be defined in the same file as CMP is defined (this is not a restriction imposed by Verilog. It s imposed by edaplayground). Please note how we defined x and y. Having that [1:0] next to the wire keyword means that these signals are buses where the leftmost bit is indexed as 1 and the rightmost one is indexed as 0 (the width would be (left index - right index)+1) which is 2 in this case. (g) Simulation of the 2-bit comparator Testing the 2-bit comparator is the same as single bit one except for the stimulus. In the latter case, the stimulus should be defined as 2-bit buses. The testbench for the 2-bit comparator is shown in Fig.?? and the waveform of it is shown in Fig.??. 6

7 Figure 7: Verilog code for 2-bit comparator 7

8 Figure 8: Testbench for 2-bit comparator Figure 9: Waveform of 2-bit comparator s simulation 8

Hardware Description Languages (HDLs) Verilog

Hardware Description Languages (HDLs) Verilog Hardware Description Languages (HDLs) Verilog Material from Mano & Ciletti book By Kurtulus KULLU Ankara University What are HDLs? A Hardware Description Language resembles a programming language specifically

More information

Tutorial: Working with the Xilinx tools 14.4

Tutorial: Working with the Xilinx tools 14.4 Tutorial: Working with the Xilinx tools 14.4 This tutorial will show you how to: Part I: Set up a new project in ISE Part II: Implement a function using Schematics Part III: Implement a function using

More information

Lab 7 (All Sections) Prelab: Introduction to Verilog

Lab 7 (All Sections) Prelab: Introduction to Verilog Lab 7 (All Sections) Prelab: Introduction to Verilog Name: Sign the following statement: On my honor, as an Aggie, I have neither given nor received unauthorized aid on this academic work 1 Objective The

More information

Lab 7 (Sections 300, 301 and 302) Prelab: Introduction to Verilog

Lab 7 (Sections 300, 301 and 302) Prelab: Introduction to Verilog Lab 7 (Sections 300, 301 and 302) Prelab: Introduction to Verilog Name: Sign the following statement: On my honor, as an Aggie, I have neither given nor received unauthorized aid on this academic work

More information

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

Introduction to Verilog. Garrison W. Greenwood, Ph.D, P.E. Introduction to Verilog Garrison W. Greenwood, Ph.D, P.E. November 11, 2002 1 Digital Design Flow Specification Functional Design Register Transfer Level Design Circuit Design Physical Layout Production

More information

ENSC E-123: HW D3: Counter Applications; Counter in Verilog

ENSC E-123: HW D3: Counter Applications; Counter in Verilog HW D3; Counter Applications 1 ENSC E-123: HW D3: Counter Applications; Counter in Verilog REV 0 1 ; February 12, 2015 Contents 1 Counter Applications: Sync vs Async Function (5 points) 2 1.1 Crummy: asyncclear(2points).................

More information

ECE 4514 Digital Design II. Spring Lecture 2: Hierarchical Design

ECE 4514 Digital Design II. Spring Lecture 2: Hierarchical Design ECE 4514 Digital Design II Spring 2007 Abstraction in Hardware Design Remember from last lecture that HDLs offer a textual description of a netlist. Through abstraction in the HDL, we can capture more

More information

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 11. Introduction to Verilog II Sequential Circuits

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 11. Introduction to Verilog II Sequential Circuits Name: Instructor: Engr. Date Performed: Marks Obtained: /10 Group Members (ID):. Checked By: Date: Experiment # 11 Introduction to Verilog II Sequential Circuits OBJECTIVES: To understand the concepts

More information

University of California, Davis Department of Electrical and Computer Engineering. Lab 1: Implementing Combinational Logic in the MAX10 FPGA

University of California, Davis Department of Electrical and Computer Engineering. Lab 1: Implementing Combinational Logic in the MAX10 FPGA 1 University of California, Davis Department of Electrical and Computer Engineering EEC180B DIGITAL SYSTEMS II Winter Quarter 2018 Lab 1: Implementing Combinational Logic in the MAX10 FPGA Objective: This

More information

Experiment 0 OR3 Gate ECE 332 Section 000 Dr. Ron Hayne June 8, 2003

Experiment 0 OR3 Gate ECE 332 Section 000 Dr. Ron Hayne June 8, 2003 Experiment 0 OR3 Gate ECE 332 Section 000 Dr. Ron Hayne June 8, 2003 On my honor I have neither received nor given aid on this report. Signed: Ronald J. Hayne Part I Description of the Experiment Experiment

More information

Creating Verilog Tutorial Netlist Release Date: 01/13/2005(Version 2)

Creating Verilog Tutorial Netlist Release Date: 01/13/2005(Version 2) Creating Verilog Tutorial 2-1 - Creating a verilog netlist for a schematic: The verilog netlist is necessary for automatic layout (placement and routing) tools. It contains information about the I/O pins

More information

ECE 4514 Digital Design II. Spring Lecture 9: Review of Key Ideas, System Commands and Testbenches

ECE 4514 Digital Design II. Spring Lecture 9: Review of Key Ideas, System Commands and Testbenches ECE 4514 Digital Design II Lecture 9: Review of Key Ideas, System Commands and Testbenches A Language Lecture Iterating the Key Ideas Verilog is a modeling language. It cannot express hardware directly.

More information

ECE 353 Lab 4. Verilog Review. Professor Daniel Holcomb With material by Professor Moritz and Kundu UMass Amherst Fall 2016

ECE 353 Lab 4. Verilog Review. Professor Daniel Holcomb With material by Professor Moritz and Kundu UMass Amherst Fall 2016 ECE 353 Lab 4 Verilog Review Professor Daniel Holcomb With material by Professor Moritz and Kundu UMass Amherst Fall 2016 Recall What You Will Do Design and implement a serial MIDI receiver Hardware in

More information

Lab 2 Designing with Verilog

Lab 2 Designing with Verilog UNIVERSITY OF CALIFORNIA AT BERKELEY COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE Lab 2 Designing with Verilog 1.0 Motivation In this lab you will learn how to express

More information

Module 4. Design of Embedded Processors. Version 2 EE IIT, Kharagpur 1

Module 4. Design of Embedded Processors. Version 2 EE IIT, Kharagpur 1 Module 4 Design of Embedded Processors Version 2 EE IIT, Kharagpur 1 Lesson 22 Introduction to Hardware Description Languages - II Version 2 EE IIT, Kharagpur 2 Instructional Objectives At the of the lesson

More information

Icarus Verilog HDL (iverilog)

Icarus Verilog HDL (iverilog) Icarus Verilog HDL (iverilog) It is a good idea to install a compiler / simulator on the PC. This will allow you to save your code on your computer and will allow you to do some things not possible online.

More information

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013 EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013 Print Here Student ID Signature This is a closed book exam. The exam is to be completed in one-hundred ten (110) minutes. Don t use scratch

More information

CSE370 TUTORIAL 3 - INTRODUCTION TO USING VERILOG IN ACTIVE-HDL

CSE370 TUTORIAL 3 - INTRODUCTION TO USING VERILOG IN ACTIVE-HDL Introduction to Active-HDL CSE370 TUTORIAL 3 - INTRODUCTION TO USING VERILOG IN ACTIVE-HDL Objectives In this tutorial, you will learn how to write an alternate version of the full adder using Verilog,

More information

Combinational Logic Design with Verilog. ECE 152A Winter 2012

Combinational Logic Design with Verilog. ECE 152A Winter 2012 Combinational Logic Design with Verilog ECE 152A Winter 2012 Reading Assignment Brown and Vranesic 2 Introduction to Logic Circuits 2.10 Introduction to Verilog 2.10.1 Structural Specification of Logic

More information

Introduction to Verilog

Introduction to Verilog Introduction to Verilog COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals Presentation Outline Hardware Description Language Logic Simulation versus Synthesis

More information

CSE 591: Advanced Hardware Design and Verification (2012 Spring) LAB #0

CSE 591: Advanced Hardware Design and Verification (2012 Spring) LAB #0 Lab 0: Tutorial on Xilinx Project Navigator & ALDEC s Active-HDL Simulator CSE 591: Advanced Hardware Design and Verification Assigned: 01/05/2011 Due: 01/19/2011 Table of Contents 1 Overview... 2 1.1

More information

Introduction. Purpose. Intended Audience. Conventions. Close

Introduction. Purpose. Intended Audience. Conventions. Close Introduction Introduction Verilog-XL is a simulator that allows you to test the logic of a design. The process of logic simulation in Verilog-XL is as follows: 1. Describe the design to Verilog-XL. 2.

More information

Lab 6 : Introduction to Verilog

Lab 6 : Introduction to Verilog Lab 6 : Introduction to Verilog Name: Sign the following statement: On my honor, as an Aggie, I have neither given nor received unauthorized aid on this academic work 1 Objective The main objective of

More information

Building hierarchical designs in Verilog

Building hierarchical designs in Verilog Building hierarchical designs in Verilog Arhitectura Calculatoarelor/Computer Architecture October 15, 2017 Verilog hierarchies Objectives: Learn how to instantiate a module Construct a design hierarchy

More information

Hardware description language (HDL)

Hardware description language (HDL) Hardware description language (HDL) A hardware description language (HDL) is a computer-based language that describes the hardware of digital systems in a textual form. It resembles an ordinary computer

More information

Xilinx ISE Simulation Tutorial

Xilinx ISE Simulation Tutorial Xilinx ISE Simulation Tutorial 1. Start Xilinx ISE Project Navigator 2. Create a new project Click on File, then choose New Project on the drop down menu Enter your project name, in this case the project

More information

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog ECE 2300 Digital Logic & Computer Organization Spring 2018 More Sequential Logic Verilog Lecture 7: 1 Announcements HW3 will be posted tonight Prelim 1 Thursday March 1, in class Coverage: Lectures 1~7

More information

Verilog for Combinational Circuits

Verilog for Combinational Circuits Verilog for Combinational Circuits Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Fall, 2014 ldvan@cs.nctu.edu.tw http://www.cs.nctu.edu.tw/~ldvan/

More information

In this lecture, we will focus on two very important digital building blocks: counters which can either count events or keep time information, and

In this lecture, we will focus on two very important digital building blocks: counters which can either count events or keep time information, and In this lecture, we will focus on two very important digital building blocks: counters which can either count events or keep time information, and shift registers, which is most useful in conversion between

More information

ECE 4514 Digital Design II. Spring Lecture 3: Verilog Bread and Butter

ECE 4514 Digital Design II. Spring Lecture 3: Verilog Bread and Butter ECE 4514 Digital Design II Spring 2007 Verilog Difference between synthesis and simulation Modules, module declarations and instantiation Constants Numbers Data types Value Levels Regs Vectors Arrays Synthesis

More information

Logic Circuits II ECE 2411 Thursday 4:45pm-7:20pm. Lecture 3

Logic Circuits II ECE 2411 Thursday 4:45pm-7:20pm. Lecture 3 Logic Circuits II ECE 2411 Thursday 4:45pm-7:20pm Lecture 3 Lecture 3 Topics Covered: Chapter 4 Discuss Sequential logic Verilog Coding Introduce Sequential coding Further review of Combinational Verilog

More information

Chap 3. Modeling structure & basic concept of Verilog HDL

Chap 3. Modeling structure & basic concept of Verilog HDL Chap 3. Modeling structure & basic concept of Verilog HDL Fall semester, 2016 Prof. Jaeseok Kim School of Electrical & Electronics Eng. Yonsei university jaekim@yonsei.ac.kr Digital System Design 3-1 Chapter

More information

Asynchronous FIFO Design

Asynchronous FIFO Design Asynchronous FIFO Design 2.1 Introduction: An Asynchronous FIFO Design refers to a FIFO Design where in the data values are written to the FIFO memory from one clock domain and the data values are read

More information

Combinational Logic II

Combinational Logic II Combinational Logic II Ranga Rodrigo July 26, 2009 1 Binary Adder-Subtractor Digital computers perform variety of information processing tasks. Among the functions encountered are the various arithmetic

More information

One and a half hours. Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

One and a half hours. Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE COMP 12111 One and a half hours Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE Fundamentals of Computer Engineering Date: Monday 23rd January 2017 Time: 09:45-11:15 Answer

More information

Module 2.1 Gate-Level/Structural Modeling. UNIT 2: Modeling in Verilog

Module 2.1 Gate-Level/Structural Modeling. UNIT 2: Modeling in Verilog Module 2.1 Gate-Level/Structural Modeling UNIT 2: Modeling in Verilog Module in Verilog A module definition always begins with the keyword module. The module name, port list, port declarations, and optional

More information

The University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2016

The University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2016 The University of Alabama in Huntsville ECE Department CPE 526 01 Final Exam Solution Spring 2016 1. (6 points) Draw the transistor-level diagram of a two input CMOS NAND gate. VCC x y z f x y GND 2. (5

More information

TUTORIAL #2 HIERARCHICAL DESIGNS AND TEST FIXTURES

TUTORIAL #2 HIERARCHICAL DESIGNS AND TEST FIXTURES Introduction to Active-HDL TUTORIAL #2 HIERARCHICAL DESIGNS AND TEST FIXTURES This tutorial will use the 1-bit full adder you designed in Tutorial #1 to construct larger adders. This will introduce the

More information

Step 1 in transitioning to behavioral modeling. But here 1-to-1 with our gate level model.

Step 1 in transitioning to behavioral modeling. But here 1-to-1 with our gate level model. Project Step 4 Step 1 in transitioning to behavioral modeling. But here 1-to-1 with our gate level model. Copyright 2006 - Joanne DeGroat, ECE, OSU 1 Project Step 4 This is the start of the transition

More information

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

Speaker: Shao-Wei Feng Adviser: Prof. An-Yeu Wu Date: 2010/09/28 99-1 Under-Graduate Project Verilog Simulation & Debugging Tools Speaker: Shao-Wei Feng Adviser: Prof. An-Yeu Wu Date: 2010/09/28 ACCESS IC LAB Outline Basic Concept of Verilog HDL Gate Level Modeling

More information

CENG 241 Digital Design 1

CENG 241 Digital Design 1 CENG 241 Digital Design 1 Lecture 5 Amirali Baniasadi amirali@ece.uvic.ca This Lecture Lab Review of last lecture: Gate-Level Minimization Continue Chapter 3:XOR functions, Hardware Description Language

More information

EECS 3201: Digital Logic Design Lecture 4. Ihab Amer, PhD, SMIEEE, P.Eng.

EECS 3201: Digital Logic Design Lecture 4. Ihab Amer, PhD, SMIEEE, P.Eng. EECS 32: Digital Logic Design Lecture 4 Ihab Amer, PhD, SMIEEE, P.Eng. What is a HDL? A high-level computer language that can describe digital systems in tetual form Two applications of HDL processing:

More information

ECE 353 Lab 3 (Verilog Design Approach)

ECE 353 Lab 3 (Verilog Design Approach) ECE 353 Lab 3 (Verilog Design Approach) Prof Daniel Holcomb Recall What You Will Do Design and implement a serial MIDI receiver Hardware in an Altera Complex Programmable Logic Device (CPLD) MAX 7000S

More information

Hardware Description Language (HDL)

Hardware Description Language (HDL) Hardware Description Language (HDL) What is the need for Hardware Description Language? Model, Represent, And Simulate Digital Hardware Hardware Concurrency Parallel Activity Flow Semantics for Signal

More information

Adders (A) Young Won Lim 10/7/13

Adders (A) Young Won Lim 10/7/13 Adders (A) /7/3 Copyright (c) 2-23 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version.2 or any later version

More information

The University of Alabama in Huntsville ECE Department CPE Final Exam April 28, 2016

The University of Alabama in Huntsville ECE Department CPE Final Exam April 28, 2016 The University of Alabama in Huntsville ECE Department CPE 426 01 Final Exam April 28, 2016 Name: 1. (6 points) Draw the transistor-level diagram of a two input CMOS NAND gate. 2. (5 points) If the NRE

More information

EEC 116 Fall 2011 Lab #3: Digital Simulation Tutorial

EEC 116 Fall 2011 Lab #3: Digital Simulation Tutorial EEC 116 Fall 2011 Lab #3: Digital Simulation Tutorial Dept. of Electrical and Computer Engineering University of California, Davis Issued: October 10, 2011 Due: October 19, 2011, 4PM Reading: Rabaey Insert

More information

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

N-input EX-NOR gate. N-output inverter. N-input NOR gate Hardware Description Language HDL Introduction HDL is a hardware description language used to design and document electronic systems. HDL allows designers to design at various levels of abstraction. It

More information

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 1

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 1 DIGITAL LOGIC WITH VHDL (Fall 23) Unit DESIGN FLOW DATA TYPES LOGIC GATES WITH VHDL TESTBENCH GENERATION DESIGN FLOW Design Entry: We specify the logic circuit using a Hardware Description Language (e.g.,

More information

ARM 64-bit Register File

ARM 64-bit Register File ARM 64-bit Register File Introduction: In this class we will develop and simulate a simple, pipelined ARM microprocessor. Labs #1 & #2 build some basic components of the processor, then labs #3 and #4

More information

VERILOG 6: DECODER DESIGN EXAMPLES

VERILOG 6: DECODER DESIGN EXAMPLES VERILOG 6: DECODER DESIGN EXAMPLES Decoder A decoder with i inputs and fully-populated outputs has 2 i outputs It is generally better to work with both the input and output as buses rather than individual

More information

101-1 Under-Graduate Project Digital IC Design Flow

101-1 Under-Graduate Project Digital IC Design Flow 101-1 Under-Graduate Project Digital IC Design Flow Speaker: Ming-Chun Hsiao Adviser: Prof. An-Yeu Wu Date: 2012/9/25 ACCESS IC LAB Outline Introduction to Integrated Circuit IC Design Flow Verilog HDL

More information

14:332:231 DIGITAL LOGIC DESIGN. Verilog Functions and Tasks

14:332:231 DIGITAL LOGIC DESIGN. Verilog Functions and Tasks 4:332:23 DIGITAL LOGIC DESIGN Ivan Marsic, Rutgers University Electrical & Computer Engineering Fall 203 Lecture #24: Verilog Time Dimension and Test Benches Verilog Functions and Tasks Verilog function

More information

Behavioral Modeling and Timing Constraints

Behavioral Modeling and Timing Constraints Lab Workbook Introduction Behavioral modeling was introduced in Lab 1 as one of three widely used modeling styles. Additional capabilities with respect to testbenches were further introduced in Lab 4.

More information

Functions, Procedures, and Testbenches

Functions, Procedures, and Testbenches Lab Workbook Introduction VHDL lets you define sub-programs using procedures and functions. They are used to improve the readability and to exploit re-usability of VHDL code. Functions are equivalent to

More information

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks.

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks. Outline CPE/EE 422/522 Advanced Logic Design L05 Electrical and Computer Engineering University of Alabama in Huntsville What we know Combinational Networks Sequential Networks: Basic Building Blocks,

More information

ECE 545 Lecture 4. Simple Testbenches. George Mason University

ECE 545 Lecture 4. Simple Testbenches. George Mason University ECE 545 Lecture 4 Simple Testbenches George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 2.2.4, Testbenches 2 Testbenches ECE 448 FPGA and ASIC Design with VHDL 3 Testbench

More information

Digital System Design Verilog-Part III. Amir Masoud Gharehbaghi

Digital System Design Verilog-Part III. Amir Masoud Gharehbaghi Digital System Design Verilog-Part III Amir Masoud Gharehbaghi amgh@mehr.sharif.edu Procedural Blocks initial block always block Place in module body Run concurrently with other module constructs Continuous

More information

C-Based Hardware Design

C-Based Hardware Design LECTURE 6 In this lecture we will introduce: The VHDL Language and its benefits. The VHDL entity Concurrent and Sequential constructs Structural design. Hierarchy Packages Various architectures Examples

More information

Verilog HDL:Digital Design and Modeling. Chapter 3. Keywords

Verilog HDL:Digital Design and Modeling. Chapter 3. Keywords Chapter 3 Keywords 1 Verilog HDL:Digital Design and Modeling Chapter 3 Keywords Chapter 3 Keywords 2 Page 80 //4:1 multiplexer using a //case statement module mux_4_1_case (sel, data, out); input [1:0]

More information

ECEN : Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University. Homework #1 Solutions

ECEN : Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University. Homework #1 Solutions ECEN 449 749: Microprocessor System Design Department of Electrical and Computer Engineering Texas A&M University Homework #1 Solutions Upload your homework solution to ecampus as a single pdf file. Your

More information

Cadence Tutorial 6. Verilog-XL Simulation for Dynamic Logic. EE577b Fall 98

Cadence Tutorial 6. Verilog-XL Simulation for Dynamic Logic. EE577b Fall 98 Cadence Tutorial 6 Verilog-XL Simulation for Dynamic Logic EE577b Fall 98 In this tutorial, I am going to demonstrate how to design and simulate the domino style dynamic logic. 1. Tutorial Setup No previous

More information

EECS150, Fall 2004, Midterm 1, Prof. Culler. Problem 1 (15 points) 1.a. Circle the gate-level circuits that DO NOT implement a Boolean AND function.

EECS150, Fall 2004, Midterm 1, Prof. Culler. Problem 1 (15 points) 1.a. Circle the gate-level circuits that DO NOT implement a Boolean AND function. Problem 1 (15 points) 1.a. Circle the gate-level circuits that DO NOT implement a Boolean AND function. 1.b. Show that a 2-to-1 MUX is universal (i.e. that any Boolean expression can be implemented with

More information

ECE 545 Fall 2014 Midterm Exam

ECE 545 Fall 2014 Midterm Exam ECE 545 Fall 2014 Midterm Exam Problem 1 [10 points] Draw a block diagram of a simple microprocessor system, composed of A. Microprocessor, with the bidirectional input/output DATA (8-bits), and outputs

More information

Hardware description languages

Hardware description languages Specifying digital circuits Schematics (what we ve done so far) Structural description Describe circuit as interconnected elements Build complex circuits using hierarchy Large circuits are unreadable Hardware

More information

Laboratory Exercise #6 Introduction to Logic Simulation and Verilog

Laboratory Exercise #6 Introduction to Logic Simulation and Verilog Laboratory Exercise #6 Introduction to Logic Simulation and Verilog ECEN 248: Introduction to Digital Design Department of Electrical and Computer Engineering Texas A&M University 2 Laboratory Exercise

More information

The Verilog Language COMS W Prof. Stephen A. Edwards Fall 2002 Columbia University Department of Computer Science

The Verilog Language COMS W Prof. Stephen A. Edwards Fall 2002 Columbia University Department of Computer Science The Verilog Language COMS W4995-02 Prof. Stephen A. Edwards Fall 2002 Columbia University Department of Computer Science The Verilog Language Originally a modeling language for a very efficient event-driven

More information

Verilog Tutorial (Structure, Test)

Verilog Tutorial (Structure, Test) Digital Circuit Design and Language Verilog Tutorial (Structure, Test) Chang, Ik Joon Kyunghee University Hierarchical Design Top-down Design Methodology Bottom-up Design Methodology Module START Example)

More information

HDL for Combinational Circuits. ENEL211 Digital Technology

HDL for Combinational Circuits. ENEL211 Digital Technology HDL for Combinational Circuits ENEL211 Digital Technology Lecture Outline Vectors Modular design Tri-state gates Dataflow modelling Behavioural Modelling Vectors Often we want multi-bit quantities in digital

More information

Lab 7 (All Sections) Prelab: Verilog Review and ALU Datapath and Control

Lab 7 (All Sections) Prelab: Verilog Review and ALU Datapath and Control Lab 7 (All Sections) Prelab: Verilog Review and ALU Datapath and Control Name: Sign the following statement: On my honor, as an Aggie, I have neither given nor received unauthorized aid on this academic

More information

PART I BASIC DIGITAL CIRCUITS

PART I BASIC DIGITAL CIRCUITS PART I BASIC DIGITAL CIRCUITS CHAPTER 1 GATE-LEVEL COMBINATIONAL CIRCUIT 1.1 INTRODUCTION VHDL stands for VHSIC (very high-speed integrated circuit) hardware description language. It was originally sponsored

More information

EGC220 - Digital Logic Fundamentals

EGC220 - Digital Logic Fundamentals EGC220 - Digital Logic Fundamentals VERILOG Hardware Description Language - 1 Hardware description language is a text based programming language that is used to model a piece of hardware. VERILOG is a

More information

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

Department of Computer Science and Electrical Engineering. Intro to Verilog II Department of Computer Science and Electrical Engineering Intro to Verilog II http://6004.csail.mit.edu/6.371/handouts/l0{2,3,4}.pdf http://www.asic-world.com/verilog/ http://www.verilogtutorial.info/

More information

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI DEPARTMENT: ECE MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI 621213 QUESTION BANK SUBJECT NAME: DIGITAL ELECTRONICS SEMESTER III SUBJECT CODE: EC2203 UNIT 5 : Synchronous and Asynchronous Sequential

More information

Software Engineering 2DA4. Slides 2: Introduction to Logic Circuits

Software Engineering 2DA4. Slides 2: Introduction to Logic Circuits Software Engineering 2DA4 Slides 2: Introduction to Logic Circuits Dr. Ryan Leduc Department of Computing and Software McMaster University Material based on S. Brown and Z. Vranesic, Fundamentals of Digital

More information

EEL 4783: HDL in Digital System Design

EEL 4783: HDL in Digital System Design EEL 4783: HDL in Digital System Design Lecture 1: Introduction* Prof. Mingjie Lin 1 Overview What is an digital embedded system? Why HDL (Hardware Description Language)? Why take this course? Class mechanics

More information

Verilog Design Entry, Synthesis, and Behavioral Simulation

Verilog Design Entry, Synthesis, and Behavioral Simulation ------------------------------------------------------------- PURPOSE - This lab will present a brief overview of a typical design flow and then will start to walk you through some typical tasks and familiarize

More information

EE 330 Spring Laboratory 2: Basic Boolean Circuits

EE 330 Spring Laboratory 2: Basic Boolean Circuits EE 330 Spring 2013 Laboratory 2: Basic Boolean Circuits Objective: The objective of this experiment is to investigate methods for evaluating the performance of Boolean circuits. Emphasis will be placed

More information

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

EE 8351 Digital Logic Circuits Ms.J.Jayaudhaya, ASP/EEE EE 8351 Digital Logic Circuits Ms.J.Jayaudhaya, ASP/EEE 1 Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables, logic gates, and output

More information

ENGR 3410: Lab #1 MIPS 32-bit Register File

ENGR 3410: Lab #1 MIPS 32-bit Register File ENGR 3410: Lab #1 MIPS 32-bit Register File Due: October 12, 2005, beginning of class 1 Introduction The purpose of this lab is to create the first large component of our MIPS-style microprocessor the

More information

Chap 6 Introduction to HDL (d)

Chap 6 Introduction to HDL (d) Design with Verilog Chap 6 Introduction to HDL (d) Credit to: MD Rizal Othman Faculty of Electrical & Electronics Engineering Universiti Malaysia Pahang Ext: 6036 VERILOG HDL Basic Unit A module Module

More information

CS61C: Verilog Tutorial

CS61C: Verilog Tutorial CS61C: Verilog Tutorial Original document by J. Wawrzynek (2003-11-17) Revised by Chris Sears and Dan Garcia (2004-04-26) 1 Introduction There are several key reasons why we use hardware description languages

More information

271/471 Verilog Tutorial

271/471 Verilog Tutorial 271/471 Verilog Tutorial Prof. Scott Hauck, last revised 9/15/14 Introduction The following tutorial is inted to get you going quickly in circuit design in Verilog. It isn t a comprehensive guide to System

More information

A Brief Introduction to Verilog Hardware Definition Language (HDL)

A Brief Introduction to Verilog Hardware Definition Language (HDL) www.realdigital.org A Brief Introduction to Verilog Hardware Definition Language (HDL) Forward Verilog is a Hardware Description language (HDL) that is used to define the structure and/or behavior of digital

More information

Brief Introduction to Verilog HDL (Part 1)

Brief Introduction to Verilog HDL (Part 1) BUDAPEST UNIVERSITY OF TECHNOLOGY AND ECONOMICS FACULTY OF ELECTRICAL ENGINEERING AND INFORMATICS DEPARTMENT OF MEASUREMENT AND INFORMATION SYSTEMS Brief Introduction to Verilog HDL (Part 1) Tamás Raikovich

More information

CAD for VLSI Design - I. Lecture 21 V. Kamakoti and Shankar Balachandran

CAD for VLSI Design - I. Lecture 21 V. Kamakoti and Shankar Balachandran CAD for VLSI Design - I Lecture 21 V. Kamakoti and Shankar Balachandran Overview of this Lecture Understanding the process of Logic synthesis Logic Synthesis of HDL constructs Logic Synthesis What is this?

More information

Chapter 3 working with combinational logic

Chapter 3 working with combinational logic hapter 3 working with combinational logic ombinational Logic opyright 24, Gaetano orriello and Randy H. Katz Working with combinational logic Simplification two-level simplification exploiting don t cares

More information

TUTORIAL II ECE 555 / 755 Updated on September 11 th 2006 CADENCE LAYOUT AND PARASITIC EXTRACTION

TUTORIAL II ECE 555 / 755 Updated on September 11 th 2006 CADENCE LAYOUT AND PARASITIC EXTRACTION TUTORIAL II ECE 555 / 755 Updated on September 11 th 2006 CADENCE LAYOUT AND PARASITIC EXTRACTION After finishing a schematic of your design (Tutorial-I), the next step is creating masks which are for

More information

ECE 353 Lab 4. Verilog Review. Professor Daniel Holcomb UMass Amherst Fall 2017

ECE 353 Lab 4. Verilog Review. Professor Daniel Holcomb UMass Amherst Fall 2017 ECE 353 Lab 4 Verilog Review Professor Daniel Holcomb UMass Amherst Fall 2017 What You Will Do In Lab 4 Design and implement a serial MIDI receiver Hardware in an Altera Complex Programmable Logic Device

More information

ECE 4514 Digital Design II. Spring Lecture 20: Timing Analysis and Timed Simulation

ECE 4514 Digital Design II. Spring Lecture 20: Timing Analysis and Timed Simulation ECE 4514 Digital Design II Lecture 20: Timing Analysis and Timed Simulation A Tools/Methods Lecture Topics Static and Dynamic Timing Analysis Static Timing Analysis Delay Model Path Delay False Paths Timing

More information

Tutorial on Verilog HDL

Tutorial on Verilog HDL Tutorial on Verilog HDL HDL Hardware Description Languages Widely used in logic design Verilog and VHDL Describe hardware using code Document logic functions Simulate logic before building Synthesize code

More information

Design Using Verilog

Design Using Verilog EGC220 Design Using Verilog Baback Izadi Division of Engineering Programs bai@engr.newpaltz.edu Basic Verilog Lexical Convention Lexical convention are close to C++. Comment // to the of the line. /* to

More information

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

Verilog. Reminder: Lab #1 due tonight! Fall 2008 Lecture 3 Verilog Hardware Description Languages Verilog -- structural: modules, instances -- dataflow: continuous assignment -- sequential behavior: always blocks -- pitfalls -- other useful features Reminder:

More information

Hardware Modeling. VHDL Architectures. Vienna University of Technology Department of Computer Engineering ECS Group

Hardware Modeling. VHDL Architectures. Vienna University of Technology Department of Computer Engineering ECS Group Hardware Modeling VHDL Architectures Vienna University of Technology Department of Computer Engineering ECS Group Contents Structural Modeling Instantiation of Components Behavioral Modeling Processes

More information

CSE 2021 Computer Organization. The Basics of Logic Design

CSE 2021 Computer Organization. The Basics of Logic Design CSE 2021 Computer Organization Appendix C The Basics of Logic Design Outline Fundamental Boolean operations Deriving logic expressions from truth tables Boolean Identities Simplifying logic expressions

More information

LSN 1 Digital Design Flow for PLDs

LSN 1 Digital Design Flow for PLDs LSN 1 Digital Design Flow for PLDs ECT357 Microprocessors I Department of Engineering Technology LSN 1 Programmable Logic Devices Functionless devices in base form Require programming to operate The logic

More information

Tutorial 3. Appendix D. D.1 Design Using Verilog Code. The Ripple-Carry Adder Code. Functional Simulation

Tutorial 3. Appendix D. D.1 Design Using Verilog Code. The Ripple-Carry Adder Code. Functional Simulation Appendix D Tutorial 3 This tutorial introduces more advanced capabilities of the Quartus II system. We show how Verilog code is organized and compiled and illustrate how multibit signals are represented

More information

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

Spiral 1 / Unit 4 Verilog HDL. Digital Circuit Design Steps. Digital Circuit Design OVERVIEW. Mark Redekopp. Description. Verification. 1-4.1 1-4.2 Spiral 1 / Unit 4 Verilog HDL Mark Redekopp OVERVIEW 1-4.3 1-4.4 Digital Circuit Design Steps Digital Circuit Design Description Design and computer-entry of circuit Verification Input Stimulus

More information

Lab 6 : Introduction to Verilog

Lab 6 : Introduction to Verilog Lab 6 : Introduction to Verilog Name: Sign the following statement: On my honor, as an Aggie, I have neither given nor received unauthorized aid on this academic work 1 Objective The main objective of

More information

One and a half hours. Section A is COMPULSORY

One and a half hours. Section A is COMPULSORY One and a half hours Section A is COMPULSORY An additional answersheet is provided for Question 4. Please remember to complete the additional answersheet with your University ID number and attach it to

More information