Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.

Slides:



Advertisements
Similar presentations
Verilog Fundamentals Shubham Singh Junior Undergrad. Electrical Engineering.
Advertisements

The Verilog Hardware Description Language
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Synchronous Sequential Logic
Combinational Logic.
Table 7.1 Verilog Operators.
Verilog Intro: Part 1.
Hardware Description Language (HDL)
Combinational Logic with Verilog Materials taken from: Digital Design and Computer Architecture by David and Sarah Harris & The Essentials of Computer.
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part3: Verilog – Part 1.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
ECE 551 Digital System Design & Synthesis Lecture 08 The Synthesis Process Constraints and Design Rules High-Level Synthesis Options.
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
Verilog - 1 Writing Hardware Programs in Abstract Verilog  Abstract Verilog is a language with special semantics  Allows fine-grained parallelism to.
Verilog Sequential Circuits Ibrahim Korpeoglu. Verilog can be used to describe storage elements and sequential circuits as well. So far continuous assignment.
Silicon Programming--Intro. to HDLs1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities.
ENEE 408C Lab Capstone Project: Digital System Design Fall 2005 Sequential Circuit Design.
Lecture 7 Verilog Additional references Structural constructs
Overview Logistics Last lecture Today HW5 due today
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
Introduction to FPGA AVI SINGH. Prerequisites Digital Circuit Design - Logic Gates, FlipFlops, Counters, Mux-Demux Familiarity with a procedural programming.
ECE 2372 Modern Digital System Design
System Arch 2008 (Fire Tom Wada) /10/9 Field Programmable Gate Array.
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
1 An Update on Verilog Ξ – Computer Architecture Lab 28/06/2005 Kypros Constantinides.
Digital System 數位系統 Verilog HDL Ping-Liang Lai (賴秉樑)  
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
ECE/CS 352 Digital System Fundamentals© 2001 C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapters 3 and 4: Verilog – Part 2 Charles R.
Module 1.2 Introduction to Verilog
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
Slide 1 2. Verilog Elements. Slide 2 Why (V)HDL? (VHDL, Verilog etc.), Karen Parnell, Nick Mehta, “Programmable Logic Design Quick Start Handbook”, Xilinx.
3/4/20031 ECE 551: Digital System Design * & Synthesis Lecture Set 3 3.1: Verilog - User-Defined Primitives (UDPs) (In separate file) 3.2: Verilog – Operators,
1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities and architectural bodies behavioral,
Behavioral Modelling - 1. Verilog Behavioral Modelling Behavioral Models represent functionality of the digital hardware. It describes how the circuit.
February 6, 2009http://csg.csail.mit.edu/6.375/L02-1 Verilog 1 - Fundamentals Complex Digital Systems Arvind February 6, 2009 FA module adder( input.
Verilog A Hardware Description Language (HDL ) is a machine readable and human readable language for describing hardware. Verilog and VHDL are HDLs.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Introduction to ASIC flow and Verilog HDL
Introduction to Verilog. Data Types A wire specifies a combinational signal. – Think of it as an actual wire. A reg (register) holds a value. – A reg.
Introduction to Verilog
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
Introduction to Verilog. Structure of a Verilog Program A Verilog program is structured as a set of modules, which may represent anything from a collection.
1 University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part4: Verilog – Part 2.
Exp#5 & 6 Introduction to Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.
Introduction to Verilog COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals.
Overview Logistics Last lecture Today HW5 due today
Hardware Description Languages: Verilog
Supplement on Verilog FF circuit examples
Introduction to Verilog
Discussion 2: More to discuss
EMT 351/4 DIGITAL IC DESIGN Week # Synthesis of Sequential Logic 10.
Hardware Description Languages: Verilog
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Introduction to Verilog
Behavioral Modeling in Verilog
Field Programmable Gate Array
Field Programmable Gate Array
Field Programmable Gate Array
Introduction to Verilog
SYNTHESIS OF SEQUENTIAL LOGIC
Verilog.
332:437 Lecture 8 Verilog and Finite State Machines
Introduction to Verilog
The Verilog Hardware Description Language
The Verilog Hardware Description Language
332:437 Lecture 8 Verilog and Finite State Machines
Introduction to Digital IC Design
Presentation transcript:

Anurag Dwivedi

Basic Block - Gates

Gates -> Flip Flops

Flip Flops-> Counter

