Workshop on Digital Circuit Design in FPGA

Similar documents
Workshop on Digital Circuit Design in FPGA

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

Verilog for Synthesis Ing. Pullini Antonio

Nikhil Gupta. FPGA Challenge Takneek 2012

Readings: Storage unit. Can hold an n-bit value Composed of a group of n flip-flops. Each flip-flop stores 1 bit of information.

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

structure syntax different levels of abstraction

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

Chap 6 Introduction to HDL (d)

Introduction. Why Use HDL? Simulation output. Explanation

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

Modeling Synchronous Logic Circuits. Debdeep Mukhopadhyay IIT Madras

Introduction to Verilog/System Verilog

Spring 2017 EE 3613: Computer Organization Chapter 5: Processor: Datapath & Control - 2 Verilog Tutorial

Introduction To HDL. Verilog HDL. Debdeep Mukhopadhyay Dept of CSE, IIT Madras 1

Modeling Sequential Circuits in Verilog

Introduction to Verilog HDL. Verilog 1

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

MCMASTER UNIVERSITY EMBEDDED SYSTEMS

Homework deadline extended to next friday

Synthesis of Combinational and Sequential Circuits with Verilog

Lab 7 (All Sections) Prelab: Introduction to Verilog

VHDL VS VERILOG.

General FSM design procedure

Chapter 2 Using Hardware Description Language Verilog. Overview

EECS150 - Digital Design Lecture 4 - Verilog Introduction. Outline

Introduction To HDL. Verilog HDL. Debdeep Mukhopadhyay How it started!

Introduction to HDL Synthesis. Prof. Chien-Nan Liu TEL: ext: Synthesis overview RTL synthesis


Hardware Description Languages (HDLs) Verilog

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

Verilog introduction. Embedded and Ambient Systems Lab

Verilog Hardware Description Language ROOM: B405

EECS150 - Digital Design Lecture 10 Logic Synthesis

EE 231 Fall EE 231 Lab 3

Verilog HDL. Lecture #6. Madhu Mutyam Dept. of Computer Science and Engineering Indian Institute of Technology, Madras

Lecture 3. Behavioral Modeling Sequential Circuits. Registers Counters Finite State Machines

Blocking(=) vs Nonblocking (<=) Assignment. Lecture 3: Modeling Sequential Logic in Verilog HDL. Procedural assignments

EN164: Design of Computing Systems Lecture 06: Lab Foundations / Verilog 2

Digital Design with FPGAs. By Neeraj Kulkarni

Topics. Midterm Finish Chapter 7

Topics. Midterm Finish Chapter 7

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

Course Topics - Outline

ECE 4514 Digital Design II. Spring Behavioral Modeling II: Conditionals and Loops

CSE140L: Components and Design Techniques for Digital Systems Lab

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

Brief Introduction to Verilog HDL (Part 1)

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

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

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

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

In this lecture, we will go beyond the basic Verilog syntax and examine how flipflops and other clocked circuits are specified.

CSE140L: Components and Design

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

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

Register Transfer Level in Verilog: Part I

Verilog Overview. Verilog Overview. Simple Example. Simple Example. Simple Example. Simple Example

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

UNIT V: SPECIFICATION USING VERILOG HDL

EECS150 - Digital Design Lecture 10 Logic Synthesis

VERILOG CODES //SPECIAL COMBINATIONAL LOGIC CIRCUITS

General FSM design procedure

Digital Integrated Circuits

Chapter 9: Sequential Logic Modules

Graduate Institute of Electronics Engineering, NTU. FPGA Lab. Speaker : 鍾明翰 (CMH) Advisor: Prof. An-Yeu Wu Date: 2010/12/14 ACCESS IC LAB

Introduction To Verilog Design. Chun-Hung Chou

General FSM design procedure

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

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

ECE2029: Introduction to Digital Circuit Design Lab 4 Building a Sequential Logic Circuit A Four Digit 7-Segment Display Driver

Verilog Behavioral Modeling

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

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

Xilinx ASMBL Architecture

EEL 4783: HDL in Digital System Design

RTL Design (Using ASM/SM Chart)

RIZALAFANDE CHE ISMAIL TKT. 3, BLOK A, PPK MIKRO-e KOMPLEKS PENGAJIAN KUKUM. BEHAVIORAL DESCRIPTIONS IN VERILOG HDL (Chapter 7)

Verilog Tutorial. Introduction. T. A.: Hsueh-Yi Lin. 2008/3/12 VLSI Digital Signal Processing 2

Digital Design with SystemVerilog

Fig. 1: Controlled Register

The QR code here provides a shortcut to go to the course webpage.

CS 151 Quiz 4. Instructions: Student ID. (Last Name) (First Name) Signature

Digital Design (VIMIAA01) Introduction to the Verilog HDL

Graphics: Alexandra Nolte, Gesine Marwedel, Universität Dortmund. RTL Synthesis

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

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

Chapter 10. case studies in sequential logic design

Design Using Verilog

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

VERILOG 6: DECODER DESIGN EXAMPLES

EECS150 - Digital Design Lecture 7 - Computer Aided Design (CAD) - Part II (Logic Simulation) Finite State Machine Review

Verilog HDL: Behavioral Counter

CSE 502: Computer Architecture

Verilog Lecture Gandhi Puvvada, USC always statements, Coding a Flip-Flop. blocking and non-blocking assignments. Copyright 2008 Gandhi Puvvada 1

