Digital Design with FPGAs. By Neeraj Kulkarni

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

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

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

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

Chap 6 Introduction to HDL (d)

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

Hardware Description Language VHDL (1) Introduction

Nikhil Gupta. FPGA Challenge Takneek 2012

Design Using Verilog

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

Synthesizable Verilog

DIGITAL SYSTEM DESIGN

Introduction to Verilog/System Verilog

FPGA Design Challenge Techkriti Digital Logic Design using Verilog Part 2 By Neeraj Kulkarni

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

ENEE245 Digital Circuits and Systems Lab Manual

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

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

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

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

Digital Integrated Circuits

Writing Circuit Descriptions 8

ENEE245 Digital Circuits and Systems Lab Manual

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

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

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008

C-Based Hardware Design

CS429: Computer Organization and Architecture

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

Injntu.com Injntu.com Injntu.com R16

Synthesis of Language Constructs. 5/10/04 & 5/13/04 Hardware Description Languages and Synthesis

ELCT 501: Digital System Design

ECE 353 Lab 3 (Verilog Design Approach)

DIGITAL SYSTEM DESIGN

Synthesis of Combinational and Sequential Circuits with Verilog

Chapter 3: Dataflow Modeling

Code No: R Set No. 1

ENGN1640: Design of Computing Systems Topic 02: Design/Lab Foundations

Verilog introduction. Embedded and Ambient Systems Lab

ECEN 468 Advanced Logic Design

Lecture 15: System Modeling and Verilog

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

Lecture 32: SystemVerilog

Digital Integrated Circuits

Verilog Hardware Description Language ROOM: B405

Digital Design with SystemVerilog

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

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

HDLs and SystemVerilog. Digital Computer Design

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

Register Transfer Level in Verilog: Part I

Verilog Module 1 Introduction and Combinational Logic

AN INTRODUCTION TO VERILOG HDL

Online Verilog Resources

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

TOPIC : Verilog Synthesis examples. Module 4.3 : Verilog synthesis

ENGN1640: Design of Computing Systems Topic 02: Design/Lab Foundations

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

Register Transfer Level

Lecture #2: Verilog HDL

Lecture 12 VHDL Synthesis

Digital Design (VIMIAA01) Introduction to the Verilog HDL

CSE140L: Components and Design Techniques for Digital Systems Lab

EECS150 - Digital Design Lecture 4 - Verilog Introduction. Outline

Contents. Appendix D Verilog Summary Page 1 of 16

R10. II B. Tech I Semester, Supplementary Examinations, May

CSE140L: Components and Design

Verilog 1 - Fundamentals

Digital Logic Design using Verilog and FPGA devices Part 2. An Introductory Lecture Series By Chirag Sangani

Topics. Midterm Finish Chapter 7

A Brief Introduction to Verilog Hardware Definition Language (HDL)

Department of Computer Science & Engineering. Lab Manual DIGITAL LAB. Class: 2nd yr, 3rd sem SYLLABUS

Introduction to Verilog

Introduction to Verilog HDL. Verilog 1

ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL. Fall 2017 Final Exam (6.00 to 8.30pm) Verilog SOLUTIONS

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

Verilog for Synthesis Ing. Pullini Antonio

CONTENTS CHAPTER 1: NUMBER SYSTEM. Foreword...(vii) Preface... (ix) Acknowledgement... (xi) About the Author...(xxiii)

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

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

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

REGISTER TRANSFER LANGUAGE

Topics of this Slideset. CS429: Computer Organization and Architecture. Digital Signals. Truth Tables. Logic Design

Verilog Dataflow Modeling

Lab 3: Standard Combinational Components

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

ARM 64-bit Register File

VHDL VS VERILOG.

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

EEL 4783: HDL in Digital System Design

Combinational Logic II

CS222: Processor Design

problem maximum score 1 10pts 2 8pts 3 10pts 4 12pts 5 7pts 6 7pts 7 7pts 8 17pts 9 22pts total 100pts

Advanced Digital Design Using FPGA. Dr. Shahrokh Abadi

Arithmetic Operators There are two types of operators: binary and unary Binary operators:

a, b sum module add32 sum vector bus sum[31:0] sum[0] sum[31]. sum[7:0] sum sum overflow module add32_carry assign

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


Code No: R Set No. 1

Verilog for High Performance

Transcription:

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 elements. Lets see an end result of such a design:

Divide by 9 counter By hand analysis Very messy!

Typical ICs All the circuit with basic elements packaged into a chip with some reconfigurability. More sophisticated approach of designing digital circuits. eg: Designing a divide by 9 counter Requires only a counter IC (4029) and may be 1/2 gates. Limitation: Only limited number of ICs with limited functionalities.

