Experiment 8 Introduction to VHDL

Similar documents
Experiment 18 Full Adder and Parallel Binary Adder

CSCI Lab 3. VHDL Syntax. Due: Tuesday, week6 Submit to: \\fs2\csci250\lab-3\

EMT1250 LABORATORY EXPERIMENT. EXPERIMENT # 10: Implementing Binary Adders. Name: Date:

CET4805 Component and Subsystem Design II. EXPERIMENT # 2: VHDL(VHSIC Hardware Descriptive Language) Name: Date:

CCE 3202 Advanced Digital System Design

CET4805 Component and Subsystem Design II. EXPERIMENT # 5: Adders. Name: Date:

Concurrent Signal Assignment Statements (CSAs)

EMT1250 LABORATORY EXPERIMENT. EXPERIMENT # 7: VHDL and DE2 Board. Name: Date:

Advanced Electronics Lab.

TESTING ON THE DE2 BOARD

Review. LIBRARY list of library names; USE library.package.object; ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type;

Digital Systems Design

Introduction to VHDL Design on Quartus II and DE2 Board

Laboratory 4 Design a Muti-bit Counter

2/14/2016. Hardware Synthesis. Midia Reshadi. CE Department. Entities, Architectures, and Coding.

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

ELCT 501: Digital System Design

Hardware Description Language VHDL (1) Introduction

1. What is y-chart? ans: The y- chart consists of three domains:- behavioral, structural and geometrical.

EMT1250 LABORATORY EXPERIMENT. EXPERIMENT # 6: Quartus II Tutorial and Practice. Name: Date:

Chapter 6 Combinational-Circuit Building Blocks

Field Programmable Gate Array

Introduction to VHDL #1

EE261: Intro to Digital Design

Hardware Synthesis. References

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

LAB #1 BASIC DIGITAL CIRCUIT

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1

IE1204 Digital Design L7: Combinational circuits, Introduction to VHDL

Digital Systems Design

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 09 MULTIPLEXERS

Digital Systems Design

VHDL 2 Combinational Logic Circuits. Reference: Roth/John Text: Chapter 2

Introduction to VHDL #3

EEL 4783: Hardware/Software Co-design with FPGAs

VHDL. Chapter 1 Introduction to VHDL. Course Objectives Affected. Outline

Chip Design with FPGA Design Tools

LAB 1: Combinational Logic: Designing and Simulation of Arithmetic Logic Unit ALU using VHDL

Arithmetic Circuits. Nurul Hazlina Adder 2. Multiplier 3. Arithmetic Logic Unit (ALU) 4. HDL for Arithmetic Circuit

VHDL Examples Mohamed Zaky

Laboratory Exercise 8

Getting Started with Xilinx WebPack 13.1

VHDL 3 BASIC OPERATORS AND ARCHITECTURE BODY. Design descriptions & design constructions examples are taken from foundation series examples

5. VHDL - Introduction - 5. VHDL - Design flow - 5. VHDL - Entities and Architectures (1) - 5. VHDL - Entities and Architectures (2) -

Logic Implementation on a Xilinx FPGA using VHDL WWU Linux platform assumed. rev 10/25/16

FPGA Introductory Tutorial: Part 1

CMPT 250: Computer Architecture. Using LogicWorks 5. Tutorial Part 1. Somsubhra Sharangi

What Is VHDL? VHSIC (Very High Speed Integrated Circuit) Hardware Description Language IEEE 1076 standard (1987, 1993)

Control and Datapath 8

1 Discussion. 2 Pre-Lab

Lecture 1: VHDL Quick Start. Digital Systems Design. Fall 10, Dec 17 Lecture 1 1

Lecture 3: Modeling in VHDL. EE 3610 Digital Systems

ECE 545 Lecture 5. Data Flow Modeling in VHDL. George Mason University

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

Board-Data Processing. VHDL Exercises. Exercise 1: Basics of VHDL Programming. Stages of the Development process using FPGA s in Xilinx ISE.

ENGIN 241 Digital Systems with Lab

SCHEMATIC DESIGN IN QUARTUS

Digitaalsüsteemide disain

6.111 Lecture # 5. Entity section describes input and output. VHDL: Very High speed integrated circuit Description Language:

UNIVERSITI MALAYSIA PERLIS

Lab 3: Standard Combinational Components

2 nd Year Laboratory. Experiment: FPGA Design with Verilog. Department of Electrical & Electronic Engineering. Imperial College London.

PART I BASIC DIGITAL CIRCUITS

Digital Design Using VHDL Using Xilinx s Tool for Synthesis and ModelSim for Verification

PART 1. Simplification Using Boolean Algebra

CSC / EE Digital Systems Design. Summer Sample Project Proposal 01

CCE 3202 Advanced Digital System Design

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks.

Chapter 2 Getting Hands on Altera Quartus II Software

Lab 3. Advanced VHDL

Lab 2 EECE473 Computer Organization & Architecture University of Maine

Tri-State Bus Implementation