CS6710 Tool Suite. Verilog is the Key Tool

Finite-State Machine (FSM) Design

AN INTRODUCTION TO VERILOG HDL

Verilog Module 1 Introduction and Combinational Logic

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

Transcription:

Organized by: Dept. of EEE Workshop on Digital Circuit Design in FPGA Presented By Mohammed Abdul Kader Assistant Professor, Dept. of EEE, IIUC Email:kader05cuet@gmail.com Website: kader05cuet.wordpress.com

Verilog HDL RTL Verilog Code 110101 101010 RTL Verilog Code using Procedural Assignment Structural Verilog coding and Verilog coding using continuous assignment structure are used to design simple digital circuit. This approach is practical when functional complexities are not much (gate count within few hundred). With the increase of functional complexities, the above two approaches are not suitable approach. In designing complex digital circuit, procedural assignment approach is used. In this approach, the functional behavior of the circuit is described using keyword always. Sensitivity list is used with the always statement. Sensitivity list indicates output is sensitive to what?. It contains the list of specific inputs, which have effect on the outputs. Whenever any event (change) occurs in any of the parameter in the sensitivity list, the always loop will be executed. 2

Verilog HDL RTL Verilog Code 110101 101010 How to write RTL Verilog code using Procedural assignment The declaration module, input, output and module are same as used in structural Verilog coding and RTL Verilog coding using continuous assignment structure. It is important to remember that all the outputs have to be declare as register using the keyword reg. The keyword always is used to describe the behavior of the circuit. Sensitivity list has been placed inside the first bracket. The keyword begin and indicates start and completion of the always block respectively. However, the use of begin and is optional. It is just increase the clarity of the code. Within the always block, it is described What does the circuit always do: which is basically the behavior of the circuit. 3

Multiplexer 110101 101010 RTL Verilog code using procedural assignment to design a 4/1 MUX Verilog Code: module multiplexer(a,b,c,d,s,y); input A,B,C,D; input [1:0]S; output Y; reg Y; always @(A or B or C or D or S) begin case(s) 0:Y=A; 1:Y=B; 2:Y=C; 3:Y=D; default: Y=0; case module 4

Seven Segment Decoder 110101 101010 RTL Verilog code using procedural assignment to design a 7-segment Decoder (for common anode display). Verilog Code: 5 module decoder(en, in, out); input en; input [3:0] in; output [6:0] out; reg [6:0] out; always @(en or in) begin if(en==0) out=0; else begin case(in) 4'b0000: out=7'b1000000; 4'b0001: out=7'b1111001; 4'b0010: out=7'b0100100; 4'b0011: out=7'b0110000; 4'b0100: out=7'b0011001; 4'b0101: out=7'b0010010; 4'b0110: out=7'b0000010; 4'b0111: out=7'b1111000; 4'b1000: out=7'b0000000; 4'b1001: out=7'b0010000; default: out=7'b1111111; case module

4-bit up counter and Use of Internal Clock 110101 101010 Internal Clock source of DE2 6

4-bit up counter and Use of Internal Clock 110101 101010 Design of a 4-bit binary up counter. module counter_clk(rst,clk_50,leds); input rst, clk_50; output [3:0]LEDS; reg [27:0]Q; always @(posedge clk_50 or negedge rst) begin if(rst==0) Q=0; else Q=Q+1; assign LEDS=Q[27:24]; module 7

110101 101010 Design of a 4-bit binary up-down counter. 4-bit up-down counter 8

110101 101010 Design a 4-bit Shift Register 4-bit shift register 9 Module shift_4 (IN, OUT, clk, rst); input IN, clk, rst; output OUT; reg M, N, O, OUT; always @(posedge clk or posedge rst) begin if(rst) begin OUT=0; M=0; N=0; O=0; else begin OUT=M; M=N; N=O; O=IN; module

110101 101010 Design of a 128X8 bit RAM RAM module ram_8bit(wr,rd,clk,add,data_in,data_out); input WR,RD,clk; input [6:0]add; input [7:0]data_in; output [7:0]data_out; reg [7:0]data_out; reg [7:0]memory[127:0]; always @(posedge clk) begin if(wr) memory[add]<= data_in; else if(rd) data_out=memory[add]; else data_out=data_out; module 10

110101 101010 Counter with 7-segment decoder Interconnection of Modules 11

110101 101010 Module-1 (Up-Down Counter) Interconnection of Modules (Cont) module count_4updn(rst, sel, clk, Q); input rst, sel, clk; output [3:0] Q; reg [3:0] Q; always @(posedge clk or negedge rst) begin if(rst==0) Q=0; else begin if(sel) Q=Q+1; else Q=Q-1; module 12

110101 101010 Module-2 (Decoder) Interconnection of Modules (Cont) module decoder(en, in, out); input en; input [3:0] in; output [6:0] out; reg [6:0] out; always @(en or in) begin if(en==0) out=0; else begin case(in) 4'b0000: out=7'b1000000; 4'b0001: out=7'b1111001; 4'b0010: out=7'b0100100; 4'b0011: out=7'b0110000; 4'b0100: out=7'b0011001; 4'b0101: out=7'b0010010; 4'b0110: out=7'b0000010; 4'b0111: out=7'b1111000; 4'b1000: out=7'b0000000; 4'b1001: out=7'b0010000; default: out=7'b1111111; case module 13

Interconnection of Modules (Cont) 110101 101010 Interconnection of Module-1 and Module-2 14