BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.

Slides:



Advertisements
Similar presentations
INTRO TO VHDL Appendix A: page page VHDL is an IEEE and ANSI standard. VHDL stands for Very High Speed IC hardware description language.
Advertisements

IntroductionIntroduction  Computer program: an ordered sequence of statements whose objective is to accomplish a task.  Programming: process of planning.
VHDL ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
Introduction to VHDL (Lecture #5) ECE 331 – Digital System Design The slides included herein were taken from the materials accompanying Fundamentals of.
Comprehensive VHDL Module 6 Types November Comprehensive VHDL: Types Copyright © 2000 Doulos Types Aim ©To understand the use and synthesis.
VHDL Data Types Module F3.1. VHDL Data Types Scalar Integer Enumerated Real (floating point)* Physical* Composite Array Record Access (pointers)* * Not.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
VHDL And Synthesis Review. VHDL In Detail Things that we will look at: –Port and Types –Arithmetic Operators –Design styles for Synthesis.
CS 3850 Lecture 5 Operators. 5.1 Binary Arithmetic Operators Binary arithmetic operators operate on two operands. Register and net (wire) operands are.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
第6章 VHDL NUMBERS, STRINGS, AND EXPRESSIONS 義守大學電機工程學系 陳慶瀚
JavaScript, Fourth Edition
JavaScript, Third Edition
1 Data Object Object Types A VHDL object consists of one of the following: –Signal, Which represents interconnection wires that connect component instantiation.
1 Data Object Object Types A VHDL object consists of one of the following: –Signal, Which represents interconnection wires that connect component instantiation.
Concordia University 1 Lecture #8 In this lecture we will cover the following material: The standard package, The std_logic_1164  Objects & data Types.
George Mason University Modeling of Arithmetic Circuits ECE 545 Lecture 7.
Java Primitives The Smallest Building Blocks of the Language (corresponds with Chapter 2)
1 Part I: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
Verilog Language Concepts
IAY 0600 Digital Systems Design
Capt Michael Tanner Room 2F46A
RTL Hardware Design by P. Chu Chapter Basic VHDL program 2. Lexical elements and program format 3. Objects 4. Data type and operators RTL Hardware.
IAY 0600 Digital Systems Design VHDL discussion Dataflow&Behavioral Styles Combinational Design Alexander Sudnitson Tallinn University of Technology.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHDL – Basic Language Elements  Identifiers: –basic identifier: composed of a sequence of one or more.
Lecture #8 Page 1 Lecture #8 Agenda 1.VHDL : Operators 2.VHDL : Signal Assignments Announcements 1.HW #4 assigned ECE 4110– Digital Logic Design.
Lecture 5 Chap 6 Package std_logic_arith Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
HARDWARE DESCRIPTION LANGUAGE (HDL). What is HDL? A type of programming language for sampling and modeling of electronic & logic circuit designs It can.
VHDL Basics. VHDL BASICS 2 OUTLINE –Component model –Code model –Entity –Architecture –Identifiers and objects –Operations for relations VHDL ET062G &
EE3A1 Computer Hardware and Digital Design Lecture 2 Introduction to VHDL.
Lecture #7 Page 1 Lecture #7 Agenda 1.VHDL Data Types Announcements 1.n/a ECE 4110– Digital Logic Design.
Chapter 5 Introduction to VHDL. 2 Hardware Description Language A computer language used to design circuits with text-based descriptions of the circuits.
IAY 0600 Digital Systems Design VHDL discussion Dataflow Style Combinational Design Alexander Sudnitson Tallinn University of Technology.
IAY 0600 Digital Systems Design
16/11/2006DSD,USIT,GGSIPU1 Packages The primary purpose of a package is to encapsulate elements that can be shared (globally) among two or more design.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
ECOM 4311—Digital System Design with VHDL
ECOM 4311—Digital System Design with VHDL
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VHDL Coding for Synthesis ECE 448 Lecture 12.
VHDL Programming Fundamentals Presented By Dr. Pradyut Kumar Biswal Department of Electronics, IIIT Bhubaneswar.
CEC 220 Digital Circuit Design Introduction to VHDL Friday, February 21 CEC 220 Digital Circuit Design Slide 1 of 10.
Number Representation and Arithmetic Circuits
Lecture #8 Page 1 Lecture #8 Agenda 1.VHDL : Operators 2.VHDL : Signal Assignments Announcements 1.HW #4 assigned ECE 4110– Sequential Logic Design.
VHDL Tutorial.
Java Basics. Tokens: 1.Keywords int test12 = 10, i; int TEst12 = 20; Int keyword is used to declare integer variables All Key words are lower case java.
EGRE 6311 LHO 04 - Subprograms, Packages, and Libraries EGRE 631 1/26/09.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
IAY 0600 Digital Systems Design
Combinational logic circuit
VHDL Basics.
Data Types, Identifiers, and Expressions
ECE 4110–5110 Digital System Design
IAS 0600 Digital Systems Design
CPE 528: Session #7 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
ECE 434 Advanced Digital System L17
CHAPTER 10 Introduction to VHDL
Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Character Set Uppercase Alphabets A,
Advanced FPGA Based System Design
ECE 434 Advanced Digital System L10
Concurrent vs Sequential
IAS 0600 Digital Systems Design
IAS 0600 Digital Systems Design
VHDL Data Types Module F3.1.
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1

BASIC VHDL LANGUAGE ELEMENTS 2 1. Comments 2. Identifiers 3. Data Objects 4. Data Types 5. VHDL Operators 6. VDHL Design Entity

BASIC VHDL LANGUAGE ELEMENTS 3 1. Comments 2. Identifiers 3. Data Objects 4. Data Types 5. VHDL Operators 6. VDHL Design Entity

1. Comments 4 Comments are preceded by two consecutive hyphens (--) and are terminated at the end of the line. Example: -- This is a comment

BASIC VHDL LANGUAGE ELEMENTS 5 1. Comments 2. Identifiers 3. Data Objects 4. Data Types 5. VHDL Operators 6. VDHL Design Entity

2.Identifiers 6 VHDL identifier syntax: A sequence of one or more uppercase letters, lowercase letters, digits, and the underscore. Upper and lowercase letters are treated the same (i.e., case insensitive). The first character must be a letter. The last character cannot be the underscore Two underscores cannot be together. Identifier values and numbers: 1. Individual logic signals ‘0’, ‘1’ 2. Multiple logic signal “01110”

BASIC VHDL LANGUAGE ELEMENTS 7 1. Comments 2. Identifiers 3. Data Objects 4. Data Types 5. VHDL Operators 6. VDHL Design Entity

3. Data Objects 8 There are three kinds of data objects: SIGNALs, VARIABLEs, and CONSTANTs. 3.1 SIGNAL Data Objects 3.2 VARIABLE Data Objects 3.3 CONSTANT Data Objects

3.1 SIGNAL Data Objects 9 SIGNAL data objects represent logic signals on a wire in the circuit. SIGNALs are used for communication between components. A signal does not have memory; thus, if the source of the signal is removed, the signal will not have a value. There are three places in which SIGNALs can be declared in VHDL code: 1. ENTITY declaration. 2. Declarative part of ARCHITECTURE. 3. Declarative part of PACKAGE. CONT………..

3.1 SIGNAL Data Objects 10 General form of SIGNAL declaration: SIGNAL signal_name, signal_name,.…….. : type name;

3.2 VARIABLE Data Objects 11 A VARIABLE; unlike SIGNAL; does not represent a signal on a wire in the circuit. VARIABLE data objects are sometimes used to hold results of computation and for index variables in the loops. VARIABLES can be declared only inside the declarative part of PROCESS. General form of VARIABLE declaration: VARIABLE variable_name, variable_name, ……. : type_name;

3.3 CONSTANT Data Objects 12 The CONSTANT data objects must be initialized with a value when declared and this value cannot be changed. CONSTANT can be declared only inside the declarative part of ARCHITECTURE. General form of CONSTANT declaration: CONSTANT constant_name: type_name:=constant value;

Example of Data Objects 13 SIGNAL x: BIT; VARIABLE y: INTEGER; CONSTANT one: STD_LOGIC_VECTOR (3 DOWNTO 0):= "0001";

BASIC VHDL LANGUAGE ELEMENTS Comments 2. Identifiers 3. Data Objects 4. Data Types 5. VHDL Operators 6. VDHL Design Entity

4. Data Types 15 The VHDL data types are: 1. BIT and BIT_VECTOR Data Type 2. STD_LOGIC and STD_LOGIC_VECTOR Data Type 3. SIGNED and UNSIGNED Data Type 4. INTEGER Data Type 5. BOOLEAN Data Type 6. Enumeration Data Type 7. ARRAY Data Type

4.1 BIT and BIT_VECTOR Data Type 16 The BIT and BIT_VECTOR types are predefined in VHDL standards IEEE1076 and IEEE1164, hence no need for LIBRARY statement. Objects of these types can only have the values ‘0’ or ‘1’. The BIT_VECTOR type is simply a vector of type BIT. CONT…………

4.1 BIT and BIT_VECTOR Data Type 17 Example: SIGNAL x: BIT; SIGNAL Y: BIT_VECTOR (5 DOWNTO 0); SIGNAL z: BIT_VECTOR (0 TO 4);. x <= '1'; y <= "000010"; z '0'); -- same as "00000" z(4)Z(3)Z(z)z(1)z(0) Y(5)Y(4)Y(3)Y(2)Y(1)Y(0) Yz CONT…………

