VERILOG HDL. 1 ENGN3213: Digital Systems and Microprocessors L#5-6

Size: px
Start display at page:

Download "VERILOG HDL. 1 ENGN3213: Digital Systems and Microprocessors L#5-6"

Transcription

1 VERILOG HDL 1 ENGN3213: Digital Systems and Microprocessors L#5-6

2 Some Reference Material (mostly advanced) \vspace{10mm} VerilogIntro SASAKI.pdf - Very simple introduction which emphasises the ground rules for good coding style coding and synthesis with verilog OREGAN.pdf - explains ways to build some common circuits 2 ENGN3213: Digital Systems and Microprocessors L#5-6

3 Ways to represent hardware Schematics Use Hardware Description Language 3 ENGN3213: Digital Systems and Microprocessors L#5-6

4 What are Hardware Description Languages (HDLs)? Textual representation of a logic design but has various levels of abstraction Not programming languages YOU MUST THINK DIFFERENTLY Similar development chain Compiler assembly code binary machine code Synthesis tool: HDL source gate-level specification hardware 4 ENGN3213: Digital Systems and Microprocessors L#5-6

5 Why use HDLs? Easier to make system abstractions (VIZ the combinational and sequential logic abstractions) Easy to write and edit Compact Don t have to follow wires on a schematic Easy to analyse Why not to use an HDL To avoid understanding the hardware A schematic can be a complex work of art 5 ENGN3213: Digital Systems and Microprocessors L#5-6

6 HDL HIstory 1970s: First HDLs Late 1970s: VHDL VHDL = VHSIC HDL = Very High Speed Integrated Circuit HDL VHDL inspired by programming languages of the day (Ada) 1980s: Verilog first introduced Verilog inspired by the C programming language VHDL standardized s: Verilog standardized (Verilog-1995 standard) Continued evolution (Verilog-2001 standard) ICARUS Verilog needs plenty of Verilog-2001 compliance - work in 6 ENGN3213: Digital Systems and Microprocessors L#5-6

7 About Verilog... A surprisingly big language lots of features for simulation and synthesis of hardware. We are going to learn a focussed subset of VERILOG Focus on synthesisable constructs Initially restrict some features just because they are not necessary If you haven t seen it in lectures, ask me before you use it 7 ENGN3213: Digital Systems and Microprocessors L#5-6

8 Why an HDL is not a Programming Language In a program, we start at the beginning (e.g. main ), and we proceed sequentially through the code as directed The program represents an algorithm, a step-by-step sequence of actions to solve some problem... for (i = 0; i<10; i=i+1) { if (newpattern == oldpattern[i]) match = i; }... Hardware is all active at once; there is no starting point... Y = X; Z = Y;... 8 ENGN3213: Digital Systems and Microprocessors L#5-6

9 A Block Schematic 9 ENGN3213: Digital Systems and Microprocessors L#5-6

10 Verilog Program Structure 10 ENGN3213: Digital Systems and Microprocessors L#5-6

11 What do you really have to know to understand and use VERILOG? VERILOG can be for SYNTHESIS or for SIMULATION: you must learn to distinguish them SYNTHESISABLE VERILOG runs CONCURRENTLY in hardware VERILOG has some basic properties: 1. COMBINATIONAL vs SEQUENTIAL 2. WIRES vs REGS (not important but basic) 11 ENGN3213: Digital Systems and Microprocessors L#5-6

12 What are the usual problems of VERILOG that you need to look out for? You are breaking with the COMBINATIONAL / SEQUENTIAL paradigm Your code is poorly synthesisable: Two ways: 1. You are using simulation-only constructs in your code for synthesis. 2. YOUR CODE IS FOR SYNTHESIS BUT TRANSLATES BADLY INTO HARDWARE - THE USUAL PROBLEM 12 ENGN3213: Digital Systems and Microprocessors L#5-6

13 WIRES and REGS Variables in VERILOG are either WIRES or REGS Neither of these is like a variable in C WIRES A WIRE is a through-connection within or to a module. The input and output ports are WIREs. ASSIGNS assign to WIRES REGS The combinational and sequential paradigms in terms of ALWAYS blocks imply a persistance to the variables they assign to Example: the variables on the left hand sign of statements inside ALWAYS blocks are REGS REGS have persistance and store VALUES from one event to the next REGS are not registers in the electronic sense 13 ENGN3213: Digital Systems and Microprocessors L#5-6

14 WIRES and REGS Circuit Schematic VERILOG Value: V = 8 h1a WIRE Component REG: V = 8 h1a WIRE Module 14 ENGN3213: Digital Systems and Microprocessors L#5-6

15 Modelling sequential and combinational circuits 15 ENGN3213: Digital Systems and Microprocessors L#5-6

16 VERILOG by example: MULTIPLEXER (combinational) module mux(sel, a, b, c); input a; input b; input sel; output c; reg c; or b or sel) if (sel == 1 b1) c = a; else c = b; // c = sel? a : b; endmodule a b c Sel 16 ENGN3213: Digital Systems and Microprocessors L#5-6

