FACULTY OF ENGINEERING LAB SHEET

Similar documents
Implementation of Web-Server Using Altera DE2-70 FPGA Development Kit

Quartus II Introduction Using VHDL Design

Introduction to the Altera Qsys System Integration Tool. 1 Introduction. For Quartus II 12.0

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

Quartus II Introduction for VHDL Users

LAB #3 VHDL RECOGNITION AND GAL IC PROGRAMMING USING ALL-11 UNIVERSAL PROGRAMMER

The 104 Duke_ACC Machine

9/14/ :38

Lab 1: Introduction to Xilinx ISE Tutorial

RAPID PROTOTYPING OF DIGITAL SYSTEMS Second Edition

EXPERIMENT 8. Flip-Flops and Sequential Circuits

2. Scope of the DE0 Board and Supporting Material

Quartus II Software Design Series : Foundation. Digitale Signalverarbeitung mit FPGA. Digitale Signalverarbeitung mit FPGA (DSF) Quartus II 1

Chapter 1 DE2 115 Package Package Contents The DE2-115 Board Assembly...5. Chapter 2 Introduction of the Altera DE2 115 Board...

Modeling Latches and Flip-flops

Introduction to Programmable Logic Devices. John Coughlan RAL Technology Department Detector & Electronics Division

CHAPTER 11: Flip Flops

Von der Hardware zur Software in FPGAs mit Embedded Prozessoren. Alexander Hahn Senior Field Application Engineer Lattice Semiconductor

Using Altera MAX Series as Microcontroller I/O Expanders

Building an Embedded Processor System on a Xilinx Zync FPGA (Profiling): A Tutorial

Using Xilinx ISE for VHDL Based Design

Pre-tested System-on-Chip Design. Accelerates PLD Development

Altera Error Message Register Unloader IP Core User Guide

Physics 226 FPGA Lab #1 SP Wakely. Terasic DE0 Board. Getting Started

Design of Remote Laboratory dedicated to E2LP board for e-learning courses.

LiveDesign Evaluation Board Technical Reference Manual. Technical reference manual for Altium s LiveDesign Evaluation Boards

Lab 1: Full Adder 0.0

7a. System-on-chip design and prototyping platforms

CSE467: Project Phase 1 - Building the Framebuffer, Z-buffer, and Display Interfaces

Digital Systems Design. VGA Video Display Generation

Hardware Implementation of the Stone Metamorphic Cipher

VHDL GUIDELINES FOR SYNTHESIS

Soft processors for microcontroller programming education

Ping Pong Game with Touch-screen. March 2012

EC313 - VHDL State Machine Example

DE4 NetFPGA Packet Generator Design User Guide

Technical Aspects of Creating and Assessing a Learning Environment in Digital Electronics for High School Students

SPI Flash Programming and Hardware Interfacing Using ispvm System

Open Flow Controller and Switch Datasheet

Modeling Registers and Counters

Xilinx ISE. <Release Version: 10.1i> Tutorial. Department of Electrical and Computer Engineering State University of New York New Paltz

RCC2 Test Proceedures

USB - FPGA MODULE (PRELIMINARY)

MP3 Player CSEE 4840 SPRING 2010 PROJECT DESIGN.

Implementation Details

Nios II Development Kit Version 5.1 SP1 Release Notes

Combinational-Circuit Building Blocks

PHYS 2P32 Project: MIDI for Arduino/ 8 Note Keyboard

Jianjian Song LogicWorks 4 Tutorials (5/15/03) Page 1 of 14

MAX II ISP Update with I/O Control & Register Data Retention

HARDWARE MANUAL. BrightSign HD120, HD220, HD1020. BrightSign, LLC Lark Ave., Suite 200 Los Gatos, CA

CP2110-EK CP2110 EVALUATION KIT USER S GUIDE. 1. Kit Contents. 2. Relevant Documentation. 3. Software Setup

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

Engineering Change Order (ECO) Support in Programmable Logic Design

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

Aims and Objectives. E 3.05 Digital System Design. Course Syllabus. Course Syllabus (1) Programmable Logic

Computer Organization and Components

Creating a Webserver on the Nios development kit Stratix Edition board Enoch Hwang

DEVELOPMENT OF DEVICES AND METHODS FOR PHASE AND AC LINEARITY MEASUREMENTS IN DIGITIZERS

Agenda. Michele Taliercio, Il circuito Integrato, Novembre 2001

Digital Design with VHDL

PCB Project (*.PrjPcb)

International Journal of Scientific & Engineering Research, Volume 4, Issue 6, June ISSN