18 Notes: 1. The syntax “lower_index TO higher index” is useful for a multi bit signal that is simply an array of bits. 2. The syntax “higher_index DOWNTO lower_index” is useful if the signal represents a binary number. 4.1 BIT and BIT_VECTOR Data Type

4.2 STD_LOGIC and STD_LOGIC_VECTOR Data Type 19 The STD_LOGIC and STD_LOGIC_VECTOR types are not predefined. Therefore, the following two library statements must be included in order to use these types: LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; CONT…………

20 If objects of type STD_LOGIC_VECTOR are to be used as binary numbers in arithmetic manipulations, then either one of the following two USE statements must also be included: For signed number arithmetic For unsigned number arithmetic 4.2 STD_LOGIC and STD_LOGIC_VECTOR Data Type CONT………… USE IEEE.STD_LOGIC_SIGNED.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL;

21 The STD_LOGIC and STD_LOGIC_VECTOR types provide more values than the BIT type for modelling a real circuit more accurately. Objects of these types can have the following values: '0' = normal 0 Useful‘L’ =weak 0 '1' = normal 1 for'H' =weak 1 'Z' =high impedance Logic'U' =uninitialized '_' = don’t-care Circuits ‘X’ = unknown 'W'=weak unknown 4.2 STD_LOGIC and STD_LOGIC_VECTOR Data Type CONT…………

