Use of HDLs in Teaching of Computer Hardware Courses Zvonko Vranesic and Stephen Brown University of Toronto.

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

The Verilog Hardware Description Language
Supplement on Verilog adder examples
CPEN Digital System Design
Verilog Intro: Part 1.
ECE Synthesis & Verification - Lecture 2 1 ECE 667 Spring 2011 ECE 667 Spring 2011 Synthesis and Verification of Digital Circuits High-Level (Architectural)
Introduction So far, we have studied the basic skills of designing combinational and sequential logic using schematic and Verilog-HDL Now, we are going.
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
CSE 201 Computer Logic Design * * * * * * * Verilog Modeling
CSE 341 Verilog HDL An Introduction. Hardware Specification Languages Verilog  Similar syntax to C  Commonly used in  Industry (USA & Japan) VHDL 
ECE 331 – Digital System Design
The Multicycle Processor II CPSC 321 Andreas Klappenecker.
The Design Process CPSC 321 Computer Architecture Andreas Klappenecker.
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
Counters Discussion 12.1 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
1 COMP541 Arithmetic Circuits Montek Singh Mar 20, 2007.
2-to-1 Multiplexer: if Statement Discussion D7.1 Example 4.
ECE 301 – Digital Electronics
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #12) The slides included herein were taken from the materials.
ECE 301 – Digital Electronics
ECE 331 – Digital System Design
Computer Organization Lecture Set – 03 Introduction to Verilog Huei-Yung Lin.
B. RAMAMURTHY Hardware Description Language 8/2/
Combinational Logic in Verilog
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Verilog Intro: Part 2. Procedural Blocks There are two types of procedural blocks in Verilog. – initial for single-pass behavior: initial blocks execute.
Figure 6.1. A 2-to-1 multiplexer.
ECE 2372 Modern Digital System Design
Chapter 4 – Arithmetic Functions and HDLs Logic and Computer Design Fundamentals.
Figure 5.1. Conversion from decimal to binary.. Table 5.1. Numbers in different systems.
Figure 5.1. Conversion from decimal to binary.. Table 5.1. Numbers in different systems.
Figure 5.1 Conversion from decimal to binary. Table 5.1 Numbers in different systems.
1 Adders & Subtractors Adders –An adder is a combinational logic circuit that performs the addition of 2 binary numbers (A & B) to generate the sum (S)
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
Verilog HDL: A solution for Everybody By, Anil Kumar Ram Rakhyani
CPEN Digital System Design
Basic Overview of VHDL Matthew Murach Slides Available at:
EEE2243 Digital System Design Chapter 3: Verilog HDL (Combinational) by Muhazam Mustapha, January 2011.
Chap. 4 Modules and Ports. 2 Modules and Ports Modules Ports Hierarchical Names Summary.
ECE 331 – Digital System Design Single-bit Adder Circuits and Adder Circuits in VHDL (Lecture #11) The slides included herein were taken from the materials.
Number Systems and Circuits for Addition Lecture 5 Section 1.5 Thu, Jan 26, 2006.
COMP541 Arithmetic Circuits
ECE 331 – Digital System Design Multi-bit Adder Circuits, Adder/Subtractor Circuit, and Multiplier Circuit (Lecture #12)
CS/EE 3700 : Fundamentals of Digital System Design Chris J. Myers Lecture 5: Arithmetic Circuits Chapter 5 (minus 5.3.4)
ELEE 4303 Digital II Introduction to Verilog. ELEE 4303 Digital II Learning Objectives Get familiar with background of HDLs Basic concepts of Verilog.
C-H1 Lecture Adders Half adder. C-H2 Full Adder si is the modulo- 2 sum of ci, xi, yi.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Number Systems and Circuits for Addition – Binary Adders Lecture 6 Section 1.5 Fri, Jan 26, 2007.
Verilog hdl – II.
1 ECE 545—Digital System Design with VHDL Lecture 1 Digital Logic Refresher Part A – Combinational Logic Building Blocks.
Number Representation and Arithmetic Circuits
Chapter 6: Hierarchical Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 6-1 Chapter 6: Hierarchical.
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,
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
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.
Hardware Description Languages: Verilog
Verilog-HDL Reference: Verilog HDL: a guide to digital design and synthesis, Palnitkar, Samir Some of slides in this lecture are supported by Prof. An-Yeu.
Supplement on Verilog adder examples
Lecture 2 Supplement Verilog-01
Hardware Description Languages: Verilog
ME2200 DIGITAL SYSTEMS (FUNDAMENTALS OF DIGITAL LOGIC) [Slide 4] Number Representation and Arithmetic Circuits BY DREAMCATCHER
ECE 331 – Digital System Design
Introduction to Verilog
Chapter 5 – Number Representation and Arithmetic Circuits
Verilog-HDL Reference: Verilog HDL: a guide to digital design and synthesis, Palnitkar, Samir Some of slides in this lecture are supported by Prof. An-Yeu.
Supplement on Verilog adder examples
EEE2243 Digital System Design Chapter 1: Verilog HDL (Combinational) by Muhazam Mustapha, February 2012.
Introduction to Verilog – Part-2 Procedural Statements
Presentation transcript:

Use of HDLs in Teaching of Computer Hardware Courses Zvonko Vranesic and Stephen Brown University of Toronto

Message of this talk Introduce Verilog or VHDL early Course becomes more interesting and useful Integrate the discussion of logic circuits and HDL representations

Typical course sequence Logic Design Computer Organization...

Key points HDL is not a programming language Start with a structural approach Make sure that students see wires and flip-flops Progress to behavioral approach Explain the impact of target technology

The next few slides show how a number of Verilog concepts can be introduced using an example of a ripple-carry adder. This approach is used in the book: S. Brown and Z. Vranesic: “Fundamentals of Digital Logic with Verilog Design” McGraw-Hill, 2003

An n-bit ripple-carry adder. FA x n –1 c n c n1- y n1– s n1– FA x 1 c 2 y 1 s 1 c 1 x 0 y 0 s 0 c 0 MSB positionLSB position

Verilog code for the full-adder. module fulladd (Cin, x, y, s, Cout); input Cin, x, y; output s, Cout; assign s = x ^ y ^ Cin; assign Cout = (x & y) | (x & Cin) | (y & Cin); endmodule

A four-bit adder. module adder4 (carryin, X, Y, S, carryout); input carryin; input [3:0] X, Y; output [3:0] S; output carryout; wire [3:1] C; fulladd stage0 (carryin, X[0], Y[0], S[0], C[1]); fulladd stage1 (C[1], X[1], Y[1], S[1], C[2]); fulladd stage2 (C[2], X[2], Y[2], S[2], C[3]); fulladd stage3 (C[3], X[3], Y[3], S[3], carryout); endmodule

A generic specification of a ripple-carry adder. module addern (carryin, X, Y, S, carryout); parameter n=32; input carryin; input [n-1:0] X, Y; output [n-1:0] S; output carryout; reg [n-1:0] S; reg carryout; reg [n:0] C; integer k; or Y or carryin) begin C[0] = carryin; for (k = 0; k < n; k = k+1) begin S[k] = X[k] ^ Y[k] ^ C[k]; C[k+1] = (X[k] & Y[k]) | (X[k] & C[k]) | (Y[k] & C[k]); end carryout = C[n]; end endmodule

Specification of an n-bit adder using arithmetic assignment. module addern (carryin, X, Y, S); parameter n = 32; input carryin; input [n-1:0] X, Y; output [n-1:0] S; reg [n-1:0] S; or Y or carryin) S = X + Y + carryin; endmodule