Finally a processor can be designed from basic building blocks

 How do we design the circuit? Do we draw it on pen and paper?  Became tedious when the number of gates increased exponentially !  Hardware Descriptive languages (HDLs) comes to the rescue. ◦ We describe the digital circuits in terms of its structure and functionality.

 Verilog is A Hardware Descriptive Language used to describe a circuit.  Syntax is similar to C, but is not a programming language  Synthesized ( analogous to compiled in C ) to give the circuit logic diagram  VHDL is another HDL commonly used

 Field Programmable Gate Array  A fully configurable IC  FPGAs contain programmable logic components called logic blocks.  Hierarchy of reconfigurable interconnects that allow the blocks to be wired together.  FPGA can be made to work as a XOR gate, a Counter or even bigger- an entire Processor!

 Configured using a Hardware Descriptive Language  Can be configured in any way by the user

 Consists of various building blocks called Modules  Communication between a module and its environment is achieved by using Ports  Ports are of three types: input, output, inout

 A “Black Box” in Verilog with inputs, outputs and internal logic working.  So, a module can be used to implement a counter.  A module is defined as module ( );

 One Input port for CLK  Four binary output ports  At every rising edge of clock, increment output by 1

 Way 1: module 4029(clk, a, b, c, d, reset, enable); //Assuming two more input pins, reset and //enable with their corresponding functioning  Way 2: module 4029(clk, out, reset, enable); What is the difference in the two?

 Way 1: input clk; input reset; input enable; output a,b,c,d;  Way 2: input clk; input reset; input enable; output [3:0] out;

 We need drivers for this module in order to interact with other modules  Driver is a way of defining something which can drive a load  Two types of drivers: ◦ Can store a value (for example, flip-flop) ◦ Cannot store a value, but connects two points (for example, a wire)  In Verilog, a driver which can store a value is called reg and the one which cannot is called wire

 Ports defined as wires? ◦ clk ◦ reset ◦ enable  We do not need to stores the values of these ports in our logical block.  Ports defined as reg? ◦ a,b,c,d ◦ out  We need to store them so that we could modify their values when required.

 Way 1: wire clk; wire reset; wire enable; reg a,b.c,d;  Way 2: wire clk; wire reset; wire enable; reg [3:0] out;

module 4029( clk, out, reset, enable); input wire clk; input wire reset; input wire enable; output reg [3:0] out; endmodule

 reg can store a value, wire simply connects  Most of the times, inputs are wire and outputs are reg  Output of flip flop – wire or reg ?  Output of XOR gate – wire or reg ?  Output of multiplexer – wire or reg ?

 We have seen how to define the outer structure of the modules we will use.  Time to define the internal structure and functioning?

 All the arithmetic as well as logical operators in Verilog are similar to C, except ++ and –- which are not available in Verilog.  Conditional statements are also similar to C with following modifications: ◦ { is replaced by begin. ◦ } is replaced by end.

 Combinational circuits are acyclic interconnections of gates. ◦ And, Or, Not, Xor, Nand, Nor …… ◦ Multiplexers, Decoders, Encoders …. ◦ Adders, Multipliers ….  OUTPUT DEPENDS ON THE PRESENT INPUT ONLY.  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.

 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.

 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.

Gate Level DescriptionBehavioral Description 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 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

 Circuits containing state elements are called sequential circuits  OUTPUT DEPENDS ON THE PRESENT INPUT AS WELL AS ON ITS PRESENT STATE.  The simplest synchronous state element: Edge triggered D Flip Flop  How do you implement such an element in Verilog?

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

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

 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

module Counter( input wire CLK, output reg [3:0] OUT ); initial OUT <= 0; CLK) OUT <= OUT + 1; endmodule

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

 Use block with blocking assignments for combinational circuits.  Use clk) block with non- blocking assignments for sequential combinational circuits.  Do not mix blocking and non-blocking statements.

module 4029( clk, out, reset, enable); input wire clk; input wire reset; input wire enable; output reg [3:0] out; clk) begin if (reset == 0 && enable == 0) begin out <= out +1; end // continued to next page

or enable) begin if (reset == 1’b1) begin out <= 0; end endmodule

 If no size given, number is assumed to be 32 bits.  If is smaller than value ◦ MSB of value truncated  If 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

 Modular Circuits  Test Benches  Demonstration  Problem Statement Discussion