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

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

Digital Design with FPGAs. By Neeraj Kulkarni

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

Nikhil Gupta. FPGA Challenge Takneek 2012

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

Hardware Description Languages (HDLs) Verilog

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

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

Chap 6 Introduction to HDL (d)

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

A Brief Introduction to Verilog Hardware Definition Language (HDL)

Introduction to Verilog

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

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

DIGITAL SYSTEM DESIGN

Chap 3. Modeling structure & basic concept of Verilog HDL

DIGITAL SYSTEM DESIGN

Writing Circuit Descriptions 8

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

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

Hardware Description Language VHDL (1) Introduction

ECE 353 Lab 3 (Verilog Design Approach)

HDL for Combinational Circuits. ENEL211 Digital Technology

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

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

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

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

Combinational Logic Design with Verilog. ECE 152A Winter 2012

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

Debouncing a Switch. A Design Example. Page 1

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

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

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

Introduction to Verilog

ENEE245 Digital Circuits and Systems Lab Manual

Synthesis of Combinational and Sequential Circuits with Verilog

Verilog 1 - Fundamentals

Chapter 2a: Structural Modeling

Digital System Design Verilog-Part III. Amir Masoud Gharehbaghi

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

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

ENEE 245 Lab 1 Report Rubrics

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

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

Chapter 2 Using Hardware Description Language Verilog. Overview

Chapter 9: Sequential Logic Modules

Numbering Systems. Number Representations Part 1

CSE140L: Components and Design Techniques for Digital Systems Lab. Verilog HDL. Instructor: Mohsen Imani UC San Diego. Source: Eric Crabill, Xilinx

P-1/26. Samir Palnitkar. Prentice-Hall, Inc. INSTRUCTOR : CHING-LUNG SU.

Design Using Verilog

ENEE245 Digital Circuits and Systems Lab Manual

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

EECS150 - Digital Design Lecture 8 - Hardware Description Languages

Department of Electrical and Computer Engineering Xilinx ISIM <Release Version: 14.1i> Simulation Tutorial Using Verilog

EN2911X: Reconfigurable Computing Topic 02: Hardware Definition Languages

Synthesizable Verilog

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

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

Modeling Sequential Circuits in Verilog

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

CS6710 Tool Suite. Verilog is the Key Tool

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

Verilog Sequential Logic. Verilog for Synthesis Rev C (module 3 and 4)

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

C-Based Hardware Design

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

Course Topics - Outline

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

Complex Combinational circuits in Bluespec

Announcements. Midterm 2 next Thursday, 6-7:30pm, 277 Cory Review session on Tuesday, 6-7:30pm, 277 Cory Homework 8 due next Tuesday Labs: project

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

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

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

CS429: Computer Organization and Architecture

Topics. Midterm Finish Chapter 7

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

CSE140L: Components and Design Techniques for Digital Systems Lab

Tutorial on Verilog HDL

ANADOLU UNIVERSITY DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EEM Digital Systems II

Finite-State Machine (FSM) Design

Chapter 9: Sequential Logic Modules


CSE140L: Components and Design

M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Verilog for High Performance

Digital Integrated Circuits

Verilog HDL. Gate-Level Modeling

Course Topics - Outline

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

VeriLogger Tutorial: Basic Verilog Simulation

Combinational Logic II

Veriolog Overview. CS/EE 3710 Fall 2010

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis


Chapter-5. EE 335 : Advanced Microprocessor. Logic Design with Behavioral Models of Combinational and Sequential Logic

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

EECS150 - Digital Design Lecture 4 - Verilog Introduction. Outline

Problem Set 3 Solutions

Lab 2: Barrel Shifter Design

ECEN 468 Advanced Digital System Design

Transcription:

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

Recap Verilog- Hardware Description Language Modules Combinational circuits assign statement Control statements Sequential circuits always@ block Blocking and non-blocking statements

Parameterized modules A generalized type of module. Can be instantiated to any value of parameter. Parameterization is a good practice for reusable modules Useful in large circuits.

Example: N-bit adder module AdderN #(parameter N = 4)( input wire [N-1:0] IN1, input wire [N-1:0] IN2, output reg [N-1:0] OUT ); always @(*) OUT <= IN1 + IN2; endmodule