Chapter 2 Basic Logic Circuits and VHDL Description

EEL 4712 Digital Design Test 1 Spring Semester 2008

Lab 6: Integrated the Decoder with Muti-bit Counter and Programming a FPGA

ECSE-323 Digital System Design. Lab #1 Using the Altera Quartus II Software Fall 2008

QUARTUS II Altera Corporation

Mid-Term Exam Solutions

UNIT I Introduction to VHDL VHDL: - V -VHSIC, H - Hardware, D - Description, L Language Fundamental section of a basic VHDL code Library :

Using Library Modules in VHDL Designs. 1 Introduction. For Quartus II 12.1

ECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University

Basic Language Concepts

Introduction to VHDL. Main language concepts

Exercise Sheet 3 (10 Points)

E85: Digital Design and Computer Engineering Lab 2: FPGA Tools and Combinatorial Logic Design

Combinational Digital Design. Laboratory Manual. Experiment #3. Boolean Algebra Continued

Logic and Computer Design Fundamentals VHDL. Part 1 Chapter 4 Basics and Constructs

QUESTION BANK FOR TEST

LABORATORY # 6 * L A B M A N U A L. Datapath Components - Adders

Experiment 0 OR3 Gate ECE 332 Section 000 Dr. Ron Hayne June 8, 2003

Declarations of Components and Entities are similar Components are virtual design entities entity OR_3 is

VHDL. Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit

Physics 536 Spring Illustrating the FPGA design process using Quartus II design software and the Cyclone II FPGA Starter Board.

VHDL for FPGA Design. by : Mohamed Samy

Mridula Allani Fall Fall

CPE 200L LABORATORY 4: INTRODUCTION TO DE2 BOARD UNIVERSITY OF NEVADA, LAS VEGAS GOALS: BACKGROUND:

Laboratory Exercise 1

Hardware Modeling. VHDL Basics. ECS Group, TU Wien

Transcription:

Experiment 8 Introduction to VHDL Objectives: Upon completion of this laboratory exercise, you should be able to: Enter a simple combinational logic circuit in VHDL using the Quartus II Text Editor. Assign a target device and pin numbers and compile a VHDL design file. Write simulation criteria for a VHDL design entity and create a simulation to verify the correctness of the design. Download the file to an Altera CPLD on the Aletera DE1 board. Lab Reference and Equipment Required: Dueck, Robert K., Digital Design with CPLD Applications and VHDL, 2/e Chapter 5: Introduction to VHDL CPLD Trainer: Altera DE1 board development kit Quartus II Web Edition Software Experimental Notes VHDL stands for VHSIC Hardware Description Language (VHSIC = Very High Speed Integrated Circuit). VHDL is an industry-standard programming language for simulation and synthesis of digital circuits. In this lab, we will use VHDL to enter the designs for some simple combinational logic circuits, using VHDL constructs for Boolean equations and truth tables. Every VHDL design requires an entity declaration, which describes the inputs and outputs of the design, and an architecture body, which describes the internal relationship between inputs and outputs. Within the architecture body, we can use many different language statements to describe our design. We will use two of the simplest: a concurrent signal assignment statement, which can be used to implement a Boolean expression, and a selected signal assignment statement, which can be used, among other things, to implement a truth table. Figure 8.1 shows the majority vote circuit constructed in Lab 7. The circuit has the Boolean expression Y = AB + AC + BC. The output is HIGH if at least two out of

three inputs are HIGH. A concurrent signal assignment statement would encode this equation as follows: y <= (A and B) or (A and C) or (B and C); A B AND2 inst AND2 OR3 OUTPUT Y inst1 AND2 inst3 C inst2 The complete VHDL file is as follows: Figure 8.1: Majority Vote Circuit. Examine the following VHDL program, but do not enter it in the Quartus II text editor. It is only an example. majority_vote_vhdl.vhd Majority vote circuit using a concurrent signal assignment statement LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY majority_vote_vhdl IS PORT( a, b, c : IN STD_LOGIC; y : OUT STD_LOGIC); END majority_vote_vhdl; ARCHITECTURE a OF majority_vote_vhdl IS BEGIN y < = (a and b) or (a and c) or (b and c); END a; Refer to Section 5.1 in Digital Design with CPLD Applications and VHDL, 2/e for a more detailed description of the various parts of this design file. Encoding a Truth Table in VHDL We can encode a truth table in VHDL by using a selected signal assignment statement. Examine the truth table in Table 8.1.

