DOC PREVIEW
MASON ECE 545 - Lecture 9 Data types

This preview shows page 1-2-3-4-30-31-32-33-34-61-62-63-64 out of 64 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 64 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 64 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 64 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 64 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 64 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 64 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 64 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 64 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 64 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 64 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 64 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 64 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 64 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 64 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Data typesSources & Required ReadingSlide 3Notion of typeExample of strong typingSlide 6Classification of data typesSlide 8Integer typeUser defined integer types - ExamplesSlide 11Predefined enumeration types (1)Predefined enumeration types (2)User-defined enumeration types - ExamplesSlide 15Floating point typesReal literals - examplesSlide 18The ANSI/IEEE standard floating-point number representation formatsSlide 20Features of the ANSI/IEEE standard floating-point number representation formatsUser-defined floating-point types - ExamplesSlide 23Physical data typesTime values (physical literals) - ExamplesTIME valuesUnits of timeUser-defined physical types (1)User-defined physical types (2)Slide 30Attributes of all scalar typesAttributes of all scalar types - examplesSlide 33Attributes of discrete and physical typesAttributes of discrete types - examplesSlide 36SubtypePredefined subtypesUser-defined subtypes - ExamplesSlide 40Operators (1)Operators (2)Operators (3)Slide 44Operator overloadingDifferent declarations for the same operator - ExampleSlide 47Slide 48One-dimensional arrays – Examples (1)One-dimensional arrays – Examples (2)One-dimensional array – Initialization (1)One-dimensional array – Initialization (2)Multidimensional arrays – Example (1)Multidimensional arrays – Example (2)Slide 55Array AttributesArray Attributes - ExamplesSlide 58Predefined Unconstrained Array TypesSlide 60User-defined Unconstrained Array TypesSlide 62Records – Examples (1)Records – Examples (2)ECE 545 – Introduction to VHDL George Mason UniversityData typesECE 545Lecture 9ECE 545 – Introduction to VHDL 2Sources & Required Reading•Peter Ashenden, The Designer’s Guide to VHDL, Chapter 2 Scalar Data Types and OperationsChapter 4 Composite Data Types and Operations•Sundar Rajan, Essential VHDL, Chapter 5Counters and Simple Arithmetic FunctionsECE 545 – Introduction to VHDL 3VHDL as a Strongly Typed LanguageECE 545 – Introduction to VHDL 4Notion of type•Type defines a set of values and a set of applicable operations•Declaration of a type determines which values can be stored in an object (signal, variable, constant) of a given type•Every object can only assume values of its nominated type•Each operation (e.g., and, +, *) includes the types of values to which the operation may be applied, and the type of the result•The goal of strong typing is a detection of errors at an early stage of the design processECE 545 – Introduction to VHDL 5Example of strong typingarchitecture incorrect of example1 istype apples is range 0 to 100;type oranges is range 0 to 100;signal apple1: apples;signal orange1: oranges;begin apple1 <= orange1;end incorrect;ECE 545 – Introduction to VHDL 6Type ClassificationECE 545 – Introduction to VHDL 7Classification of data typesECE 545 – Introduction to VHDL 8Integer TypesECE 545 – Introduction to VHDL 9Integer type Name: integerStatus: predefinedContents: all integer numbers representable on a particular host computer, but at least numbers in the range –(231-1) .. 231-1ECE 545 – Introduction to VHDL 10User defined integer types - Examples type day_of_month is range 0 to 31;type year is range 0 to 2100;type set_index_range is range 999 downto 100;constant number_of_bits: integer :=32;type bit_index is range 0 to number_of_bits-1;Values of bounds can be expressions, butneed to be known when the model is analyzed.ECE 545 – Introduction to VHDL 11Enumeration TypesECE 545 – Introduction to VHDL 12Predefined enumeration types (1)boolean (true, false)bit (‘0’, ‘1’)character VHDL-87:128 7-bit ASCII charactersVHDL-93:256 ISO 8859 Latin-1 8-bit charactersECE 545 – Introduction to VHDL 13Predefined enumeration types (2)severity_level (note, warning, error, failure)Predefined in VHDL-93 only:file_open_kind(read_mode, write_mode, append_mode)file_open_status (open_ok, status_error, name_error, mode_error)ECE 545 – Introduction to VHDL 14User-defined enumeration types - Examplestype state is (S0, S1);type alu_function is (disable, pass, add, subtract,multiply, divide);type octal_digit is (‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’);type mixed is (lf, cr, ht, ‘-’, ‘/‘, ‘\’);Each value in an enumeration type must be eitheran identifier or a character literalECE 545 – Introduction to VHDL 15Floating-Point TypesECE 545 – Introduction to VHDL 16Floating point types•Used to represent real numbers•Numbers are represented using a significand (mantissa) part and an exponent part•Conform to the IEEE standard 754 or 854Minimum size of representation that must besupported by the implementation of the VHDLstandard:VHDL-2001: 64-bit representationVHDL-87, VHDL-93: 32-bit representationECE 545 – Introduction to VHDL 17Real literals - examples23.1 23.146E5 46  1051E+12 1  1012 1.234E09 1.234  109 34.0e-08 34.0  10-8 2#0.101#E5 0.1012  25 =(2-1+2-3)  25 8#0.4#E-6 0.48  8-6 = (4  8-1)  8-6 16#0.a5#E-8 0.a516  16-8 =(1016-1+516-2)  16-8ECE 545 – Introduction to VHDL 18Floating-point number formatECE 545 – Introduction to VHDL 19The ANSI/IEEE standard floating-point number representation formatsECE 545 – Introduction to VHDL 20ECE 545 – Introduction to VHDL 21Features of the ANSI/IEEE standard floating-point number representation formatsECE 545 – Introduction to VHDL 22User-defined floating-point types - Examplestype input_level is range -10.0 to +10.0type probability is range 0.0 to 1.0;constant max_output: real := 1.0E6;constant min_output: real := 1.0E-6;type output_range is max_output downto min_output;ECE 545 – Introduction to VHDL 23Physical TypesECE 545 – Introduction to VHDL 24Physical data types Types representing physical quantities, such as time, voltage, capacitance, etc. are referred in VHDL as physical data types. TIME is the only predefined physical data type. Value of the physical data type is called a physical literal.ECE 545 – Introduction to VHDL 25Time values (physical literals) - Examples7 ns1 minmin10.65 us10.65 fsUnit of time(dimension)SpaceNumeric valueECE 545 – Introduction to VHDL 26TIME valuesNumeric value can be an integer or a floating point number. Numeric value is optional. If not given, 1 isimplied.Numeric value and dimension MUST beseparated by a space.ECE 545 – Introduction to VHDL 27Units of timeUnit DefinitionBase Unitfs femtoseconds (10-15 seconds)Derived Unitsps picoseconds


View Full Document

MASON ECE 545 - Lecture 9 Data types

Documents in this Course
Sorting

Sorting

6 pages

Load more
Download Lecture 9 Data types
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 9 Data types and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 9 Data types 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?