13/06/59 1 Copyright  1997, KJH Introduction to VHDL Lecture 2 Prof. K. J. Hintz Department of Electrical and Computer Engineering George Mason University.

Slides:



Advertisements
Similar presentations
Intermediate Code Generation
Advertisements

Types and Arithmetic Operators
Primitive Data Types There are a number of common objects we encounter and are treated specially by almost any programming language These are called basic.
Data Types in Java Data is the information that a program has to work with. Data is of different types. The type of a piece of data tells Java what can.
Introduction to Computers and Programming Lecture 4: Mathematical Operators New York University.
All the Operators. Precedence An operator with higher precedence is done earlier (prededes) one with lower precedence –A higher precedence is indicated.
VHDL Data Types Module F3.1. VHDL Data Types Scalar Integer Enumerated Real (floating point)* Physical* Composite Array Record Access (pointers)* * Not.
All the Operators. Precedence An operator with higher precedence is done earlier (prededes) one with lower precedence –A higher precedence is indicated.
Data Types. Composite Date Types n Arrays –Single and multi-dimensional –Arrays are single Type n Records –Records are mixed types.
COMPSCI 125 Spring 2005 ©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 3: Numeric Data *Variables *Numeric data.
SubprogramsSubprograms. SubprogramsSubprograms ä Similar to subprograms found in other languages ä Allow repeatedly used code to be referenced multiple.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
Topics of Lecture Structural Model Procedures Functions Overloading.
N Objects n Constants n Variables n Types and Type Declarations n Numbers n Physical Types n Enumeration Types n Subtypes n Operators.
CS180 Recitation 3. Lecture: Overflow byte b; b = 127; b += 1; System.out.println("b is" + b); b is -128 byte b; b = 128; //will not compile! b went out.
Chapter 3 Numerical Data. Topics Variables Numeric data types Assignment Expressions.
CS 3850 Lecture 5 Operators. 5.1 Binary Arithmetic Operators Binary arithmetic operators operate on two operands. Register and net (wire) operands are.
0 Chap. 2. Types, Operators, and Expressions 2.1Variable Names 2.2Data Types and Sizes 2.3Constants 2.4Declarations Imperative Programming, B. Hirsbrunner,
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie June 27, 2005.
第6章 VHDL NUMBERS, STRINGS, AND EXPRESSIONS 義守大學電機工程學系 陳慶瀚
VHDL. What is VHDL? VHDL: VHSIC Hardware Description Language  VHSIC: Very High Speed Integrated Circuit 7/2/ R.H.Khade.
Concordia University 1 Lecture #8 In this lecture we will cover the following material: The standard package, The std_logic_1164  Objects & data Types.
Ryan Chu. Arithmetic Expressions Arithmetic expressions consist of operators, operands, parentheses, and function calls. The purpose is to specify an.
Reconfigurable Computing - VHDL - Types John Morris Chung-Ang University The University of Auckland.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
Chapter 3: Data Types and Operators JavaScript - Introductory.
Sahar Mosleh California State University San MarcosPage 1 A for loop can contain multiple initialization actions separated with commas Caution must be.
Lecture 3 Chap 4 Types Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
C Operators. CONTENTS C OPERATORS TYPES OF OPERATOR UNARY BINARY TERNARY ARITHMATIC RELATIONAL LOGICAL.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHDL – Basic Language Elements  Identifiers: –basic identifier: composed of a sequence of one or more.
Operators Precedence - Operators with the highest precedence will be executed first. Page 54 of the book and Appendix B list C's operator precedence. Parenthesis.
15-Nov-15 All the Operators. operators.ppt 2 Precedence An operator with higher precedence is done earlier (precedes) one with lower precedence A higher.
Lecture #8 Page 1 Lecture #8 Agenda 1.VHDL : Operators 2.VHDL : Signal Assignments Announcements 1.HW #4 assigned ECE 4110– Digital Logic Design.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
IAY 0600 Digital Systems Design VHDL discussion Verification: Testbenches Alexander Sudnitson Tallinn University of Technology.
VHDL Basics. VHDL BASICS 2 OUTLINE –Component model –Code model –Entity –Architecture –Identifiers and objects –Operations for relations VHDL ET062G &
L13 – VHDL Language Elements. VHDL Language Elements  Elements needed for FPGA design Types  Basic Types  Resolved Types – special attributes of resolved.
Lecture #7 Page 1 Lecture #7 Agenda 1.VHDL Data Types Announcements 1.n/a ECE 4110– Digital Logic Design.
Introduction to VHDL. VHDL DARPA, VHSIC (Very High Speed Integrated Circuits) program Different manufacturers Standard language to describe –Structure.
COMP Primitive and Class Types Yi Hong May 14, 2015.
Concordia University 1 Lecture #8 In this lecture we will cover the following material: The standard package, The std_logic_1164  Objects & data Types.
Programming in Java (COP 2250) Lecture 4 Chengyong Yang Fall, 2005.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
ECOM 4311—Digital System Design with VHDL
BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.
CSM-Java Programming-I Spring,2005 Fundamental Data Types Lesson - 2.
Scalar Data Types and Operations 大同大學 資訊工程系 副教授 鄭福炯
0 Chap.2. Types, Operators, and Expressions 2.1Variable Names 2.2Data Types and Sizes 2.3Constants 2.4Declarations 2.5Arithmetic Operators 2.6Relational.
Signals & Data-typesVer 1.1, Copyright 1997, TS, Inc. VHDL S i g n a l s & D a t a T y p e s Page 1.
Lecture #8 Page 1 Lecture #8 Agenda 1.VHDL : Operators 2.VHDL : Signal Assignments Announcements 1.HW #4 assigned ECE 4110– Sequential Logic Design.
ECE 103 Engineering Programming Chapter 4 Operators Herbert G. Mayer, PSU CS Status 6/19/2015 Initial content copied verbatim from ECE 103 material developed.
Lecture 3: More Java Basics Michael Hsu CSULA. Recall From Lecture Two  Write a basic program in Java  The process of writing, compiling, and running.
Introduction To VHDL 홍 원 의.
Fundamentals of PL/SQL part 1 (Basics)
Expressions An expression is a portion of a C++ statement that performs an evaluation of some kind Generally requires that a computation or data manipulation.
Lecture 3 Expressions Richard Gesick.
CHAPTER 10 Introduction to VHDL
All the Operators 22-Nov-18.
ECE 434 Advanced Digital System L9
All the Operators 4-Dec-18.
ECE 434 Advanced Digital System L10
C Operators, Operands, Expressions & Statements
Expressions An expression is a portion of a C++ statement that performs an evaluation of some kind Generally requires that a computation or data manipulation.
Data Types and Expressions
All the Operators 6-Apr-19.
All the Operators 13-Apr-19.
VHDL Data Types Module F3.1.
Data Types and Expressions
Data Types and Expressions
Presentation transcript:

13/06/59 1 Copyright  1997, KJH Introduction to VHDL Lecture 2 Prof. K. J. Hintz Department of Electrical and Computer Engineering George Mason University

13/06/59 2 Copyright  1997, KJH Outline  Objects  Object Classes  Class Types  Operations on Types of Classes

13/06/59 3 Copyright  1997, KJH Objects  Object: Anything that has a Name and is of a Specified Type  Four Classes of Objects  Constants  Variables  Signals (discussion deferred to later)  Files (discussion deferred to later)  Classes of Objects can be of Different Types

13/06/59 4 Copyright  1997, KJH Object Declaration  Before an Object can be Used, it must be Declared  Declarations  Specify a unique identifier  Define the type  May specify initial (default) value

13/06/59 5 Copyright  1997, KJH Constants  Initialized to a Value that Cannot Change  If not initialized, called a deferred constant  May only appear in package declaration  Insures a Value has a Type constant_declaration <= constant identifier_list : subtype_indication [ := expression ] ; where identifier_list <= identifier {,... }

13/06/59 6 Copyright  1997, KJH Constant Declaration Examples  constant PI : real := ;  constant BUS_WIDTH : integer := 32 ;  constant INTENSITY_DYNAMIC_RANGE : real := 16#FF.F ;  constant START_TIME_HOURS : integer := 11 ;  constant START_TIME_MINUTES : integer := 00 ;

13/06/59 7 Copyright  1997, KJH Variables  Variable: an Object Whose Value May be Changed After Creation  Initialization Value is Optional, if not Initialized the Default for Scalar Types is  the first in the list of an enumeration type  the lowest in an ascending range  the highest in a descending range  Only Declare where it can be Accessed by One Process variable_declaration <= variable identifier_list : subtype_indication [ := expression ] ;