17 VERILOG by example: D-type Flip Flop (sequential) module dff(clk, d, q); input clk; input d; output q; reg q; clk) q <= d; endmodule d clk q 17 ENGN3213: Digital Systems and Microprocessors L#5-6

18 ASSIGNS... an alternative construct for treating SIMPLE combinational circuits module inv(a, y); input [3:0] a; output [3:0] y; assign y = a; endmodule module and8(a, y); input [7:0] a; output y; assign y = &a; endmodule; 18 ENGN3213: Digital Systems and Microprocessors L#5-6

19 Tristate Buffers Tristate buffers are multiplexers that have the possibility of producing an open circuit output Bus open circuit tristate tristate tristate 19 ENGN3213: Digital Systems and Microprocessors L#5-6

20 Tristate Buffers module tristate(a, en, y); input [3:0] a; input en; output [3:0] y; assign y = en? a : 4 bz; endmodule module mux2(d0, d1, s, y); input [3:0] d0, d1; input s; output [3:0] y; tristate t0(d0, s, y); tristate t1(d1, s, y); endmodule //Instantiation -> hierarchical //Instantiation -> hierarchical 20 ENGN3213: Digital Systems and Microprocessors L#5-6

21 Combinational logic // // Using a reg wire a,b; reg c; (a or b) c = a & b; // // Using a wire wire a,b,c; assign c = a & b; // // using a built in primitive (without instance name) reg a,b; wire c; and(c,a,b); // output is always first in the list // // using a built in primitive (with instance name) reg a,b; wire c; and u1(c,a,b); // output is always first in the list 21 ENGN3213: Digital Systems and Microprocessors L#5-6

22 Top module: Ledflasher module ledflash(clk,leds); input clk; output [7:0] LEDS; reg [23:0] counter; reg [7:0] LEDS; //A counter... clk) counter<=counter+24 b1; clk) begin if(counter[23]) LEDS[0] <= 1; else LEDS[0] <= 0; if(counter[22]) LEDS[1] <= 1; else LEDS[1] <= 0; if(counter[21]) LEDS[2] <= 1; else LEDS[2] <= 0; if(counter[20]) LEDS[3] <= 1; else LEDS[3] <= 0; if(counter[19]) LEDS[4] <= 1; else LEDS[4] <= 0; if(counter[18]) LEDS[5] <= 1; else LEDS[5] <= 0; if(counter[17]) LEDS[6] <= 1; else LEDS[6] <= 0; if(counter[16]) LEDS[7] <= 1; else LEDS[7] <= 0; end endmodule 22 ENGN3213: Digital Systems and Microprocessors L#5-6

23 Top module: UCF file NET "clk" LOC = "C9" ; NET "LEDS[0]" LOC = "F12" IOSTANDARD = LVTTL SLEW = SLOW DRIVE = 8 ; NET "LEDS[1]" LOC = "E12" IOSTANDARD = LVTTL SLEW = SLOW DRIVE = 8 ; NET "LEDS[2]" LOC = "E11" IOSTANDARD = LVTTL SLEW = SLOW DRIVE = 8 ; NET "LEDS[3]" LOC = "F11" IOSTANDARD = LVTTL SLEW = SLOW DRIVE = 8 ; NET "LEDS[4]" LOC = "C11" IOSTANDARD = LVTTL SLEW = SLOW DRIVE = 8 ; NET "LEDS[5]" LOC = "D11" IOSTANDARD = LVTTL SLEW = SLOW DRIVE = 8 ; NET "LEDS[6]" LOC = "E9" IOSTANDARD = LVTTL SLEW = SLOW DRIVE = 8 ; NET "LEDS[7]" LOC = "F9" IOSTANDARD = LVTTL SLEW = SLOW DRIVE = 8 ; 23 ENGN3213: Digital Systems and Microprocessors L#5-6

24 Example: Counter module cntr_3bit( clk, rst, count); input clk; input rst; wire rst; parameter zero = 4 b0000; parameter one = 4 b0001; output [3:0] count; reg [3:0] count; clk or rst) begin end if (rst) begin count <= zero; end else begin count <= count + one; end endmodule 24 ENGN3213: Digital Systems and Microprocessors L#5-6

25 Example: Counter: test bench module TB_cntr_3bit; reg clk; reg rst; wire [3:0] cnt; cntr_3bit c3b(clk, rst, cnt); initial begin clk = 0; rst = 1; #1rst = 0; $display("\t\t time \t clk \t rst \t count"); forever #2 clk = clk; end initial begin $dumpfile("cntr_3bit.vcd"); $dumpvars; end initial begin: stopat #100; $finish; end clk) begin $display("%d\t %b \t %b \t %b",$time,clk, rst, cnt); end endmodule 25 ENGN3213: Digital Systems and Microprocessors L#5-6

26 Example: Counter counter]$ more cmp.sh iverilog cntr_3bit.v TB_cntr_3bit.v./a.out gtkwave cntr_3bit.vcd lecture5_and_6_verilog]$ sh cmp.sh VCD info: dumpfile cntr_3bit.vcd opened for output. time clk rst count ENGN3213: Digital Systems and Microprocessors L#5-6

27 Example: Counter 27 ENGN3213: Digital Systems and Microprocessors L#5-6