An n-bit adder with carry-out and overflow signals. module addern (carryin, X, Y, S, carryout, overflow); parameter n = 32; input carryin; input [n-1:0] X, Y; output [n-1:0] S; output carryout, overflow; reg [n-1:0] S; reg carryout, overflow; or Y or carryin) begin S = X + Y + carryin; carryout = (X[n-1] & Y[n-1]) | (X[n-1] & ~S[n-1]) | (Y[n-1] & ~S[n-1]); overflow = carryout ^ X[n-1] ^ Y[n-1] ^ S[n-1]; end endmodule

A different specification of an n-bit adder with carry-out and overflow signals. module addern (carryin, X, Y, S, carryout, overflow); parameter n = 32; input carryin; input [n-1:0] X, Y; output [n-1:0] S; output carryout, overflow; reg [n-1:0] S; reg carryout, overflow; reg [n:0] Sum; or Y or carryin) begin Sum = {1'b0,X} + {1'b0,Y} + carryin; S = Sum[n-1:0]; carryout = Sum[n]; overflow = carryout ^ X[n-1] ^ Y[n-1] ^ S[n-1]; end endmodule

Simplified complete specification of an n-bit adder. module addern (carryin, X, Y, S, carryout, overflow); parameter n = 32; input carryin; input [n-1:0] X, Y; output [n-1:0] S; output carryout, overflow; reg [n-1:0] S; reg carryout, overflow; or Y or carryin) begin {carryout, S} = X + Y + carryin; overflow = carryout ^ X[n-1] ^ Y[n-1] ^ S[n-1]; end endmodule

Behavioral specification of a full-adder. module fulladd (Cin, x, y, s, Cout); input Cin, x, y; output s, Cout; reg s, Cout; or y or Cin) {Cout, s} = x + y + Cin; endmodule

Final comment Students at University of Toronto have responded very positively to this approach.