第6章 VHDL NUMBERS, STRINGS, AND EXPRESSIONS 義守大學電機工程學系 陳慶瀚

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

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.
Signals vs. Variables Workshop Fri/Sat Test bench creation Misc IP Cores Chipscope Pro When Demos due.
第5章 VHDL Package 義守大學電機工程學系 陳慶瀚
Data Types. Composite Date Types n Arrays –Single and multi-dimensional –Arrays are single Type n Records –Records are mixed types.
Review Binary –Each digit place is a power of 2 –Any two state phenomenon can encode a binary number –The number of bits (digits) required directly relates.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Introduction.
VHDL And Synthesis Review. VHDL In Detail Things that we will look at: –Port and Types –Arithmetic Operators –Design styles for Synthesis.
Programming in VHDL Using Processes. How Processes Run A process is either in suspend mode or is running. For a process to run, there has to be a change.
PZ04A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ04A - Scalar and composite data Programming Language.
The IEEE Libraries And Examples Using Functions. Libraries Using the Library Command VHDL allows libraries defined using: library LibraryName; Here, we.
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.
Chapter 2: C Fundamentals Dr. Ameer Ali. Overview C Character set Identifiers and Keywords Data Types Constants Variables and Arrays Declarations Expressions.
Reconfigurable Computing - VHDL - Types John Morris Chung-Ang University The University of Auckland.
1 Part I: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
Copyright © 2002 W. A. Tucker1 Chapter 7 Lecture Notes Bill Tucker Austin Community College COSC 1315.
C Tokens Identifiers Keywords Constants Operators Special symbols.
10/17/2015DSD, USIT, GGSIPU1 Data Types Each data object has a type associated with it. The type defines the set of values that the object can have and.
IAY 0600 Digital Systems Design
Egyidejű VHDL  Signal assignment  Concurrency  Delta time  When statement  With statement  Behaviour and dataflow  Dataflow model of multiplexor.
Lecture 3 Chap 4 Types Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Capt Michael Tanner Room 2F46A
CISC105 – General Computer Science Class 9 – 07/03/2006.
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.
EE3A1 Computer Hardware and Digital Design Lecture 5 Testbenches and Memories in VHDL.
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.
VHDL Very High Speed Integrated Circuit Hardware Description Language Shiraz University of shiraz spring 2011.
ISBN Chapter 6 Data Types Introduction Primitive Data Types User-Defined Ordinal Types.
Reconfigurable Computing - VHDL - Types John Morris Chung-Ang University The University of Auckland.
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.
9/4/ L6 Language Overview I Copyright 2006, Joanne DeGroat, ECE, OSU 1 Language Overview I The start of a grand tour of the language.
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
DATA TYPES 1.Pre-Defined Data Types 2. User-Defined Data Types.
Concordia University 1 Lecture #8 In this lecture we will cover the following material: The standard package, The std_logic_1164  Objects & data Types.
ISBN Chapter 6 Data Types. Copyright © 2006 Addison-Wesley. All rights reserved. 6-2 Chapter 6 Topics Introduction Primitive Data Types.
8-Jan-16EE5141 Chapter 6 Subprograms & Packages Subprogram declaration Subprogram body Package declaration Package body Resolution function Subprogram.
ECOM 4311—Digital System Design with VHDL
BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.
1.2 Primitive Data Types and Variables
Scalar Data Types and Operations 大同大學 資訊工程系 副教授 鄭福炯
Advanced FPGA Based System Design Lecture-6 & 7 VHDL Data Types By: Dr Imtiaz Hussain 1.
Types Chapter 2. C++ An Introduction to Computing, 3rd ed. 2 Objectives Observe types provided by C++ Literals of these types Explain syntax rules for.
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.
 Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. 