28 Design technique 1: Combinational Datapath Outputs determined instantaneously from the inputs Fastest response time large area consumption e.g LUTs 28 ENGN3213: Digital Systems and Microprocessors L#5-6

29 Design technique 2: Bit Serial Datapath Output bitstream produced synchronously with serial input bit streams. Low silicon area consumption E.g. Anlogue time serial systems - filters (convolution) Input data stream Processor Output data stream Clk 29 ENGN3213: Digital Systems and Microprocessors L#5-6

30 Block Schematic - 4-bit adder Z[4] X[3] Cout Y[3] Cin Z[3] C2 X[2] Cout Y[2] Cin Z[2] C1 X[1] Cout Y[1] Cin Z[1] Co X[0] Cout Y[0] Cin Z[0] 30 ENGN3213: Digital Systems and Microprocessors L#5-6

31 Top module - 4-bit adder module add4(x, Y, Z); input [3:0] X; input [3:0] Y; output [4:0] Z; wire Co, C1, C2; add1 a1(x[0], Y[0], 1 b0, Z[0], Co); add1 a2(x[1], Y[1], Co, Z[1], C1); add1 a3(x[2], Y[2], C1, Z[2], C2); add1 a4(x[3], Y[3], C2, Z[3], Z[4]); endmodule 31 ENGN3213: Digital Systems and Microprocessors L#5-6

32 1 bit full adder module add1(x, Y, Cin, Z, Cout); input X; input Y; input Cin; output Z; output Cout; reg Z; reg Cout; Y, Cin) begin Z =???; Cout =???: end endmodule 32 ENGN3213: Digital Systems and Microprocessors L#5-6

33 Four bit adder - output 33 ENGN3213: Digital Systems and Microprocessors L#5-6

34 Block Schematic - bit serial adder X Rst Z Y Cin Carry logic Cout 1-bit Delay Clk D Flip Flop 34 ENGN3213: Digital Systems and Microprocessors L#5-6

35 bit serial adder module bs_adder( clk, rst, X, Y, Z); input clk; input rst; input X; input Y; wire rst; reg Cin; wire Cout; output Z; reg Z; assign Cout =???; clk or rst) begin if (rst) begin Z <= 1 b0; Cin <= 1 b0; end else begin Z <=???; Cin <= Cout; end end endmodule 35 ENGN3213: Digital Systems and Microprocessors L#5-6

36 bit serial adder - output 36 ENGN3213: Digital Systems and Microprocessors L#5-6

37 Pitfalls of Treating Verilog like a Programming Language If you program sequentially, the synthesiser may add a lot of hardware to try to do what you say If you program in parallel (multiple always blocks), you can get non-deterministic execution - Which always happens first? if(x == 1) out = 0; if(y == 1) out = 1;// else out retains previous state? R-S latch! You don t realize how much hardware you re specifying e.g. x = x + 1 can be a LOT of hardware Slight changes may suddenly make your code blow up. A chip that previously fit suddenly is too large or slow 37 ENGN3213: Digital Systems and Microprocessors L#5-6

38 Structural vs Behavioral HDL Constructs Structural constructs specify actual hardware structures Low-level, direct correspondence to hardware Primitive gates (e.g., and, or, not) Hierarchical structures via modules Behavioural constructs specify an operation on bits High-level, more abstract Specified via equations, e.g. out = (a&b) c Not all behavioural constructs are synthesisable We ve already talked about the pitfalls of trying to program But even some combinational logic won t synthesise well out = a%b //modulo operation-what does this synthesise to? The following are discouraged for synthesis: %... <... <=... <... <=... <<... >> 38 ENGN3213: Digital Systems and Microprocessors L#5-6

VERILOG HDL. (and C) 1 ENGN3213: Digital Systems and Microprocessors L#5-6

VERILOG HDL. (and C) 1 ENGN3213: Digital Systems and Microprocessors L#5-6 VERILOG HDL (and C) 1 ENGN3213: Digital Systems and Microprocessors L#5-6 Some Reference Material The following are suggested reading.. http://engnet.anu.edu.au/decourses/engn3213/documents/verilog/ VerilogIntro.pdf

More information

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

Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design Verilog What is Verilog? Hardware description language: Are used to describe digital system in text form Used for modeling, simulation, design Two major languages Verilog (IEEE 1364), latest version is

More information

Verilog For Computer Design

Verilog For Computer Design Overview Verilog For Computer Design CS/ECE 552 Karu Sankaralingam Based on slides from Derek Hower (UW-Madison), Andy Phelphs (UW-Madison) and Prof. Milo Martin(University of Pennsylvania) Why Verilog?

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

ENGN3213. Digital Systems & Microprocessors. CLAB 1: ICARUS Verilog and ISE WebPACK

ENGN3213. Digital Systems & Microprocessors. CLAB 1: ICARUS Verilog and ISE WebPACK Department of Engineering Australian National University ENGN3213 Digital Systems & Microprocessors CLAB 1: ICARUS Verilog and ISE WebPACK V3.0 Copyright 2010 G.G. Borg ANU Engineering 1 Contents 1 CLAB1:

More information

Digital Design with FPGAs. By Neeraj Kulkarni

