Verilog Section 3.10 Section 4.5. Keywords Keywords are predefined lowercase identifiers that define the language constructs – Key example of keywords:

Slides:



Advertisements
Similar presentations
Chapter 3 Gate-Level Minimization
Advertisements

ENGIN112 L7: More Logic Functions September 17, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 7 More Logic Functions: NAND, NOR,
Lecture 6 More Logic Functions: NAND, NOR, XOR and XNOR
topics Logic gates Gates types Universal gates
ADDER, HALF ADDER & FULL ADDER
Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. Terms of Use (Hyperlinks are active in View Show mode) Terms of Use Verilog Part 1 – Chapter.
Verilog.
The Verilog Hardware Description Language
Supplement on Verilog adder examples
Chapter 11 Verilog HDL Application-Specific Integrated Circuits Michael John Sebastian Smith Addison Wesley, 1997.
Verilog Intro: Part 1.
Hardware Description Language (HDL)
Figure 4.1. The function f (x1, x2, x3) =  m(0, 2, 4, 5, 6).
16/04/20151 Hardware Descriptive Languages these notes are taken from Mano’s book It can represent: Truth Table Boolean Expression Diagrams of gates and.
Half Adder Sec Sec. 4.5, Schedule 11/13MondayCourse intro, diagnostic test 21/15Wednesday Fundamentals of digital logic design (1) (signed.
Full Adder Section 4.5 Spring, 2014 J.Ou. Schedule 62/3MondayBinary addition: full adder 72/5WednesdayBinary addition: full adder/four-bit adder L2/6ThursdayLab.
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part3: Verilog – Part 1.
Lecture 1 Design Hierarchy Chapter 1. Digital System Design Flow 1.Register-Transfer Levl (RTL) – e.g. VHDL/Verilog 2.Gate Level Design 3.Circuit Level.
Binary Addition. Binary Addition (1) Binary Addition (2)
08/07/041 CSE-221 Digital Logic Design (DLD) Lecture-8:
ECE 353 Computer Systems Lab I Verilog Hardware Description Language.
Silicon Programming--Intro. to HDLs1 Hardware description languages: introduction intellectual property (IP) introduction to VHDL and Verilog entities.
Hardware Description Language HDL. 2 Hardware Description Language HDL  Describes circuits and systems in text. −As a software program.  Can be processed.
Binary Addition CSC 103 September 17, 2007.
Binary Addition Section 4.5. Binary Addition Example.
ECE 2372 Modern Digital System Design
ECE/CS 352 Digital Systems Fundamentals
ADDERS Half Adders Recall that the basic rules of binary addition are as indicated below in Table 2-9. A circuit known as the half-adder carries out these.
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
Module 9.  Digital logic circuits can be categorized based on the nature of their inputs either: Combinational logic circuit It consists of logic gates.
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
1 Ethics of Computing MONT 113G, Spring 2012 Session 5 Binary Addition.
Digital Electronics Chapter 3 Gate-Level Minimization.
LECTURE III INTRODUCTION TO HDL/VERILOG. HDL: Hardware Description Languages (Verilog for this class) are a way in which digital circuits can be described.
ELEE 4303 Digital II Introduction to Verilog. ELEE 4303 Digital II Learning Objectives Get familiar with background of HDLs Basic concepts of Verilog.
Introduction to ASIC flow and Verilog HDL
Introduction to Verilog Section Outline Set Up the Environment Your First Verilog File Set Up the Test Bench Running the Simulation.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Chapter1: Introduction Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 1-1 Chapter 1: Introduction Prof. Ming-Bo.
Verilog Intro: Part 1. Hardware Description Languages A Hardware Description Language (HDL) is a language used to describe a digital system, for example,
LECTURE V TEST BENCHES. As your projects become more complex and multiple modules are employed, it will no longer be possible to simulate them as we did.
1 A hardware description language is a computer language that is used to describe hardware. Two HDLs are widely used Verilog HDL VHDL (Very High Speed.
Introduction to Verilog COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals.
ECE 3130 Digital Electronics and Design
ECE 3130 Digital Electronics and Design
Discussion 2: More to discuss
Verilog-HDL-1 by Dr. Amin Danial Asham.
KS4 Electricity – Electronic systems
KS4 Electricity – Electronic systems
NAND Gate Truth table To implement the design,
Summary Half-Adder Basic rules of binary addition are performed by a half adder, which has two binary inputs (A and B) and two binary outputs (Carry out.
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
Hardware Descriptive Languages these notes are taken from Mano’s book
Introduction to Verilog
FIGURE 4.1 Block diagram of combinational circuit
Instructor: Alexander Stoytchev
Hardware Descriptive Languages these notes are taken from Mano’s book
Digital Logic.
Number Systems and Circuits for Addition
KS4 Electricity – Electronic systems
13 Digital Logic Circuits.
Digital Logic.
DIGITAL ELECTRONICS B.SC FY
Chapter 10.3 and 10.4: Combinatorial Circuits
The Verilog Hardware Description Language
XOR Function Logic Symbol  Description  Truth Table 
ECE 3130 Digital Electronics and Design
COE 202 Introduction to Verilog
Combinational Circuit Design
Presentation transcript:

Verilog Section 3.10 Section 4.5

Keywords Keywords are predefined lowercase identifiers that define the language constructs – Key example of keywords: module, endmodule, input, output, and wire.

assign The assignment is said to be sensitive to the variables in the RHS expression because anytime a variable in the RHS changes during the simulation, the RHS expression is reevaluated and the result is used to update the LHS.

Semicolon Each statement must end with a semicolon (;)

Bitwise Logic Operation Bitwise means 1 bit at a time Bitwise logic operatorVerilog ANDa&b ORa|b XORa^b INVERT~a NAND~(a&b) NOR~(a|b) XNOR!(a^b)

wire You can think of a wire as a wire in a circuit where actual voltages Could be measured.

Wire example Use & for AND operation Use tilda (~) for the INVERT operation Use | for the OR operation

Waveform

Using Verilog Primitives Verilog also has keywords such as and or and not. The output of a primitive must be listed first.

Gate Delays In Verilog, the propagation delay of a gate is specified in terms of time units and is specified by the symbol #. `timescale 1ns/100ps – The first number specifies the unit of measurement for time delays. – The second number specifies the precisions for which the delays are rounded off.

Gate Delay E is not defined until after 1 ns.

Gate Delay E is not defined until 1 ns. W is not defined until 2 ns. This means that D is not defined until 3 ns.

Binary Addition Example

Derivation of ∑ (ES112 Slides) BA∑

Derivation of Carry Out (ES112 Slides) Question: What primitive best implements C o ? Inputs: A, B Outputs: C o =A∙B BACoCo

Implementation of a Half-Adder

Limitation of a Half Adder A half-adder does not account for carry-in.

Truth Table for a Full Adder carry-in

Karnaugh Map For the Sum Bit (ES112 Review)

Karnaugh Map For the Carry-Out Bit (ES112 Review)

Implementation of a Full Adder (carry-in)

Schematic of a Full Adder Half-adder(not including the bubble) Half-adder

Build a Verilog Representation of a Full Adder Circuit Build a half adder circuit Build a test bench for the adder circuit Assemble a full adder circuit Build a test bench circuit to test the full –adder Write the code to implement the adder circuit on FPGA

Build a Half-Adder Circuit (Figure 4.5)

Build a Test Bench in Verilog Ideas: (page 112 of the textbook) 1.reg 2.Initial statement 3.Assign value to a single bit 4.$finish 1’b0=one binary digit with a value of 0 1’b1=one binary digit with a value of 1

Initial, $finish inital: keyword used with a set of statements that begin executing when simulation is initialized. $finish: specifies the termination of simulation.

Block statement A block statement consists of several statements that are executed in sequence from top to bottom.

Build a Full-Adder Circuit w1 w2w3 M1M2

Full-Adder Top Level Circuit

Build a FPGA Top Level Circuit (x) (y) (z)(s) (c) See gates2.pdf (available from the course website) for reference