Fondamenti su strumenti di sviluppo per microcontrollori PIC

USB-Blaster Download Cable User Guide

ECE232: Hardware Organization and Design. Part 3: Verilog Tutorial. Basic Verilog

DDS. 16-bit Direct Digital Synthesizer / Periodic waveform generator Rev Key Design Features. Block Diagram. Generic Parameters.

ECE 3401 Lecture 7. Concurrent Statements & Sequential Statements (Process)

Chapter 9 Latches, Flip-Flops, and Timers

Hardware Implementation of Improved Adaptive NoC Router with Flit Flow History based Load Balancing Selection Strategy

Design of a High Speed Communications Link Using Field Programmable Gate Arrays

Serial Communications

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

Active Learning in the Introduction to Digital Logic Design Laboratory Course

16-bit ALU, Register File and Memory Write Interface

Laboratory VHDL introduction

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

BE635 User Manual. Rev. V Bolymin, Inc. All Rights Reserved.

Chapter 2 Logic Gates and Introduction to Computer Architecture

Programming A PLC. Standard Instructions

Lab Experiment 1: The LPC 2148 Education Board

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

VHDL Test Bench Tutorial

Chapter 6. Inside the System Unit. What You Will Learn... Computers Are Your Future. What You Will Learn... Describing Hardware Performance

Printed Circuit Board Design with HDL Designer

Lesson 12 Sequential Circuits: Flip-Flops

An Introduction to MPLAB Integrated Development Environment

Getting Started with the Xilinx Zynq All Programmable SoC Mini-ITX Development Kit

GETTING STARTED WITH PROGRAMMABLE LOGIC DEVICES, THE 16V8 AND 20V8

A First Course in Digital Design Using VHDL and Programmable Logic

A Verilog HDL Test Bench Primer Application Note

Finite State Machine Design A Vending Machine

Lab 1 Course Guideline and Review

Introduction to CMOS VLSI Design (E158) Lecture 8: Clocking of VLSI Systems

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995

VTR-1000 Evaluation and Product Development Platform. User Guide SOC Technologies Inc.

The Advanced JTAG Bridge. Nathan Yawn 05/12/09

ASYNCHRONOUS COUNTERS

Transcription:

FACULTY OF ENGINEERING LAB SHEET DIGITAL COMPUTER DESIGN ECE4116 TRIMESTER 3 (2015/2016) : Introduction to VHDL Design on Quartus II and DE1 Board *Note: On-the-spot evaluation may be carried out during or at the end of the experiment. Students are advised to read through this lab sheet before doing experiment. Your performance, teamwork effort, and learning attitude will count towards the marks.

Lab Experiment Duration: 3 hours Introduction to VHDL Design on Quartus II and DE1 Board Objective To learn how to create projects using Quartus II, design circuits and simulate them in the software. To implement the designed circuits on the DE1 Board. Introduction Quartus II is a Computer Aided Design (CAD) system by Altera Corporation which includes full support for all of the popular methods of entering a description of the desired circuit into a CAD system. CAD software makes it easy to implement a desired logic circuit by using a programmable logic device, such as a field-programmable gate array (FPGA) chip. The CAD flow involves the following steps: - Design Entry The desired circuit is specified either by means of a schematic diagram, or by using a hardware description language, such as VHDL or Verilog - Synthesis The entered design is synthesized into a circuit that consists of the logic elements (LEs) provided in the FPGA chip - Functional Simulation The synthesized circuit is tested to verify its functional correctness; this simulation does not take into account any timing issues - Fitting The CAD Fitter tool determines the placement of the LEs defined in the netlist into the LEs in an actual FPGA chip; it also chooses routing wires in the chip to make the required connections between specific LEs - Timing Analysis Propagation delays along the various paths in the fitted circuit are analyzed to provide an indication of the expected performance of the circuit - Timing Simulation The fitted circuit is tested to verify both its functional correctness and timing - Programming and Configuration The designed circuit is implemented in a physical FPGA chip by programming the configuration switches that configure the LEs and establish the required wiring connections Page 1 of 12

Figure 1 shows a typical FPGA CAD flow. Figure 1 Each logic circuit, or subcircuit, being designed with Quartus II software is called a project. The software works on one project at a time and keeps all information for that project in a single directory in the file system. Once a circuit design is completed, it can be compiled and a compilation report is produced. The Quartus II software provides a means to simulate the behavior of the designed circuit for ascertaining its correctness. This step is crucial, before implementing the circuit on the FPGA. A designed circuit can be simulated in two ways: functional and timing. Functional simulation assumes that logic elements and interconnection wires in the FPGA are perfect, thus causing no delay in propagation of signals through the circuit. Timing simulation takes all propagation delays into account. Typically, functional simulation is used to verify the functional correctness of a circuit as it is being designed. Page 2 of 12