Modern Digital System Design Using VHDL: A Practical Introduction Subprograms & Packages Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd.
Case Study: Xilinx Synthesis Tool (XST). Arrays & Records 2.
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.
Basic Data Types อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา Chapter 4.
1 Scalar and composite data Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Scalar and composite data Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
IAY 0600 Digital Systems Design
The Machine Model Memory
Comprehensive VHDL Module 9 More on Types November
Reconfigurable Computing - VHDL - Types
ECE 434 Advanced Digital System L17
ECE 434 Advanced Digital System L10
IAS 0600 Digital Systems Design
IAS 0600 Digital Systems Design
VHDL Data Types Module F3.1.
第7章 VHDL OBJECTS: CONSTANTS, VARIABLES, AND SIGNALS
Data Types Each data object has a type associated with it.
Presentation transcript:

第6章 VHDL NUMBERS, STRINGS, AND EXPRESSIONS 義守大學電機工程學系 陳慶瀚

1. Numeric Constants Numeric contants can be defined, and can be of any base (default is decimal). Numbers may include embedded underscores to improve readability. Format: base#digits# -- base must be a decimal number Examples 16#9fba# (hexadecimal) 2#1111_1101_1011# (binary) 16#f.1f#E+2 (floating-point, exponent is decimal)

2. Bit String Bit vector constants are are specified as literal strings. Examples x"ffe" (12-bit hexadecimal value) o"777" (9-bit octal value) b"1111_1101_1101" (12-bit binary value)

3. VHDL Predefined Scalar Data Types bit values: '0', '1' boolean values: TRUE, FALSE integer values: -(231) to +( ) {SUN Limit} natural values: 0 to integer'high (subtype of integer) positive values: 1 to integer'high (subtype of integer) character values: ASCII characters (eg. 'A') time values include units (eg. 10ns, 20us)

4.IEEE Standard 1164 std_ulogic values: 'U','X','1','0','Z','W','H','L','-' 'U' = uninitialized 'X' = unknown 'W' = weak 'X' 'Z' = floating 'H'/'L' = weak '1'/'0' '-' = don't care std_logic resolved "std_ulogic" values X01 subtype {'X','0','1'} of std_ulogic X01Z subtype {'X','0','1','Z'} of std_ulogic UX01 subtype {'U','X','0','1'} of std_ulogic UX01Z subtype {'U','X','0','1','Z'} of std_ulogic

5. VHDL Aggregate Data Types Predefined Aggregate Data Types: bit_vector array (natural range <>) of bit string array (natural range <>) of char text file of "string" IEEE Standard 1164 Aggregate Data Types: std_ulogic_vector array (natural range <>) of std_ulogic std_logic_vector array (natural range <>) of std_logic Examples signal dbus: bit_vector(15 downto 0); dbus (7 downto 4) <= "0000"; (4-bit slice of dbus) signal cnt: std_ulogic_vector(1 to 3); variable message: string(0 to 20);

6. User-Defined Enumeration Types An enumerated data type can be created by explicitely listing all possible values. Example: type opcodes is (add, sub, jump, call); -- Type with 4 values signal instruc: opcodes; -- Signal of this type... if instruc = add then -- test for value 'add'...

7. user-defined types Constrained array: Upper and lower indexes are specified. Example type word is array (0 to 15) of bit; Unconstrained array: Indexes are specified when a signal or variable of that type is declared. Examples type memory is array (integer range <>) of bit_vector(0 to 7); -- a type which is an arbitrary-sized array of 8-bit vectors variable memory256: memory(0 to 255); -- a 256-byte memory array variable stack: memory(15 downto 0); -- a 16-byte memory array

8. User-defined Subtype Subtype is a selected subset of values of a given type. Elements of different subtypes having the same base type may be combined in expressions (elements of different types cannot). Subtypes can be used to detect out-of-range values during simulation. Examples: subtype byte_signed is integer range -128 to 127; subtype byte_unsigned is integer range 0 to 255;

9. Aliases An alias" defines an alternate name for a signal or part of a signal. Aliases are often used to refer to selected slices of a bit_vector. Example: signal instruction: bit_vector(31 downto 0); alias opcode: bit_vector(6 downto 0) is instruction(31 downto 25);... opcode <= " "; -- Set the opcode part of an instruction code