Half Adder ( / ) Structural description: Data flow description:

Slides:



Advertisements
Similar presentations
//HDL Example 4-10 // //Gate-level description of circuit of Fig. 4-2 module analysis (A,B,C,F1,F2); input.
Advertisements

Verilog.
Verilog Descriptions of Digital Systems
ELEN 468 Lecture 21 ELEN 468 Advanced Logic Design Lecture 2 Hardware Modeling.
Verilog Modules for Common Digital Functions
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.
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.
CSE 341 Verilog HDL An Introduction. Hardware Specification Languages Verilog  Similar syntax to C  Commonly used in  Industry (USA & Japan) VHDL 
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
 HDLs – Verilog and Very High Speed Integrated Circuit (VHSIC) HDL  „ Widely used in logic design  „ Describe hardware  „ Document logic functions.
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.
Lecture 2: Hardware Modeling with Verilog HDL
1 Brief Introduction to Verilog Weiping Shi. 2 What is Verilog? It is a hardware description language Allows designers to quickly create and debug large.
The Design Process CPSC 321 Computer Architecture Andreas Klappenecker.
OUTLINE Introduction Basics of the Verilog Language Gate-level modeling Data-flow modeling Behavioral modeling Task and function.
Verilog Module Module declaration Module instantiation module Add_full (sum, c_out, a, b, c_in); // parent module input a, b, c_in; output c_out, sum;
CS 140 Lecture 14 Professor CK Cheng 11/14/02. Part II. Standard Modules A.Interconnect B.Operators. Adders Multiplier Adders1. Representation of numbers.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
2-to-1 Multiplexer: if Statement Discussion D7.1 Example 4.
CSE241 RTL Performance.1Kahng & Cichy, UCSD ©2003 CSE241A VLSI Digital Circuits Winter 2003 Recitation 2.5: Performance Coding.
CS 61C Discussion 10 (1) Jaein Jeong Fall input MUX °Out = in0 * select’ + in1 * select in0in1selectout
ECEN ECEN475 Introduction to VLSI System Design Verilog HDL.
ELEN468 Lecture 11 ELEN468 Advanced Logic Design Lecture 1Introduction.
Quad 2-to-1 Multiplexer Discussion D7.4 Example 7.
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
Lecture # 12 University of Tehran
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
Figure 5.1. Conversion from decimal to binary.. Table 5.1. Numbers in different systems.
C ONTINUOUS A SSIGNMENTS. C OMBINATIONAL L OGIC C IRCUITS each output of a Combinational Logic Circuit  A function of the inputs - Mapping functions.
Digital System 數位系統 Verilog HDL Ping-Liang Lai (賴秉樑)  
CPEN Digital System Design
EEE2243 Digital System Design Chapter 3: Verilog HDL (Combinational) by Muhazam Mustapha, January 2011.
Module 1.2 Introduction to Verilog
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
Chap. 4 Modules and Ports. 2 Modules and Ports Modules Ports Hierarchical Names Summary.
Use of HDLs in Teaching of Computer Hardware Courses Zvonko Vranesic and Stephen Brown University of Toronto.
Chapter 2: Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 2-1 Chapter 2a: Structural Modeling.
HDL Model Combinational circuits. module halfadder(s, cout, a, b); input a, b; output s, cout; xor g1(s, a, b); and g2(cout, a, b); endmodule.
Introduction to VHDL Coding Wenchao Cao, Teaching Assistant Department of EECS University of Tennessee.
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
Chapter 6: Hierarchical Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 6-1 Chapter 6: Hierarchical.
How does a Computer Add ? Logic Gates within chips: AND Gate A B Output OR Gate A B Output A B A B
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,
Electrical Engineering Engineering the Future Digital Circuits Fundamentals Hands-on Full-Adder Simulation (afternoon)
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
1 Lecture 1: Verilog HDL Introduction. 2 What is Verilog HDL? Verilog Hardware Description Language(HDL)? –A high-level computer language can model, represent.
Combinational Circuits
CSE241A VLSI Digital Circuits Winter 2003 Recitation 2
Verilog Introduction Fall
Lecture 2 Supplement Verilog-01
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.
Combinatorial Logic Design Practices
OUTLINE Introduction Basics of the Verilog Language
HDL Programming Fundamentals
Boolean Algebra.
Verilog.
Number Systems and Circuits for Addition
Hasibul Hasan Ankit Baingane Edward Hanson
Supplement on Verilog adder examples
Combinational Circuits
The Verilog Hardware Description Language
XOR Function Logic Symbol  Description  Truth Table 
Today’s Lab Start working with Xilinx
COE 202 Introduction to Verilog
Presentation transcript:

Dept. of Electrical Engineering National Cheng Kung University Tainan, Taiwan, R.O.C

Half Adder ( / ) Structural description: Data flow description: module Add_half(sum, c_out, a ,b); input a, b; output sum, c_out; wire c_out_bar; xor x1(sum, a, b); nand (c_out_bar, a, b); not (c_out, c_out_bar); endmodule module Add_half(sum, c_out, a ,b); input a, b; output sum, c_out; assign sum = a^b assign c_out = ~(a&b); endmodule

Half Adder ( / ) Data flow description: assign: continuous assignment module Add_half(sum, c_out, a ,b); input a, b; output sum, c_out; assign {c_out, sum} = a + b; endmodule assign: continuous assignment

Half Adder ( / ) Behavior description: module Add_half(sum, c_out, a ,b); input a, b; output sum, c_out; reg sum, c_out; always@(a or b) begin {c_out, sum} = a + b; end endmodule

Full Adder ( / ) Data flow description: Behavior description: module Add_full(sum, c_out, a ,b, c_in); input a, b, c_in; output sum, c_out; reg sum, c_out; assign {c_out, sum} = a + b + c_in; endmodule module Add_full(sum, c_out, a ,b, c_in); input a, b, c_in; output sum, c_out; reg sum, c_out; always@(a or b or c_in) begin {c_out, sum} = a + b + c_in; end endmodule

Hierarchical Description of Circuit module Add_full(sum, c_out, a ,b); input a, b; output sum, c_out; wire c_in3, c_in2, c_in1; Add_half G1(sum[0], c_in1, a[0], b[0]); Add_full G2(sum[0], c_in2, a[1], b[1], c_in1); Add_full G3(sum[0], c_in3, a[2], b[2], c_in2); Add_full G4(sum[0], c_out, a[3], b[3], c_in3); endmodule Ripple-Carry Adder: c_in3 c_in2 c_in1 half

Full Adder with high level description module Add_4bit(sum, c_out, a ,b); input [3:0] a, b; output [3:0] sum; output c_out; assign {c_out, sum} = a + b; endmodule The synthesized circuit is dependent on the tool you use (might be ripple-carry Adder or other Adders).

If-Else Statements ( / )

If-Else Statements ( / )

Case Statements ( / )

Case Statements ( / )

Decoder with Case Statements