The Altera DE1 board features the Cyclone II 2C20 FPGA. All the components on the board are connected to pins of this chip, allowing the user to control all aspects of the board s operation. The specifications: FPGA - Altera Cyclone II EP2C20F484C7 FPGA - EPCS4 serial configuration device I/O Devices - Built-in USB Blaster for FPGA configuration - VGA DAC (4-bit R-2R per channel) with VGA out connector - PS/2 mouse or keyboard connector - 24-bit CD-Quality Audio CODEC with line-in, line-out, and microphone-in jacks - RS-232 Transceiver and 9-pin connector - RS-232 Transceiver and 9-pin connector Memory - 8-MB SDRAM - 512-KB SRAM - 4-MB flash memory - SD memory card slot Switches, LEDs, Displays, and Clocks - 4 push-button switches - 10 toggle switches - 10 red LEDs - 8 green LEDs - Four 7-segment displays - 24-MHz, 27-MHz and 50-MHz oscillators, external clock input The DE1 board can be used to implement circuits designed using the Quartus II CAD system. Page 3 of 12

Exercises Exercise 1: Getting Started with the Switches The DE1 board provides 10 toggle switches, called SW9 0, that can be used as inputs to a circuit, and 10 red lights, called LEDR9 0, that can be used to display output values. Steps: 1. Start the Quartus II program and create a new project using the New Project. Follow each step of the wizard and select Cyclone II EP2C20F484C7 as the target chip, which is the FPGA chip on the Altera DE1 board (see Figure 2). Figure 2 2. Create a VHDL entity (a new VHDL file) and enter the following code: LIBRARY ieee; USE ieee.std_logic_1164.all; -- Simple module that connects the SW switches to the LEDR lights ENTITY part1 IS Page 4 of 12

PORT ( SW : IN STD_LOGIC_VECTOR(9 DOWNTO 0); LEDR : OUT STD_LOGIC_VECTOR(9 DOWNTO 0)); -- red LEDs END part1; ARCHITECTURE Behavior OF part1 IS BEGIN LEDR <= SW; END Behavior; Save the file as part1.vhd in the project directory and include it in the project (see Figure 3). Figure 3 3. Set the pin assignments by importing the file DE1_pin_assignments.csv by selecting Assignments Import Assignments, then selecting the file in the window (see Figures 4) Figure 4 Page 5 of 12

4. Compile the project by selecting Processing Start Compilation. 5. Set the current vhdl file as the top level entity by selecting Project Set as Top-level Entity. 6. Download the compiled circuit into the FPGA chip: a) Connect the DE1 board to the computer using the USB cable. Turn the power on. b) Select Tools Programmer to view the Programmer window (see Figure 5). Ensure the hardware selected is USB-Blaster and the mode is JTAG. c) Click Start. Figure 5 6. Test the functionality of the circuit by toggling the switches and observing the LEDs. Specific Task 1: Describe the behaviour of the LEDs when the switches are toggled. Explain how the observed behaviour verifies the functionality of the circuit. Exercise 2: Multiplexers Part (a) of Figure 6 shows a sum-of-products circuit that implements a 2-to-1 multiplexer with a select input s. If s = 0 the multiplexer s output m is equal to the input x, and if s = 1 the output is equal to y. Part (b) shows the truth table for this multiplexer, and part (c) its circuit symbol. Page 6 of 12

Figure 6 The multiplexer can be described by the following VHDL statement: m <= ( NOT (s) AND x ) OR (s AND y); Figure 7 shows an 4-bit wide 2-to-1 multiplexer. The circuit has two 4-bit inputs X and Y and produces the 4-bit output M. If s = 0 then M = X, while if s = 1 then M = Y. Steps: 1. Create a new Quartus II project for the multiplexer circuit. 2. Include a VHDL file for the 4-bit wide 2-to-1 multiplexer in the project. Use switch SW9 on the DE1 board as the s input, switches SW3 0 as the X input and SW7 4 as the Y input. Connect the SW switches to the red lights LEDR and connect the output M to the green lights LEDG7 0. 3. Import the required pin assignments for the DE1 board as per step 3 of Exercise 1. 4. Compile the project. 5. Download the compiled circuit into the FPGA chip. Test the functionality of the 4-bit wide 2- to-1 multiplexer by toggling the switches and observing the LEDs. Page 7 of 12