Digital Design with FPGAs. By Neeraj Kulkarni Digital Design with FPGAs By Neeraj Kulkarni Some Basic Electronics Basic Elements: Gates: And, Or, Nor, Nand, Xor.. Memory elements: Flip Flops, Registers.. Techniques to design a circuit using basic

More information

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

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1 FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1 Anurag Dwivedi Digital Design : Bottom Up Approach Basic Block - Gates Digital Design : Bottom Up Approach Gates -> Flip Flops Digital

More information

structure syntax different levels of abstraction

structure syntax different levels of abstraction This and the next lectures are about Verilog HDL, which, together with another language VHDL, are the most popular hardware languages used in industry. Verilog is only a tool; this course is about digital

More information

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

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 This and the next lectures are about Verilog HDL, which, together with another language VHDL, are the most popular hardware languages used in industry. Verilog is only a tool; this course is about 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 15: Logic Synthesis with Verilog Prof. Mingjie Lin 1 Verilog Synthesis Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for

More information

EECS150 - Digital Design Lecture 10 Logic Synthesis

EECS150 - Digital Design Lecture 10 Logic Synthesis EECS150 - Digital Design Lecture 10 Logic Synthesis February 13, 2003 John Wawrzynek Spring 2003 EECS150 Lec8-synthesis Page 1 Logic Synthesis Verilog and VHDL started out as simulation languages, but

More information

EECS150 - Digital Design Lecture 10 Logic Synthesis

EECS150 - Digital Design Lecture 10 Logic Synthesis EECS150 - Digital Design Lecture 10 Logic Synthesis September 26, 2002 John Wawrzynek Fall 2002 EECS150 Lec10-synthesis Page 1 Logic Synthesis Verilog and VHDL stated out as simulation languages, but quickly

More information

CSE140L: Components and Design Techniques for Digital Systems Lab

CSE140L: Components and Design Techniques for Digital Systems Lab CSE140L: Components and Design Techniques for Digital Systems Lab Tajana Simunic Rosing Source: Vahid, Katz, Culler 1 Announcements & Outline Lab 4 due; demo signup times listed on the cse140l site Check

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

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

CSE140L: Components and Design

CSE140L: Components and Design CSE140L: Components and Design Techniques for Digital Systems Lab Tajana Simunic Rosing Source: Vahid, Katz, Culler 1 Grade distribution: 70% Labs 35% Lab 4 30% Lab 3 20% Lab 2 15% Lab 1 30% Final exam

More information

Synthesizable Verilog

Synthesizable Verilog Synthesizable Verilog Courtesy of Dr. Edwards@Columbia, and Dr. Franzon@NCSU http://csce.uark.edu +1 (479) 575-6043 yrpeng@uark.edu Design Methodology Structure and Function (Behavior) of a Design HDL

More information

Introduction to Verilog HDL. Verilog 1

Introduction to Verilog HDL. Verilog 1 Introduction to HDL Hardware Description Language (HDL) High-Level Programming Language Special constructs to model microelectronic circuits Describe the operation of a circuit at various levels of abstraction

More information

Synthesis of Combinational and Sequential Circuits with Verilog

Synthesis of Combinational and Sequential Circuits with Verilog Synthesis of Combinational and Sequential Circuits with Verilog What is Verilog? Hardware description language: Are used to describe digital system in text form Used for modeling, simulation, design Two

More information

Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for best synthesis. Spring 2007 Lec #8 -- HW Synthesis 1

Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for best synthesis. Spring 2007 Lec #8 -- HW Synthesis 1 Verilog Synthesis Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for best synthesis Spring 2007 Lec #8 -- HW Synthesis 1 Logic Synthesis Verilog and VHDL started out

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

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

What is Verilog HDL? Lecture 1: Verilog HDL Introduction. Basic Design Methodology. What is VHDL? Requirements What is Verilog HDL? Lecture 1: Verilog HDL Introduction Verilog Hardware Description Language(HDL)? A high-level computer language can model, represent and simulate digital design Hardware concurrency

More information

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

FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language. Reference: [1] FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language Reference: [] FIELD PROGRAMMABLE GATE ARRAY FPGA is a hardware logic device that is programmable Logic functions may be programmed

More information

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis Logic Synthesis Verilog and VHDL started out as simulation languages, but quickly people wrote programs to automatically convert Verilog code into low-level circuit descriptions (netlists). EECS150 - Digital

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 1 - Fundamentals

