Prof. Onur Mutlu ETH Zurich Spring March 2019

Slides:



Advertisements
Similar presentations
Digital Circuits. Review – Getting the truth table The first step in designing a digital circuit usually is to get the truth table. That is, for every.
Advertisements

The Verilog Hardware Description Language
Supplement on Verilog adder examples
Verilog Descriptions of Digital Systems
CPEN Digital System Design
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.
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 
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.
ENGIN112 L38: Programmable Logic December 5, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 38 Programmable Logic.
ENEE 408C Lab Capstone Project: Digital System Design Spring 2005 Class Web Site: e408c.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 3 – Combinational Logic Design Part 1 –
CS 151 Digital Systems Design Lecture 38 Programmable Logic.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 3 – Combinational Logic Design Part 1 –
DIGITAL DESIGN WITH VHDL Exercise 1 1Muhammad Amir Yousaf.
CSET 4650 Field Programmable Logic Devices Dan Solarek VHDL Behavioral & Structural.
Introduction to Basys 2. Switches Slide switchesPush button switches.
Adders and Multipliers Review. ARITHMETIC CIRCUITS Is a combinational circuit that performs arithmetic operations, e.g. –Addition –Subtraction –Multiplication.
Introduction to FPGA AVI SINGH. Prerequisites Digital Circuit Design - Logic Gates, FlipFlops, Counters, Mux-Demux Familiarity with a procedural programming.
ECE 3130 – Digital Electronics and Design
ECE 2372 Modern Digital System Design
Combinational Logic. Digital Circuits Introduction Logic circuits for digital systems may be combinational or sequential. A combinational circuit.
Introduction Verilog is a HARDWARE DESCRIPTION LANGUAGE (HDL) A hardware description language is a language or means used to describe or model a digital.
CPEN Digital System Design
Logic Gates Logic gates are electronic digital circuit perform logic functions. Commonly expected logic functions are already having the corresponding.
EEE2243 Digital System Design Chapter 3: Verilog HDL (Combinational) by Muhazam Mustapha, January 2011.
Module 1.2 Introduction to Verilog
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
Chapter 2: Structural Modeling Digital System Designs and Practices Using Verilog HDL and 2008~2010, John Wiley 2-1 Chapter 2a: Structural Modeling.
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.
Teaching Digital Logic courses with Altera Technology
COE 202 Introduction to Verilog Computer Engineering Department College of Computer Sciences and Engineering King Fahd University of Petroleum and Minerals.
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.
Introduction to Verilog COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals.
Introduction to the FPGA and Labs
Hardware Description Languages: Verilog
Introduction to Verilog
Verilog-HDL-1 by Dr. Amin Danial Asham.
Multiplexer.
Hardware Description Languages: Verilog
Combinational Circuits
Computer Architecture CST 250
XOR, XNOR, and Binary Adders
Introduction to Verilog
Logic Gates Practical Objective: to develop an understanding of logic circuits and truth tables.
Introduction to Verilog
FIGURE 4.1 Block diagram of combinational circuit
Structural style Modular design and hierarchy Part 1
XOR, XNOR, & Binary Adders
Instructor: Alexander Stoytchev
Digital Logic.
Digital Logic.
Introduction to Verilog
XOR, XNOR, and Binary Adders
Introduction to Verilog
The Verilog Hardware Description Language
XOR Function Logic Symbol  Description  Truth Table 
Introduction to Verilog
Design of Digital Circuits Lab 6 Supplement: Testing the ALU
Design of Digital Circuits Lab 5 Supplement: Implementing an ALU
Prof. Onur Mutlu ETH Zurich Spring March 2019
Design of Digital Circuits Lab 1 Supplement: Drawing Basic Circuits
Design of Digital Circuits Lab 8 Supplement: Full System Integration
Digital Circuits.
Adder and Subtractors Discussion D4.1. Adder and Subtractor Circuits Objective: (i) To construct half and full adder circuit and verify its working (ii)
XOR, XNOR, and Binary Adders
COE 202 Introduction to Verilog
(Lecture by Hasan Hassan)
Presentation transcript:

Prof. Onur Mutlu ETH Zurich Spring 2019 12 March 2019 Design of Digital Circuits Lab 2 Supplement: Mapping Your Circuit to FPGA Prof. Onur Mutlu ETH Zurich Spring 2019 12 March 2019