22 Example: 4.2 STD_LOGIC and STD_LOGIC_VECTOR Data Type LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; SIGNAL x: STD_LOGIC; SIGNAL y: STD_LOGIC_VECTOR (7 DOWNTO 0); x <= 'Z'; y <= " Z"; y '0'); -- same as " "

4.3 SIGNED and UNSIGNED Data Type 23 These types are used for arithmetic operation; they represent an array of STD_LOGIC signals. The purpose of SIGNED and UNSIGNED data types is to allow the user to indicate in the VHDL code what kind of number representation is being used. CONT…………

24 To use these types, the code must include the following statement: The SIGNED is used with 2’s complement representation. 4.3 SIGNED and UNSIGNED Data Type CONT………… LIBRARY IEEE; USE IEEE.STD_LOGIC_ARITH.ALL;

4.4 INTEGER Data Type 25 The predefined INTEGER type defines binary number objects for use with arithmetic operators. By default, an INTEGER signal uses 32 bits to represent a signed number. Integers using fewer bits can also be declared with the RANGE keyword. CONT…………

26 Example: This defines y as 7-bit binary number. 4.4 INTEGER Data Type SIGNAL x: INTEGER; SIGNAL y: INTEGER RANGE –64 to 63;

4.5 BOOLEAN Data Type 27 The predefined BOOLEAN type defines objects having the two values TRUE and FALSE. Example: SIGNAL x: BOOLEAN;

BASIC VHDL LANGUAGE ELEMENTS Comments 2. Identifiers 3. Data Objects 4. Data Types 5. VHDL Operators 6. VDHL Design Entity

5. VHDL Operators Logical Operator 2. Arithmetic Operators 3. Assignment Operators 4. Relational Operators 5. Shift and Rotate Operators

5.1 Logical Operators 30

5.2 Arithmetic Operators 31

5.2 Arithmetic Operators 32 Used with STD_LOGIC_VECTOR, SIGNED, UNSIGNED, INTEGER c <= -a; (c equals to the 2’s complement of a). There are no synthesis restrictions regarding (Addition, Subtraction, and Multiplication). For Division, only power of two dividers is allowed. CONT…….

5.2 Arithmetic Operators 33 For Exponentiation, only static values of base and exponent are accepted. (y MOD x) returns the reminder of y/x. with the signal of x. (y REM x) returns the reminder of y/x with the signal y. (MOD, REM, ABS) operators are generally little or no synthesis support. CONT…….

5.3 Assignment Operators 34 <=Used to assign a value to a SIGNAL := Used to assign Value to VARIABLES, CONSTANTS, or GENERIC => Used to assign values to individual vector elements, or with OTHERS

5.3 Assignment Operators cont…. 35

5.4 Relational Operators 36 Used to compare expressions Result of comparison TRUE or FALSE Compared expressions must be of the same type

Relational Operators cont…..

5.5 Shift and Rotate Operators 38

Shift and Rotate Operators - Example