Verilog 1 - Fundamentals Verilog 1 - Fundamentals FA FA FA FA module adder( input [3:0] A, B, output cout, output [3:0] S ); wire c0, c1, c2; FA fa0( A[0], B[0], 1 b0, c0, S[0] ); FA fa1( A[1], B[1], c0, c1, S[1] ); FA fa2( A[2],

More information

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering Verilog Fundamentals Shubham Singh Junior Undergrad. Electrical Engineering VERILOG FUNDAMENTALS HDLs HISTORY HOW FPGA & VERILOG ARE RELATED CODING IN VERILOG HDLs HISTORY HDL HARDWARE DESCRIPTION LANGUAGE

More information

Verilog 1 - Fundamentals

Verilog 1 - Fundamentals Verilog 1 - Fundamentals FA FA FA FA module adder( input [3:0] A, B, output cout, output [3:0] S ); wire c0, c1, c2; FA fa0( A[0], B[0], 1 b0, c0, S[0] ); FA fa1( A[1], B[1], c0, c1, S[1] ); FA fa2( A[2],

More information

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems EE 3610: Digital Systems 1 Lecture 3: Modeling in VHDL VHDL: Overview 2 VHDL VHSIC Hardware Description Language VHSIC=Very High Speed Integrated Circuit Programming language for modelling of hardware

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

Topics. Midterm Finish Chapter 7

Topics. Midterm Finish Chapter 7 Lecture 9 Topics Midterm Finish Chapter 7 ROM (review) Memory device in which permanent binary information is stored. Example: 32 x 8 ROM Five input lines (2 5 = 32) 32 outputs, each representing a memory

More information

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

Computer Aided Design Basic Syntax Gate Level Modeling Behavioral Modeling. Verilog Verilog Radek Pelánek and Šimon Řeřucha Contents 1 Computer Aided Design 2 Basic Syntax 3 Gate Level Modeling 4 Behavioral Modeling Computer Aided Design Hardware Description Languages (HDL) Verilog C

More information

Topics. Midterm Finish Chapter 7

Topics. Midterm Finish Chapter 7 Lecture 9 Topics Midterm Finish Chapter 7 Xilinx FPGAs Chapter 7 Spartan 3E Architecture Source: Spartan-3E FPGA Family Datasheet CLB Configurable Logic Blocks Each CLB contains four slices Each slice

More information

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

14:332:231 DIGITAL LOGIC DESIGN. Hardware Description Languages 14:332:231 DIGITAL LOGIC DESIGN Ivan Marsic, Rutgers University Electrical & Computer Engineering Fall 2013 Lecture #22: Introduction to Verilog Hardware Description Languages Basic idea: Language constructs

More information

EECS150 - Digital Design Lecture 4 - Verilog Introduction. Outline

EECS150 - Digital Design Lecture 4 - Verilog Introduction. Outline EECS150 - Digital Design Lecture 4 - Verilog Introduction Feb 3, 2009 John Wawrzynek Spring 2009 EECS150 - Lec05-Verilog Page 1 Outline Background and History of Hardware Description Brief Introduction

More information

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis Jan 31, 2012 John Wawrzynek Spring 2012 EECS150 - Lec05-verilog_synth Page 1 Outline Quick review of essentials of state elements Finite State

More information

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design Two HDLs used today Introduction to Structured VLSI Design VHDL I VHDL and Verilog Syntax and ``appearance'' of the two languages are very different Capabilities and scopes are quite similar Both are industrial

More information

Open-Source tools for FPGA development

Open-Source tools for FPGA development October 13, 2016 Marek Vasut Software engineer at DENX S.E. since 2011 Embedded and Real-Time Systems Services, Linux kernel and driver development, U-Boot development, consulting, training Versatile Linux

More information

Outline. EECS Components and Design Techniques for Digital Systems. Lec 11 Putting it all together Where are we now?

Outline. EECS Components and Design Techniques for Digital Systems. Lec 11 Putting it all together Where are we now? Outline EECS 5 - Components and Design Techniques for Digital Systems Lec Putting it all together -5-4 David Culler Electrical Engineering and Computer Sciences University of California Berkeley Top-to-bottom

More information

Programming with HDLs

Programming with HDLs Programming with HDLs Paul Chow February 11, 2008 1 Introduction The purpose of this document is to encourage the proper approach or mindset for programming in a hardware description language (HDL), particularly

More information

VHDL VS VERILOG.

VHDL VS VERILOG. 1 VHDL VS VERILOG http://www.cse.cuhk.edu.hk/~mcyang/teaching.html 2 VHDL & Verilog They are both hardware description languages for modeling hardware. They are each a notation to describe the behavioral

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

Digital Integrated Circuits

Digital Integrated Circuits Digital Integrated Circuits Lecture 4 Jaeyong Chung System-on-Chips (SoC) Laboratory Incheon National University BCD TO EXCESS-3 CODE CONVERTER 0100 0101 +0011 +0011 0111 1000 LSB received first Chung

More information

ECE 4514 Digital Design II. Spring Lecture 15: FSM-based Control

ECE 4514 Digital Design II. Spring Lecture 15: FSM-based Control ECE 4514 Digital Design II Lecture 15: FSM-based Control A Design Lecture Overview Finite State Machines Verilog Mapping: one, two, three always blocks State Encoding User-defined or tool-defined State

More information

Verilog Module 1 Introduction and Combinational Logic

Verilog Module 1 Introduction and Combinational Logic Verilog Module 1 Introduction and Combinational Logic Jim Duckworth ECE Department, WPI 1 Module 1 Verilog background 1983: Gateway Design Automation released Verilog HDL Verilog and simulator 1985: Verilog

More information

VLSI Design 13. Introduction to Verilog

VLSI Design 13. Introduction to Verilog Last module: Sequential circuit design Design styles This module Synthesis Brief introduction to Verilog Synthesis in the Design Flow Designer Tasks Tools Architect Logic Designer Circuit Designer Define

More information

Hardware Description Language VHDL (1) Introduction

Hardware Description Language VHDL (1) Introduction Hardware Description Language VHDL (1) Introduction Digital Radiation Measurement and Spectroscopy NE/RHP 537 Introduction Hardware description language (HDL) Intended to describe circuits textually, for

More information

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

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University Hardware description language (HDL) Intended to describe circuits textually, for a computer to read Evolved starting in the 1970s and 1980s Popular languages today include: VHDL Defined in 1980s by U.S.

More information

Verilog for High Performance

Verilog for High Performance Verilog for High Performance Course Description This course provides all necessary theoretical and practical know-how to write synthesizable HDL code through Verilog standard language. The course goes

More information

Writing Circuit Descriptions 8

Writing Circuit Descriptions 8 8 Writing Circuit Descriptions 8 You can write many logically equivalent descriptions in Verilog to describe a circuit design. However, some descriptions are more efficient than others in terms of the

More information

Unit 5. Hardware description languages

Unit 5. Hardware description languages Unit 5. Hardware description languages Digital Electronic Circuits (Circuitos Electrónicos Digitales) E.T.S.I. Informática Universidad de Sevilla October, 2012 Jorge Juan 2010, 2011,

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

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

TOPIC : Verilog Synthesis examples. Module 4.3 : Verilog synthesis

TOPIC : Verilog Synthesis examples. Module 4.3 : Verilog synthesis TOPIC : Verilog Synthesis examples Module 4.3 : Verilog synthesis Example : 4-bit magnitude comptarator Discuss synthesis of a 4-bit magnitude comparator to understand each step in the synthesis flow.

More information

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University Digital Circuit Design and Language Datapath Design Chang, Ik Joon Kyunghee University Typical Synchronous Design + Control Section : Finite State Machine + Data Section: Adder, Multiplier, Shift Register

More information

Federal Urdu University of Arts, Science and Technology, Islamabad VLSI SYSTEM DESIGN. Prepared By: Engr. Yousaf Hameed.

Federal Urdu University of Arts, Science and Technology, Islamabad VLSI SYSTEM DESIGN. Prepared By: Engr. Yousaf Hameed. VLSI SYSTEM DESIGN Prepared By: Engr. Yousaf Hameed Lab Engineer BASIC ELECTRICAL & DIGITAL SYSTEMS LAB DEPARTMENT OF ELECTRICAL ENGINEERING VLSI System Design 1 LAB 01 Schematic Introduction to DSCH and

More information

Hardware Design Environments. Dr. Mahdi Abbasi Computer Engineering Department Bu-Ali Sina University

Hardware Design Environments. Dr. Mahdi Abbasi Computer Engineering Department Bu-Ali Sina University Hardware Design Environments Dr. Mahdi Abbasi Computer Engineering Department Bu-Ali Sina University Outline Welcome to COE 405 Digital System Design Design Domains and Levels of Abstractions Synthesis

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

Introduction to Verilog HDL

Introduction to Verilog HDL Introduction to Verilog HDL Ben Abdallah Abderazek National University of Electro-communications, Tokyo, Graduate School of information Systems May 2004 04/09/08 1 What you will understand after having

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

Recommended Design Techniques for ECE241 Project Franjo Plavec Department of Electrical and Computer Engineering University of Toronto

Recommended Design Techniques for ECE241 Project Franjo Plavec Department of Electrical and Computer Engineering University of Toronto Recommed Design Techniques for ECE241 Project Franjo Plavec Department of Electrical and Computer Engineering University of Toronto DISCLAIMER: The information contained in this document does NOT contain

More information

Lecture 15: System Modeling and Verilog

Lecture 15: System Modeling and Verilog Lecture 15: System Modeling and Verilog Slides courtesy of Deming Chen Intro. VLSI System Design Outline Outline Modeling Digital Systems Introduction to Verilog HDL Use of Verilog HDL in Synthesis Reading

More information

Hardware Description Languages: Verilog. Quick History of HDLs. Verilog/VHDL. Design Methodology. Verilog Introduction. Verilog.

Hardware Description Languages: Verilog. Quick History of HDLs. Verilog/VHDL. Design Methodology. Verilog Introduction. Verilog. Hardware Description Languages: Verilog Quick History of HDLs Verilog Structural Models (Combinational) Behavioral Models Syntax Examples CS 150 - Fall 2005 - Lecture #4: Verilog - 1 ISP (circa 1977) -

More information

Hardware Description Languages: Verilog

Hardware Description Languages: Verilog Hardware Description Languages: Verilog Verilog Structural Models (Combinational) Behavioral Models Syntax Examples CS 150 - Fall 2005 - Lecture #4: Verilog - 1 Quick History of HDLs ISP (circa 1977) -

More information

ECEN 468 Advanced Logic Design

ECEN 468 Advanced Logic Design ECEN 468 Advanced Logic Design Lecture 28: Synthesis of Language Constructs Synthesis of Nets v An explicitly declared net may be eliminated in synthesis v Primary input and output (ports) are always retained

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

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

Advanced Digital Design Using FPGA. Dr. Shahrokh Abadi

Advanced Digital Design Using FPGA. Dr. Shahrokh Abadi Advanced Digital Design Using FPGA Dr. Shahrokh Abadi 1 Venue Computer Lab: Tuesdays 10 12 am (Fixed) Computer Lab: Wednesday 10-12 am (Every other odd weeks) Note: Due to some unpredicted problems with

More information

תכן חומרה בשפת VERILOG הפקולטה להנדסה

תכן חומרה בשפת VERILOG הפקולטה להנדסה תכן חומרה בשפת VERILOG סמסטר ב' תשע"ג משה דורון מרצה: מתרגלים: אריאל בורג, חג'ג' חן הפקולטה להנדסה 1 Course Topics - Outline Lecture 1 - Introduction Lecture 2 - Lexical conventions Lecture 3 - Data types

More information

EECS150 - Digital Design Lecture 8 - Hardware Description Languages

EECS150 - Digital Design Lecture 8 - Hardware Description Languages EECS150 - Digital Design Lecture 8 - Hardware Description Languages September 19, 2002 John Wawrzynek Fall 2002 EECS150 - Lec08-HDL Page 1 Netlists Design flow What is a HDL? Verilog history examples Outline

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

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language VHDL Introduction to Structured VLSI Design VHDL I Very High Speed Integrated Circuit (VHSIC) Hardware Description Language Joachim Rodrigues A Technology Independent, Standard Hardware description Language

More information

Chapter 4 :: Topics. Introduction. SystemVerilog. Hardware description language (HDL): allows designer to specify logic function only.

Chapter 4 :: Topics. Introduction. SystemVerilog. Hardware description language (HDL): allows designer to specify logic function only. Chapter 4 :: Hardware Description Languages Digital Design and Computer Architecture David Money Harris and Sarah L. Harris Chapter 4 :: Topics Introduction Combinational Logic Structural Modeling Sequential

More information

Outline. EECS150 - Digital Design Lecture 5 - Verilog 2. Structural Model: 2-to1 mux. Structural Model - XOR. Verilog Basics Lots of Examples

Outline. EECS150 - Digital Design Lecture 5 - Verilog 2. Structural Model: 2-to1 mux. Structural Model - XOR. Verilog Basics Lots of Examples Outline EECS150 - Digital Design Lecture 5 - Verilog 2 Verilog Basics Lots of Examples February 1, 2005 John Wawrzynek Spring 2005 EECS150 - Lec05-Verilog2 Page 1 Spring 2005 EECS150 - Lec05-Verilog2 Page

More information

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

Introduction to Verilog design. Design flow (from the book) Introduction to Verilog design Lecture 2 ECE 156A 1 Design flow (from the book) ECE 156A 2 1 Hierarchical Design Chip Modules Cells Primitives A chip contain many modules A module may contain other modules

More information

EE 231 Fall EE 231 Homework 8 Due October 20, 2010

EE 231 Fall EE 231 Homework 8 Due October 20, 2010 EE 231 Homework 8 Due October 20, 20 1. Consider the circuit below. It has three inputs (x and clock), and one output (z). At reset, the circuit starts with the outputs of all flip-flops at 0. x z J Q

More information

Chapter 5 Registers & Counters

Chapter 5 Registers & Counters University of Wisconsin - Madison ECE/Comp Sci 352 Digital Systems Fundamentals Kewal K. Saluja and Yu Hen Hu Spring 2002 Chapter 5 Registers & Counters Originals by: Charles R. Kime Modified for course

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

VHDL for Synthesis. Course Description. Course Duration. Goals

VHDL for Synthesis. Course Description. Course Duration. Goals VHDL for Synthesis Course Description This course provides all necessary theoretical and practical know how to write an efficient synthesizable HDL code through VHDL standard language. The course goes

More information

Speaker: Kayting Adviser: Prof. An-Yeu Wu Date: 2009/11/23

Speaker: Kayting Adviser: Prof. An-Yeu Wu Date: 2009/11/23 98-1 Under-Graduate Project Synthesis of Combinational Logic Speaker: Kayting Adviser: Prof. An-Yeu Wu Date: 2009/11/23 What is synthesis? Outline Behavior Description for Synthesis Write Efficient HDL

More information

Evolution of Implementation Technologies. ECE 4211/5211 Rapid Prototyping with FPGAs. Gate Array Technology (IBM s) Programmable Logic

Evolution of Implementation Technologies. ECE 4211/5211 Rapid Prototyping with FPGAs. Gate Array Technology (IBM s) Programmable Logic ECE 42/52 Rapid Prototyping with FPGAs Dr. Charlie Wang Department of Electrical and Computer Engineering University of Colorado at Colorado Springs Evolution of Implementation Technologies Discrete devices:

More information

PINE TRAINING ACADEMY

PINE TRAINING ACADEMY PINE TRAINING ACADEMY Course Module A d d r e s s D - 5 5 7, G o v i n d p u r a m, G h a z i a b a d, U. P., 2 0 1 0 1 3, I n d i a Digital Logic System Design using Gates/Verilog or VHDL and Implementation

More information

Engin 100 (section 250), Winter 2015, Technical Lecture 3 Page 1 of 5. Use pencil!

Engin 100 (section 250), Winter 2015, Technical Lecture 3 Page 1 of 5. Use pencil! Engin 100 (section 250), Winter 2015, Technical Lecture 3 Page 1 of 5 Use pencil! Last time Introduced basic logic and some terms including bus, word, register and combinational logic. Talked about schematic

More information

Verilog Design Principles

Verilog Design Principles 16 h7fex // 16-bit value, low order 4 bits unknown 8 bxx001100 // 8-bit value, most significant 2 bits unknown. 8 hzz // 8-bit value, all bits high impedance. Verilog Design Principles ECGR2181 Extra Notes

More information

Verilog for Synthesis Ing. Pullini Antonio

Verilog for Synthesis Ing. Pullini Antonio Verilog for Synthesis Ing. Pullini Antonio antonio.pullini@epfl.ch Outline Introduction to Verilog HDL Describing combinational logic Inference of basic combinational blocks Describing sequential circuits

More information

(ii) Simplify and implement the following SOP function using NOR gates:

(ii) Simplify and implement the following SOP function using NOR gates: DHANALAKSHMI COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING EE6301 DIGITAL LOGIC CIRCUITS UNIT I NUMBER SYSTEMS AND DIGITAL LOGIC FAMILIES PART A 1. How can an OR gate be

More information

Lecture 32: SystemVerilog

Lecture 32: SystemVerilog Lecture 32: SystemVerilog Outline SystemVerilog module adder(input logic [31:0] a, input logic [31:0] b, output logic [31:0] y); assign y = a + b; Note that the inputs and outputs are 32-bit busses. 17:

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

FPGA architecture and design technology

FPGA architecture and design technology CE 435 Embedded Systems Spring 2017 FPGA architecture and design technology Nikos Bellas Computer and Communications Engineering Department University of Thessaly 1 FPGA fabric A generic island-style FPGA

More information

ECE 4514 Digital Design II. Spring Lecture 13: Logic Synthesis

ECE 4514 Digital Design II. Spring Lecture 13: Logic Synthesis ECE 4514 Digital Design II A Tools/Methods Lecture Second half of Digital Design II 9 10-Mar-08 L13 (T) Logic Synthesis PJ2 13-Mar-08 L14 (D) FPGA Technology 10 18-Mar-08 No Class (Instructor on Conference)

More information

Course Topics - Outline

Course Topics - Outline Course Topics - Outline Lecture 1 - Introduction Lecture 2 - Lexical conventions Lecture 3 - Data types Lecture 4 - Operators Lecture 5 - Behavioral modeling A Lecture 6 Behavioral modeling B Lecture 7

More information

This Lecture. Some components (useful for the homework) Verilog HDL (will continue next lecture)

This Lecture. Some components (useful for the homework) Verilog HDL (will continue next lecture) Last Lecture The basic component of a digital circuit is the MOS transistor Transistor have instrinsic resistance and capacitance, so voltage values in the circuit take some time to change ( delay ) There

More information

Lecture 2 Hardware Description Language (HDL): VHSIC HDL (VHDL)

Lecture 2 Hardware Description Language (HDL): VHSIC HDL (VHDL) Lecture 2 Hardware Description Language (HDL): VHSIC HDL (VHDL) Pinit Kumhom VLSI Laboratory Dept. of Electronic and Telecommunication Engineering (KMUTT) Faculty of Engineering King Mongkut s University

More information

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad-500 014 Subject: Digital Design Using Verilog Hdl Class : ECE-II Group A (Short Answer Questions) UNIT-I 1 Define verilog HDL? 2 List levels of

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

Two hours - online EXAM PAPER MUST NOT BE REMOVED FROM THE EXAM ROOM UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

Two hours - online EXAM PAPER MUST NOT BE REMOVED FROM THE EXAM ROOM UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE COMP 12111 Two hours - online This paper version is made available as a backup In this event, only MCQ answers written in the boxes on the exam paper will be marked. EXAM PAPER MUST NOT BE REMOVED FROM

More information

Verilog. Verilog for Synthesis

Verilog. Verilog for Synthesis Verilog Verilog for Synthesis 1 Verilog background 1983: Gateway Design Automation released Verilog HDL Verilog and simulator 1985: Verilog enhanced version Verilog-XL 1987: Verilog-XL becoming more popular

More information

Verilog introduction. Embedded and Ambient Systems Lab

Verilog introduction. Embedded and Ambient Systems Lab Verilog introduction Embedded and Ambient Systems Lab Purpose of HDL languages Modeling hardware behavior Large part of these languages can only be used for simulation, not for hardware generation (synthesis)

More information

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

Introduction to Verilog design. Design flow (from the book) Hierarchical Design. Lecture 2 Introduction to Verilog design Lecture 2 ECE 156A 1 Design flow (from the book) ECE 156A 2 Hierarchical Design Chip Modules Cells Primitives A chip contain many modules A module may contain other modules

More information

Finite-State Machine (FSM) Design

Finite-State Machine (FSM) Design 1 Finite-State Machine (FSM) Design FSMs, an important category of sequential circuits, are used frequently in designing digital systems. From the daily used electronic machines to the complex digital

More information