13/06/59 8 Copyright  1997, KJH Variable Declaration Examples  variable ControlValue : real := 3.68;  variable MinTemp, MaxTemp, MeanTemp : real := 0 ;  variable ImageWidth, ImageHeight : integer := 256 ;  variable DiskSize, MemUsed, MemLeft : integer ;  variable MainBus : bit_vector (31 downto 0) ;

13/06/59 9 Copyright  1997, KJH Variable Assignment  Immediately Overwrites Variable with New Value Unlike the way a Signal  := Replacement Operator for Variables  <= Replacement Operator for Signals variable_assignment_statement <= [ label : ] name := expression ;

13/06/59 10 Copyright  1997, KJH Variable Assignment Examples  MinTemp := 0.0 ;  ImageWidth := 128 ;  MainBus : = 16#ffff_ffff ;  MainBus : = x “FFFF_FFFF“ ;

13/06/59 11 Copyright  1997, KJH Types  The type of a data object  Defines the set of values an object can take on  Defines operations which can be performed on object  Scalar Type  Consists of a set of single, indivisible values  Composite Type  Many Predefined Types

13/06/59 12 Copyright  1997, KJH Type Declaration type_declaration <= type identifier is type_definition ; type_definition <=scalar_type_definition | composite_type_definition | access_type_definition | file_type_definition  Identical Type Declarations are Distinct  type MidTermGrades is range 0 to 100  type FinalGrades is range 0 to 100

13/06/59 13 Copyright  1997, KJH Scalar Type Declaration scalar_type_definition <= enumeration_type_definition | integer_type_definition | floating_type_definition | physical_type_definition  Scalar Type  Number types  Enumerated list  Physical quantities

13/06/59 14 Copyright  1997, KJH Integer Type Definition

13/06/59 15 Copyright  1997, KJH Integer Type Definition Examples  type StreetNumbers is range to 12568;  type ImagingSensors is range 0 to 5;  type Celsius is range 100 downto 0;  type PointSpread is range 14 downto 0 ;

13/06/59 16 Copyright  1997, KJH Operations on Integer Types *Ashenden, VHDL cookbook

13/06/59 17 Copyright  1997, KJH Floating-Point Type Definition

13/06/59 18 Copyright  1997, KJH Floating-Point Type Examples  type StreetPosition is range to ;  type ImagingSensorSensitivity is range 0.0 to 5.0 ;  type Celsius is range downto 0.0 ;  type PointSpread is range 15.0 downto 0.0 ;

13/06/59 19 Copyright  1997, KJH Ops on Floating-Point Types  Binary Operators  +Add  -Subtraction  *Multiplication  /Division  **Exponentiation  Unary Operators  -Negation  +Identity  absAbsolute value

13/06/59 20 Copyright  1997, KJH Physical Type Definition

13/06/59 21 Copyright  1997, KJH Physical Type Definition  Time: Predefined Physical Type type time is range implementation defined units fs; ps=1000 fs; ns=1000 ps; us=1000 ns; ms = 1000 us; sec = 1000 ms; min = 60 sec; hr = 60 min; end units; [time]

13/06/59 22 Copyright  1997, KJH Simulation Resolution Limit  The Resolution Limit Determines the Precision to Which Time Values are Represented.  Values of Time Smaller than the Resolution Limit Round Down to Zero.  fs is the Normal Resolution Limit During Model Simulation.  Larger Values of Time can be used as a Secondary Time Resolution Limit  Units of all physical literals involving time must not be smaller than the secondary resolution limit

13/06/59 23 Copyright  1997, KJH Physical Type Definition Example type capacitance is range 0 to 1e12 units picofarad; nanofarad = 1000 picofarad ; microfarad = 1000 nanofarad ; farad = 1e6 microfarad ; end units capacitance;

13/06/59 24 Copyright  1997, KJH Physical Type Examples  47 picofarad  10.6 nanofarad  4.7 picofarad  rounds DOWN to 4 picofarads since pf is smallest unit  can only have integer value of base unit

13/06/59 25 Copyright  1997, KJH Operations on Physical Types  Binary Operators  *Multiplication by an integer or float  /Division by an integer or float  Division by objects of same physical type yield an integer  Unary Operators  -negation  +identity