What Will We Learn? In Lab 2, you will learn how to map your circuits to an FPGA. Design a 4-bit adder. Design a 1-bit full-adder. Use full-adders to design a 4-bit adder. Program your FPGA using Vivado software for HDL design. Work with your FPGA board and see the results of your designs on the FPGA output (in this case LEDs).

Design an Adder (I) Design a full-adder: Receives two 1-bit numbers A and B and a 1-bit input carry (C_in), and returns outputs S and C as sum and carry of the operation, respectively. Example: A = 1, B =1, C_in=1 S = 1 C = 1 Sum ‘S’ 1-bit Full-adder A 1-bit B 1-bit C_in Carry ‘C’

Design an Adder (II) Design a 4-bit adder: Receives two 1-bit numbers A and B and a 1-bit input carry (C_in), and returns outputs S and C as sum and carry of the operation, respectively. Example: A = 1110, B =0001, C_in=1 S = 0000 C = 1 Hint: Use four full-adders to design a 4-bit adder.

Design an Adder (Overview) You will use truth tables to derive the Boolean equation of the adder. You will design the schematic of the circuit using logic gates. In the next step, you will use Vivado to write your design in Verilog. In the end, you will use Vivado to program the FPGA.

Vivado For this course, we use the software Vivado for FPGA programming. The computers in the lab rooms are already installed with the necessary software. If you wish to use your own computer, you can refer to the following instructions:  https://reference.digilentinc.com/learn/programmable-logic/tutorials/basys-3-getting-started/start

Verilog

Defining a Module in Verilog A module is the main building block in Verilog. We first need to define: Name of the module Directions of its ports (e.g., input, output) Names of its ports Then: Describe the functionality of the module. example inputs output

Implementing a Module in Verilog example name of module Port list (inputs and outputs) module example (a, b, c, y); input a; input b; input c; output y; // here comes the circuit description endmodule ports have a declared type a module definition

Structural HDL: Instantiating a Module i_first i_second TODO: make I consistent Schematic of module “top” that is built from two instances of module “small”

Structural HDL Example (1) Module Definitions in Verilog module top (A, SEL, C, Y); input A, SEL, C; output Y; wire n1; endmodule i_first i_second module small (A, B, Y); input A; input B; output Y; // description of small endmodule

Structural HDL Example (2) Defining wires (module interconnections) module top (A, SEL, C, Y); input A, SEL, C; output Y; wire n1; endmodule i_first i_second module small (A, B, Y); input A; input B; output Y; // description of small endmodule

Structural HDL Example (3) The first instantiation of the “small” module module top (A, SEL, C, Y); input A, SEL, C; output Y; wire n1; // instantiate small once small i_first ( .A(A), .B(SEL), .Y(n1) ); endmodule i_first i_second module small (A, B, Y); input A; input B; output Y; // description of small endmodule

Structural HDL Example (4) The second instantiation of the “small” module module top (A, SEL, C, Y); input A, SEL, C; output Y; wire n1; // instantiate small once small i_first ( .A(A), .B(SEL), .Y(n1) ); // instantiate small second time small i_second ( .A(n1), .B(C), .Y(Y) ); endmodule i_first i_second module small (A, B, Y); input A; input B; output Y; // description of small endmodule

Structural HDL Example (5) Short form of module instantiation module top (A, SEL, C, Y); input A, SEL, C; output Y; wire n1; // alternative small i_first ( A, SEL, n1 ); /* Shorter instantiation, pin order very important */ // any pin order, safer choice small i_second ( .B(C), .Y(Y), .A(n1) ); endmodule i_first i_second module small (A, B, Y); input A; input B; output Y; // description of small endmodule

 Basys 3 FPGA Board   In this course, we will be using the Basys 3 boards from Digilent, as shown below. You can learn more about the Basys 3 Starter Board from: http://store.digilentinc.com/basys-3-artix-7-fpga-trainer-board-recommended-for-introductory-users/ For this Lab: Output LEDs Input Switches

Last Words In this lab, you will map your circuit to an FPGA. First you will design a 4-bit adder. Then, you will learn how to use Xilinx Vivado for writing Verilog and how to connect to the Basys 3 board. Finally, you will program the FPGA and get the circuit running on the FPGA board. You will find more exercises in the lab report.

Prof. Onur Mutlu ETH Zurich Spring 2019 12 March 2019 Design of Digital Circuits Lab 2 Supplement: Mapping Your Circuit to FPGA Prof. Onur Mutlu ETH Zurich Spring 2019 12 March 2019