Specific Task 2: Write the VHDL entity to describe the circuit in Figure 7 and save as a VHDL file to be included into the project as per step 2. Describe the behaviour of the LEDs when the switches are toggled. Explain how the observed behaviour verifies the functionality of the circuit. x 3 y 3 m 3 x 2 y 2 m 3 4 4 4 Figure 7 Exercise 3: Latches and Flip-flops Part A Altera FPGAs include flip-flops that are available for implementing a user s circuit. However, storage elements can be created in an FPGA without using its dedicated flip-flops. Figure 8 depicts a gated RS latch circuit. A style of VHDL code that uses logic expressions to describe this circuit is given is as follows: - - A gated RS latch LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY ls_latch IS PORT (Clk, R, S : IN STD_LOGIC; Q : OUT STD_LOGIC); END ls_latch; ARCHITECTURE Structural OF ls_latch IS SIGNAL R_g, S_g, Qa, Qb : STD_LOGIC ; ATTRIBUTE keep : boolean; Page 8 of 12

ATTRIBUTE keep of R_g, S_g, Qa, Qb : SIGNAL IS true; BEGIN R_g <= R AND Clk; S_g <= S AND Clk; Qa <= NOT (R_g OR Qb); Qb <= NOT (S_g OR Qa); Q <= Qa; END Structural; Figure 8 To preserve internal signals such as R-g and S_g in the implemented circuit, it is necessary to include a compiler directive in the code. The directive keep is included by using a VHDL ATTRIBUTE statement. It instructs the Quartus II compiler to use separate logic elements for each of the signals R_g, S_g,Qa, and Qb. Compiling the code produces the circuit with four 4- input lookup tables (LUTs) as shown in Figure 9. Figure 9 Page 9 of 12

Figure 10 shows the circuit for a gated D latch. Steps: 1. Create a new Quartus II project. Figure 10 2. Write a VHDL file, using the style of the LS latch code given, for the gated D latch. Use the keep directive to ensure that separate logic elements are used to implement the signals R, S_g,R_g,Qa, and Qb. 3. Select as target chip the Cyclone II EP2C20F484C7 and compile the code. Examine the implemented circuit by selecting Tools Netlist Viewers RTL Viewer. 4. Create another new Quartus II project which will be used for implementation of the gated D latch on the DE1 board. This project should consist of a top-level entity that contains the appropriate input and output ports (pins) for the DE1 board. Instantiate the latch in this toplevel entity. Use switch SW0 to drive the D input of the latch, and use SW1 as the Clk input. Connect the Q output to LEDR0. 5. Recompile the project and download the compiled circuit onto the DE1 board. Test the functionality of your circuit by toggling the D and Clk switches and observing the Q output. Specific Task 3a: Write the VHDL file for the gated D latch in Figure 10 as specified in step 2. Describe the Q output when D and Clk switches are toggled. Explain how the observed behaviour verifies the functionality of the circuit. Page 10 of 12

Part B Figure 11 shows the circuit for a master-slave D flip-flop. To simulate the circuit, perform the following steps. Steps: 1. Create a new Quartus II project. Generate a VHDL file that instantiates two copies of your gated D latch entity from Part A to implement the master-slave flip-flop. 2. Include in your project the appropriate input and output ports for the Altera DE1 board. Use switch SW 0 to drive the D input of the flip-flop, and use SW1 as the Clock input. Connect the Q output to LEDR0. 3. Compile your project and use the RTL Viewer to examine the D flip-flop circuit. 4. Download the circuit onto the DE1 board and test its functionality by toggling the D and Clock switches and observing the Q output. Figure 11 Specific Task 3b: Generate the VHDL file for the master-slave flip-flop in Figure 11 as specified in step 1. Describe the Q output when D and Clock switches are toggled. Explain how the observed behaviour verifies the functionality of the circuit. Page 11 of 12

Report writing guidelines Your lab report must be typed and must contain the following sections: Report cover page Use the report cover page format in the FOE lab website. Download the template at http://foe.mmu.edu.my/lab/sr.htm Brief Introduction Write a short description in your own words about the experiment, including the objectives. Do not reproduce the text / steps in this lab sheet. Results and Discussion Provide the VHDL codes and subsequent observations listed under Specific Task for all the exercises. Discuss and/or analyse the results. Conclusion Conclude your report with a brief summary on the knowledge and skills that you have acquired from this lab. *Exercises are adapted from Altera s support documents for Quartus II and DE1 Boards. Page 12 of 12