13/06/59 26 Copyright  1997, KJH Operations on Physical Types  Multiplication or Division of Two Physical Types not Allowed  Convert to integers  Perform operation  Convert result to correct type

13/06/59 27 Copyright  1997, KJH Enumeration Type Definition

13/06/59 28 Copyright  1997, KJH Enumeration Type Definition Examples  type Buffer_Direction is ( in, out, tri_state ) ;  type FFType is ( Toggle, Set_Reset, Data, JK ) ;  type MemoryType is ( Read_Only, Write_Only, RW ) ;  type GateType is ( AND, OR, INVERT ) ;

13/06/59 29 Copyright  1997, KJH Predefined Enumeration Types  type severity_level is ( note, warning, error, failure );  type Boolean is ( false, true );  Used to model abstract conditions  type bit is ( '0', '1' );  Used to model hardware logic levels  type file_open_status is ( open_ok, status_error, name_error, mode_error );  type character is ( NUL, SOH,... )  all characters is ISO 8-bit character set  IEEE std_logic_1164 Accounts for Electrical Properties

13/06/59 30 Copyright  1997, KJH Subtypes

13/06/59 31 Copyright  1997, KJH Subtype Cases  A Subtype may Constrain Values from a Scalar Type to be Within a Specified Range  subtype Pin_Count is integer range 0 to 400;  subtype Octal_Digits is character range '0' to '7';  A Subtype May Constrain an Otherwise Unconstrained Array Type by Specifying Bounds for the Indices  subtype id is string (1 to 20);  subtype MyBus is bit_vector (8 downto 0);

13/06/59 32 Copyright  1997, KJH Subtypes  Predefined Numeric Subtypes  subtype natural is integer range 0 to highest_integer  subtype positive is integer range 1 to highest_integer  subtype delay_length is time range 0 fs to highest_time  Subtypes Mixed in Expressions  Computations done in base type  Assignment fails if result is not within range of result variable (sub)type

13/06/59 33 Copyright  1997, KJH Type Syntax  Type Qualification is Used to Avoid Type Ambiguity in Overloaded Enumeration Literals type_name ‘ ( expression )  Only states type of value  Type Conversion can be Used to Perform Mixed Arithmetic New_Type ( Value_of_Old_Type )  real ( 238 )  positive ( My_Integer_Value )  Rounds to nearest integer  Changes type of value

13/06/59 34 Copyright  1997, KJH Scalar Type Attributes  Predefined Attributes Associated with Each Type Type_Name ‘ Attribute_Name  Attributes applicable to ALL Scalar Types  T’leftleftmost value in T  T’rightrightmost value in T  T’lowleast value in T  T’highgreatest value in T  T’ascendingTrue if ascending range, else false  T’image(x)a string representing x  T’value(s)the value in T that is represented by s

13/06/59 35 Copyright  1997, KJH Scalar Attributes  Attributes Applicable to Discrete and Physical Types  T’pos(x) position number of x in T  T’val(n) value in T at position n  T’succ(x) value in T at position one greater than that of x  T’pred(x) value in T at position one less than that of x  T’leftof(x) value in T at position one to the left of x  T’rightof(x) value in T at position one to the right of x

13/06/59 36 Copyright  1997, KJH Operators  “Short-Circuit” Operators  Behavior with binary operators  Evaluate left operand  If value of operand determines the value of expression, set result  Else evaluate right operand  Left operand can be used to prevent right operand from causing arithmetic error such as divide by zero  Reduces computation time by eliminating redundant calculations  AND, OR, NAND, NOR

13/06/59 37 Copyright  1997, KJH Operators  Relational operators  =, /=,, >=  Operands must be of the same type  Yield Boolean results  Equality, Inequality operators  =, /=  Operands of any type.  Concatenation operator  &  Operates on one-dimensional arrays to form a new array

13/06/59 38 Copyright  1997, KJH Operators  Arithmetic  * /  Operate on integer, floating point and physical types types.  Modulo, Remainder  mod rem  Operate only on integer types.  Absolute value  abs  Operates on any numeric type

13/06/59 39 Copyright  1997, KJH Operators  Exponentiation  **  Integer or floating point left operand  Integer right operand required  Negative right operand requires floating point left operand.