FPGAs A fully configurable IC FPGAs contain programmable logic components called logic blocks. Contain hierarchy of reconfigurable interconnects that allow the blocks to be wired together. Logic Blocks can be configured to any complex circuit. FPGA can be made to work as a Xor gate, a Counter or even bigger- an entire Processor!

How to Program FPGAs Verilog: A Hardware Description Language mostly describes a digital circuit Adds a level of abstraction in digital design Basic Idea: Behavioral Description of required circuit Verilog Synthesiz er A complete circuit diagram

Introduction to Verilog Data types? -Yes, called Drivers in Verilog Drivers: wire and register Wire: Connects 2 points in a circuit wire clk Register (reg) : Stores values reg A Arrays? wire [31:0] in reg [16:0] bus

Modules Modules are like Black boxes. Inputs Module Outputs Example: Inverter module Inverter( input wire A, output wire B ); assign B = ~A; endmodule Note: Input and Output ports of the module should be specified.

Combinational Circuits Combinational circuits are acyclic interconnections of gates. And, Or, Not, Xor, Nand, Nor Multiplexers, Decoders, Encoders. How are these gates, muxs etc. abstracted in Verilog? Gates, Add, Multiply : by simple operators like in C Multiplexers : by control statements like if-else, case, etc. Gate level implementation of above high level operators done by Verilog synthesizer.

Some Operators Arithmetic * Multiply / Division + Add - Subtract % Modulo Logical! Logical negation && Logical and Logical or Relational > Greater than < Less than == Equality Shift >> Right shift << Left shift

Control Statements if-else, case : Exactly like C. Hardware view: implemented using multiplexers for loops, repeat: for-loops are synthesizable only if length of iteration is determined at compile time & finite. repeat -similar to for loop. Hardware view: All loops are unrolled during synthesis.

Syntax-Control Statements for (i = 0; i < n; i = i +1) begin.. end case(address) 0 :. 1 :. 2 :.. default : endcase if (. ) begin end else begin.. end repeat (18) begin.. end

assign statement Continuous assignment statement. Used for modeling only combinational logic. module BusInverter( input wire A, output wire B ); assign B = ~A; endmodule Basically B is shorted to ~A. RHS should have variable of wire type.

Example-1 bit Full Adder module full_adder( input wire a, input wire b, input wire cin, output wire sum, output wire carry ); assign sum = a & ~b & ~cin ~a & b & ~cin ~a & ~b & cin a & b & cin; assign carry = a & b a & cin b & cin; endmodule Gate Level module full_adder( input wire a, input wire b, input wire cin, output wire sum, output wire carry ); assign { carry, sum } = a+b+cin; endmodule Behavioral

Sequential Circuits Circuits containing state elements are called sequential circuits. The simplest synchronous state element: Edge-Triggered D Flip-Flop D C f Q C D Q How do you implement such an element in Verilog?

always@ Block It is an abstraction provided in Verilog to mainly implement sequential circuits. Also used for combinational circuits. Structure of always block: always @(#sensitivity list#) begin. //No assign statements inside always@ end Execution of always block depends on the sensitivity list.

The Sensitivity List Run continuously. (mostly used in Test Benches) always Run when any variable changes its value. always @(*) //for combinational ckts Run when the variables `a' or `b' change their value. always @(a, b) Run when a positive edge is detected on CLK. ckts always @(posedge CLK) //for sequential

initial block An initial block is executed only once when simulation starts This is useful in writing test benches If we have multiple initial blocks, then all of them are executed at the beginning of simulation

Example- Counter module Counter( input wire CLK, output reg [31:0] OUT ); initial OUT <= 0; always @(posedge CLK) OUT <= OUT + 1; endmodule Note the <= sign for register assignment

module Counter( input wire CLK, output reg [4:0] OUT ); initial OUT <= 4 b0; always @(posedge CLK) begin if(out==4 b1000) OUT <= 4 b0; else OUT <= OUT + 1; end endmodule Divide by 9 counter In Verilog

Blocking and Non-Blocking Statements Non-blocking assignments happen in parallel. always @ ( #sensitivity list # ) begin B <= A ; C <= B ; (A,B) = (1,2) -> (B,C) = (1,2) end Blocking assignments happen sequentially. always @ ( #sensitivity list # ) begin B = A ; C = B ; (A,B) = (1,2) -> (B,C) = (1,1) end

Points to Note Use always@(*) block with blocking assignments for combinational circuits. Use always@(posedge CLK) block with non-blocking assignments for sequential circuits. Do not mix blocking and non-blocking assignments.

Extras- Bit Literals 4 b1011 Value Base format (d, b, h) Size in bits If no size given, number is assumed to be 32 bits. If <size> is smaller than value MSB of value truncated If <size> is greater than value MSB of value filled with zeros e.g. - hexadecimal: 4 hb If no base given, number assumed to be decimal. e.g. - 11

Questions?