Half Adder Sec. 3.10 Sec. 4.5, 4.12. Schedule 11/13MondayCourse intro, diagnostic test 21/15Wednesday Fundamentals of digital logic design (1) (signed.

Slides:



Advertisements
Similar presentations
ECE 3130 – Digital Electronics and Design
Advertisements

Verilog Section 3.10 Section 4.5. Keywords Keywords are predefined lowercase identifiers that define the language constructs – Key example of keywords:
//HDL Example 4-10 // //Gate-level description of circuit of Fig. 4-2 module analysis (A,B,C,F1,F2); input.
Verilog.
Simulation executable (simv)
Decoder Mano Section 4.9 &4.12.
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Supplement on Verilog adder examples
EE 361 Fall 2003University of Hawaii1 Hardware Design Tips EE 361 University of Hawaii.
ELEN 468 Lecture 21 ELEN 468 Advanced Logic Design Lecture 2 Hardware Modeling.
Chapter 11 Verilog HDL Application-Specific Integrated Circuits Michael John Sebastian Smith Addison Wesley, 1997.
Verilog Intro: Part 1.
Hardware Description Language (HDL)
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.
1 Brief Introduction to Verilog Weiping Shi. 2 What is Verilog? It is a hardware description language Originally designed to model and verify a design.
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
Binary Addition. Binary Addition (1) Binary Addition (2)
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
Verilog Sequential Circuits Ibrahim Korpeoglu. Verilog can be used to describe storage elements and sequential circuits as well. So far continuous assignment.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
ENEE 408C Lab Capstone Project: Digital System Design Spring 2006 Class Web Site:
Computer Organization Lecture Set – 03 Introduction to Verilog Huei-Yung Lin.
University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Lecture Note on Verilog, Course # , EE, NTU, C.H Tsai Basic Logic Design with Verilog TA: Chen-han Tsai.
Programmable Logic Architecture Verilog HDL FPGA Design Jason Tseng Week 5.
 Delay values control the time between the change in a right-hand-side operand and when the new value is assigned to the left- hand side.  Three ways.
Binary Addition Section 4.5. Binary Addition Example.
ECE 2372 Modern Digital System Design
CS 3850 Lecture 3 The Verilog Language. 3.1 Lexical Conventions The lexical conventions are close to the programming language C++. Comments are designated.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
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.
Introduction to Combinational Verilog EECS270 rev 9/25/12.
Introduction to ASIC flow and Verilog HDL
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 4: Testing, Dataflow Modeling Spring 2009.
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.
Random Number Generation Section 3.10 Section 4.12.
Introduction to Verilog Section Outline Set Up the Environment Your First Verilog File Set Up the Test Bench Running the Simulation.
Multiplexers Section Topics Multiplexers – Definition – Examples – Verilog Modeling.
Introduction to Verilog
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,
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.
Full Adder Verilog(HO: wires/regs, always) Section 4.5 (Full adder)
Exp#5 & 6 Introduction to Verilog COE203 Digital Logic Laboratory Dr. Ahmad Almulhem KFUPM Spring 2009.
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.
An Introduction to Verilog: Transitioning from VHDL
ECE 3130 Digital Electronics and Design
Reg and Wire:.
University of Maryland Baltimore County Department of Computer Science and Electrical Engineering   CMPE 212 Laboratory (Discussion 2) Hasibul Hasan
Introduction to Verilog
Discussion 2: More to discuss
Lecture 2 Supplement Verilog-01
Verilog-HDL-3 by Dr. Amin Danial Asham.
Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-I]
Chapter 4 Combinational Logic
Introduction to Verilog
Behavioral Modeling in Verilog
Introduction to Verilog
Hardware Descriptive Languages these notes are taken from Mano’s book
Introduction to Verilog
Supplement on Verilog adder examples
Introduction to Verilog
The Verilog Hardware Description Language
Introduction to Verilog
COE 202 Introduction to Verilog
Presentation transcript:

Half Adder Sec Sec. 4.5, 4.12

Schedule 11/13MondayCourse intro, diagnostic test 21/15Wednesday Fundamentals of digital logic design (1) (signed numbers) L1/16ThursdayRules, cleaning procedure, linux &Cadence intro. N/A1/20MondayMLK Day (Campus Closed) 31/22Wednesday Fundamentals of digital logic design (2) (Context: Verilog) L1/23ThursdayNAND based NOR gates (Verilog) 41/27MondayNAND based NOT and NOR (Breadboard) 51/29WednesdayBinary addition: half adder L1/30ThursdayBinary: half adder 62/3MondayBinary addition: full adder 72/5WednesdayBinary addition: four-bit adder/subtractor L2/6ThursdayClass Canceled 82/10MondayClass Canceled Test #1: Beginning of March

Outline Transition from Verilog to Digital Logic Observations Verilog Lesson Application: Half Adder

Observations Lab submissions are due at the beginning of the next lab, i.e. the following Thursday. Path to the files/`timescale Need One bit file per input Power Supply: Tie the common reference ground.

`timescale Comment `out timescale Each time interval is one second. Need to update the path! $readmemb(“./bit_str_a_0.txt”,t_A); Default directory: verilogSandBox

Need One bit file Per Input C D E F G1 G2 G3G4 Remember to pull the numbers out of the registry. Need one bit file per input!

Common Reference Ground

Lessons on Verilog Verilog – Running Command Line Verilog $monitor– output the data to the monitor $fmonitor—save data to an output file – Module/module test bench template – assign – Bitwise logic operator

Two Ways of Running Verilog Running Verilog Using the GUI Writing Output to a file Advantage: Avoid the GUI Disadvantage: hard to visualize an input pattern

Running Verilog at Command Prompt $monitor $fmonitor

Monitor Numbers Monitor numbers

Run Verilog Using Command- line $monitor only displays the results when A changes. Actual sequence: …

%0d verses %d (“time=%d”, $time…..)(“time=%0d”, $time…..)

Writing Output to a file 1. Declare a file pointer 2. Open a file, specify the file name 3. Use $fmonitor to write to a file 4. Close the file after 1000 time intervals 5. Finish the simulation

Module Template module module_name (,, ); endmodule Input, output wires reg Program Body

Module Test BenchTemplate //`timescale 1 ms /1 us module module_tb_name (,, ); endmodule Input, output wires reg Define the test bench Call on the module

Your First Verilog Program module fig3p37 (A,B,C,D,E); output D,E; input A,B,C; wire w1; and G1(w1,A,B); not G2(E,C); or G3(D,w1,E); endmodule And, not or are primitive gates. The output of a primitive gate is always listed first. The inputs can be listed in any order. G1 is an instance of the and gate.

Rewrite the Program Using assign Use & for AND operation Use tilda (~) for the INVERT operation Use | for the OR operation You can think of a wire as a wire in a circuit where actual voltages Could be measured.

Waveform

Keyword: assign 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. – RHS: R ight H and S ide of = – LHS: L eft H and S ide of = wire elements are the only legal type on the left hand side of an assign statement. (More about this next time)

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

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.

Module Template module module_name (,, ) endmodule Input, output wires reg Program Body Verilog program