D2 D1 D0 Y 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 1 0 0 1 1 1 0 Table 8.1 Sample Truth Table In the entity declaration of a VHDL file, we can define the combined input values of D2,D1, and D0 as a 3-bit vector of type STD_LOGIC_VECTOR: d: IN STD_LOGIC_VECTOR(2 downto 0); This truth table can be encoded by the following selected signal assignment statement: WITH d SELECT y <= 1 WHEN 001, 1 WHEN 010, 1 WHEN 100, 0 WHEN others; The output value is shown on the left side of each line of the statement and the corresponding input combinations on the right side. The others clause specifies the default value of the output, which in this case is 0. This method is much simpler for cases that would otherwise require encoding a long and difficult-to-read Boolean expression. The complete VHDL file is shown next. table1.vhd Truth table, encoded using a selected signal assignment statement LIBRARY ieee; USE ieee.std_logic_1164.all; ENTITY table1 IS PORT( d: IN STD_LOGIC_VECTOR (2 downto 0); y: OUT STD_LOGIC); END table1; ARCHITECTURE a OF table1 IS

BEGIN WITH d SELECT y <= 1 WHEN 001, 1 WHEN 010, 1 WHEN 100, 0 WHEN others; END a; Simulating a VHDL Design Entity In order to verify the correctness of our VHDL design, we should create a simulation using the Quartus II Waveform Editor. To do so, first we should examine our design, determine the way it should operate, and derive a set of simulation criteria for the design. We can then use these criteria to create our simulation waveforms. For example, write a set of simulation criteria for the majority vote circuit example and use it to make the simulation waveforms for the design entity. For many combinational circuits, a simple set of criteria involves examining the output under all input conditions, that is, taking its truth table. Simulation Criteria Group the inputs together as a single unit: d[2..0]. Apply an increasing binary count, from 000 to 111, to the d[2..0] group. The output, y, should go HIGH for input values 011, 101, 110, and 111, the states where at least two of the three inputs are HIGH. Figure 8.2 shows the simulation waveforms that fulfill these conditions. The mechanics of creating this simulation are described in Section 5.2 of Digital Design with CPLD Applications and VHDL, 2/e. The two design entities in this lab can be simulated using similar criteria.

Figure 8.2 Majority Vote Simulation Procedure Encoding a Circuit with a Concurrent Signal Assignment Statement Refer to the half-adder circuit shown in Figure 8.3. A XOR OUTPUT sum inst AND2 B inst1 OUTPUT carry _out Figure 8.3 Half-Adder Circuit Design Entry Create a new folder called drive:\qdesigns\labs\lab08\half_add\. Use the Quartus II Text Editor to enter the VHDL file for the half-adder circuit, using a concurrent signal assignment statement, as described in the Experimental Notes for this lab exercise.

Save the file as drive:\qdesigns\labs\lab08\half_add\half_add.vhd and use the file to create a project in Quartus II. (Make sure that the box labeled Create new project based on this file is checked.) In the New Project Wizard, assign the target device as EP2C20F484C7. From the Assignments menu, select Assign pins. Assign the pin numbers in Table 8.2 to the circuit inputs and outputs, choosing the column that pertains to your DE1 board. When you have finished assigning the pin numbers, compile the project. Simulation Pin Name DE1 Board Description A PIN_L2 Toggle Switch[9] B PIN_M1 Toggle Switch[8] Sum PIN_R17 LED Red[9] Carry_out PIN_R18 LED Red[8] Table 8.2 Pin Assignments for Half-Adder Write a set of simulation criteria for the half-adder function. Simulation Criteria: Use the simulation criteria to create a Quartus II simulation for the half-adder. Programming the CPLD Board Download the project to your CPLD trainer board. Connect two DIP switches to inputs a and b and two LED indicators to outputs carry_out and sum. Close the project for the half adder by selecting Close Project from the File menu. Encoding a Circuit with a Selected Signal Assignment Statement Examine the SOP logic gate network shown in Figure 8.4. Inputs are labeled d3, d2, d1, d0.

Write the Boolean expression of the logic gate network shown in Figure 8.3. Note that the Boolean expression is already in its simplest SOP form. Because this equation would be difficult to read (and code) in VHDL, we will use a selected signal assignment statement to encode the circuit s truth table. Design Entry Create a new folder called drive:\qdesigns\labs\lab08\sop1\. Write a VHDL file for the logic gate network in Figure 8.4, using a selected signal assignment statement to encode its truth table. Write the d inputs as a single variable of type STD_LOGIC_VECTOR. Save the file as drive:\qdesigns\labs\lab08\sop1\sop1.vhd and use this file to create a new project in Quartus II. In the New Project Wizard, assign the target device as EP2C20F484C7. Assign pin numbers to the VHDL file as shown in Table 8.4. Pin Name Pin Number Description d3 PIN_L2 Toggle Switch[9] d2 PIN_M1 Toggle Switch[8] d1 PIN_M2 Toggle Switch[7] d0 PIN_U11 Toggle Switch[6] y PIN_R17 LED Red[9] Table 8.4 Pin Assignments for Figure 8.4

Simulation Figure 8.4 Sum-of-Products Logic Gate Network Write a set of simulation criteria for the SOP function in your VHDL file. Simulation Criteria: Use the simulation criteria to create a Quartus II simulation for the VHDL design entity. Programming the CPLD Board Download the project to your DE1 board.

Write the truth table for the circuit in Figure 8.4. Close the project for the SOP circuit by selecting Close Project from the File menu.