Modular Circuits Time to connect the black boxes together A modular circuit is one where sub-modules are initialized with interconnects to form even a larger circuit. Each sub-module resides in its own Verilog file. A sub-module may use another submodule in its circuit.

module FAdder( ); endmodule Example Full Adder input wire [3:0] A, B, output wire cout, output wire [3:0] S wire c0, c1, c2; module FA( input wire a, b, cin, output wire sum, output wire cout ); assign { carry, sum } = a+b +cin; endmodule FA fa0(.a(a[0]),.b(b[0]),.cin(0),.cout(c0),.sum(s[0])); FA fa1(.a(a[1]),.b(b[1]),.cin(c0),.cout(c1),.sum(s[1])); FA fa2(.a(a[2]),.b(b[2]),.cin(c1),.cout(c2),.sum(s[2])); FA fa3(.a(a[3]),.b(b[3]),.cin(c2),.cout(cout),.sum(s[3]));

Instantiation Modules: <Module Name> <Instance name> (.in1( ),.in2( ),.out1( ),.out2( ) ); Parametrized Module: <Module Name> #(.<Parameter Name>(value)) <Instance name> (.in1( ),.in2( ),.out1( ),.out2( ) ); Example: AdderN #(.N(16)) Add1 (.IN1(in1),.IN2(in2),.OUT(out));

Points to Note All output ports of instantiated sub-module should be of wire data-type. Note in previous example, c0,c1,c2 and S are wires. Inputs may be reg or wire. Suppose in above, [3:0] S was of reg type. Declare a dummy wire variable [3:0] add Pass add[0], add[1] to the instantiations Finally put: always@(*) S <= add;

Test Bench Used to test the functionality of design by simulation. Instantiate our top most module and give varying inputs & verify if the outputs match expected results. Added functionalities in TestBench: Delays $display(), $monitor()

Not synthesized Delays Can be used to model delays in actual circuit during simulation Used mostly in Test Benches to provide inputs at particular instants. Syntax: #<time steps> wire #10 out; assign out = a & b; wire out; assign #10 out = in1 & in2; #10 q = x + y; q = #10 x + y; Most common: always #5 clk = ~clk;

More Features $display() used for printing text or variables to screen syntax is the same as for printf in C $display("time, \tclk, \tenable, \tcount"); $monitor() keeps track of changes to the variables in the list (clk, enable, count). whenever any of them changes, it prints their value. only written once in initial block. $monitor("%d,\t%b,\t%b,\t%b,\t%d",$time, clk, enable,count); $finish Terminating simulation

Example Test bench Counter module counter_tb; reg clk, reset, enable; wire [3:0] count; endmodule counter C0(.clk (clk),.reset (reset),.enable (enable),.count (count) ); initial begin end clk = 0; reset = 0; enable = 0; always #5 clk =!clk; initial begin end initial #100 $finish; $display("time,\tclk,\tenable,\tcount"); $monitor("%d,\t%b,\t%b,\t%d",$time, clk,enable,count);

FPGA Design Challenge Problem Statement Gaussian Random Number Generator

Top Module To construct the following module: module GRNG( input wire mean, var, input wire enable, output reg [N-1:0] random_out ); endmodule Write a Test Bench to get large number of samples from the module and write them in a file. Read data from file using any plotting routine (MATLAB, etc) and plot the distribution.

Some Probability theory

Central Limit Theorem

Linear Feedback Shift Registers Uniform Pseudo-Random Number Generation... XOR/XNOR of some bits (taps) of previous state is input bit of the shift register. Length of Random cycle dependent on taps. One with maximum cycle can be considered to fairly uniformly random. List of taps for given length: http://www.xilinx.com/support/documentation/applic ation_notes/xapp052.pdf X

Note The approach mentioned above is one of the many possible solutions to the problem statement. You should search more and come up with a better solution.

Anderson-Darling Test

Extra Task Only if you complete the compulsory task Write an encoder and decoder for LDPC codes. Add the GRN (Noise) to output of encoder and pass it as input to decoder. Do it for large number samples, and get number of errors. Repeat for different values of SNR and plot the BER curve for the system.

Questions?