Lecture 3 Chap 4 Types Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.

Slides:



Advertisements
Similar presentations
Introduction to VHDL CLASS MATERIALS EECE 255. Very High Speed Integrated Circuit Hardware Description Language Industry standard language to describe.
Advertisements

Lecture 6 Chap 8: Sequential VHDL Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
1 Lecture 13 VHDL 3/16/09. 2 VHDL VHDL is a hardware description language. The behavior of a digital system can be described (specified) by writing a.
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.
Data Types. Composite Date Types n Arrays –Single and multi-dimensional –Arrays are single Type n Records –Records are mixed types.
Introduction to VHDL CSCE 496/896: Embedded Systems Witawas Srisa-an.
ELEN 468 Lecture 191 ELEN 468 Advanced Logic Design Lecture 19 VHDL.
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.
The IEEE Libraries And Examples Using Functions. Libraries Using the Library Command VHDL allows libraries defined using: library LibraryName; Here, we.
第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.
1 Lecture 11 Chap 13: Test Benches Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Concordia University 1 Lecture #8 In this lecture we will cover the following material: The standard package, The std_logic_1164  Objects & data Types.
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.
VHDL – Dataflow and Structural Modeling and Testbenches ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
IAY 0600 Digital Systems Design
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.
陳慶瀚 機器智慧與自動化技術 (MIAT) 實驗室 國立中央大學資工系 2009 年 10 月 8 日 ESD-04 VHDL 硬體描述語言概論 VHDL Hardware Description Language.
Packages and Use Clauses Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHDL – Basic Language Elements  Identifiers: –basic identifier: composed of a sequence of one or more.
Lecture 4 Chap 5 Types Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Lecture #8 Page 1 Lecture #8 Agenda 1.VHDL : Operators 2.VHDL : Signal Assignments Announcements 1.HW #4 assigned ECE 4110– Digital Logic Design.
Copyright(c) 1996 W. B. Ligon III1 Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component.
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.
Design Methodology Based on VHDL Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
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.
Aliases Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Lecture 7 Chap 9: Registers Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Lecture 9 Chap 11: Subprograms Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
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.
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
BASIC VHDL LANGUAGE ELEMENTS Digital Design for Instrumentation with VHDL 1.
VHDL Programming Fundamentals Presented By Dr. Pradyut Kumar Biswal Department of Electronics, IIIT Bhubaneswar.
Scalar Data Types and Operations 大同大學 資訊工程系 副教授 鄭福炯
Advanced FPGA Based System Design Lecture-6 & 7 VHDL Data Types By: Dr Imtiaz Hussain 1.
CEC 220 Digital Circuit Design Introduction to VHDL Friday, February 21 CEC 220 Digital Circuit Design Slide 1 of 10.
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.
Composite Data Types and Operations Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
IAY 0600 Digital Systems Design
Introduction To VHDL 홍 원 의.
Design Entry: Schematic Capture and VHDL
Comprehensive VHDL Module 9 More on Types November
VHDL Basics.
ECE 434 Advanced Digital System L17
CHAPTER 10 Introduction to VHDL
VHDL DATA TYPES.
CPE 528: Lecture #4 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
CPE/EE 422/522 Advanced Logic Design L11
Advanced FPGA Based System Design
ECE 434 Advanced Digital System L10
Concurrent vs Sequential
IAS 0600 Digital Systems Design
VHDL Tutorial.
IAS 0600 Digital Systems Design
VHDL Data Types Module F3.1.
EEL4712 Digital Design (VHDL Tutorial).
Presentation transcript:

Lecture 3 Chap 4 Types Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University

Types: VHDL is a strongly-typed language Eight classes of types in VHDL: classsynthesisable Enumeration typesY Integer typesY Floating point typesN Physical typesN Array typesY Record typesY Access typesN File typesN

Standard Types: Predefined types in standard package: Type classsynthesisable boolean enumeration typeY bit enumeration typeY characterenumeration type Y severity_level enumeration type N integer integer typeY natural subtype of integerY positivesubtype of integerY realfloating point typeN timephysical typeN stringarray of charY bit_vectorarray of bitY

Std_logic_1164 Types: Predefined types in std_logic_1164 package: Type classsynthesisable std_ulogic enumeration typeY std_logicsubtype of std_ulogicY std_ulogic_vector array of std_ulogicY

Standard Operators Values, signals and variables of a type can be combined in expressions using operators VHDL operators: VHDL’93 in italic font booleannot, and, or, nand, nor, xor, xnor comparison=, /=,, >= shifting sll, srl, sla, sra, rol, ror arithmetics+, s-, +, -, *, /, mod, rem, abs, ** concatenation &

Type: bit bit is the built-in logical type. type bit is (‘0’, ‘1’) -- bit has two values. Operators: booleannot, and, or, nand, nor, xor, xnor comparison=, /=,, >= boolean operator: a xor b ==> bit type comparison operator: a = b ==> boolean type

Type: boolean boolean is the built-in comparison type. type boolean is (false, true) -- boolean has two values. Operators: booleannot, and, or, nand, nor, xor, xnor comparison=, /=,, >= boolean operator: a xor b ==> boolean type comparison operator: a = b ==> boolean type Hardware mapping: boolean ==> a single wire Example: A. a = b ==> a nxor b (a, b are type of boolean) B. a = 0 and = b=1 (a, b are 4-bit numbers) see pp 42.

Integer Type Integer is the built-in numeric type. type integer is range to ; Operator: comparison=, /=,, >= arithmetics+, s-, +, -, *, /, mod, rem, abs, ** 8-bit arithmetic integer type: (used-defined integers) type short is range -128 to 127 ; You can not mix type integer and short. The new type (short) assumes the operators of Integer Hardware mapping: a bus of wire

Integer Subtype Integer subtypes: A. subtype natural is integer range 0 to integer’high B. subtype positive is integer range 1 to integer’high. integer’high is the highest value of type integer. 4-bit subtype of integer: subtype nat4 is natural range 0 to 15. Hardware mapping: a bus of wire

Integer Subtype w, x, y, z are 4-bit unsigned number. W <= x - y + z add signed bit to unsigned data

Enumeration Types An enumeration type is a type composed of a set of literal values. Examples: A. type state is (main_green, main_yellow, farm_green, farm_yellow); B. type mvl4 is (‘X’, ‘0’, ‘1’, ‘Z’); C. type boolean is (false, true); D. type bit is (‘0’, ‘1’); No arithmetic operation on enumeration types.

Multi-valued logic types standard type called std_logic is a nine-value logic type std_logic is not part of VHDL language, but it is in IEEE standard extension to the language under standard number You must include the following lines to use std_logic Library ieee; use ieee.std_logic_1164.all;

Multi-valued logic types type std_ulogic is ( ‘U’, -- Uninitialized ‘X’, -- Forcing unknown ‘0’, -- Forcing 0 ‘1’, -- Forcing 1 ‘Z’, -- High imepdance ‘W’, -- Weak unknown ‘L’, -- Weak 0 ‘H’, -- Weak 1 ‘-’, -- Don’t care );

Records A record is a collection of elements. Each of the elements can be of any constrained type or subtype Example: type complex is record Read : integer; imag : integer; end record; signal a, b, c: complex; operator: comparison =, /=

Records Access an element of a record a.real <= 0; a 0, imag =>0); a <= (0,0); (r,i) <= a; r <= a.real i <= a.imag

Arrays An array is a collection of same-type elements An array can be unconstrained or constrained. Unconstrained array: size of the array is unspecified. Constrained array: size and index type are given. Examples: type std_logic_vector is array (natural range<>) of std_logic; signal a: std_logic_vector (3 downto 0); (3 downto 0) is called a descending range: first (left) element is 3 and the last (right element) is 0. Bus: descending range

Array Subtype slv4 is std_logic_vector (3 downto 0); signal a: slv4; signal up: std_logic_vector (1 to 4); signal down: std_logic_vector(4 downto 1); down <= up; down(4) <= up(1); down(3) <= up(2); down(2) <= up(3); down(1) <= up(4);

Array down(1 downto 0) <= down(4 downto 3); down ’1’, 2=>’0’, 1=>’0’, 0 =>’0’); down ’1’,2|1|0 => ‘0’); down ’1’,2 downto 0 => ‘0’); down ’1’, others => ‘0’); down <= (‘1’, ‘0’, ‘0’, ‘0’);

Array x <= B”0000_0000_1111”; x <= O”00_17”; x <= X”00F”; signal a,b : std_logic_vector(7 downto 0); signal z: std_logic_vector(15 downto 0); … z <= a & b;

Attributes Attributes are a device for eliciting information from a type or from the values of a type. Attributes of Integer and Enumeration types: type’lefttype’right type’hightype’low type’pred(value)type’succ(vaule) type’leftof(value)type’rightof(value) type’pos(value)type’val(value)

Attributes Example type state is (green, yellow, red); type short is range -128 to 127; type backward is range 127 to -128; state’left --> greenstate’right --> red short’left-->-128short’right -->127 backward’left--> 127 backward’right-->-128 state’low--> state’high--> short’low-->short’high--> backward’low-->backward’high-->

Attributes Example type state is (green, yellow, red); type short is range -128 to 127; type backward is range 127 to -128; state’pos(green) --> 0state’val(2) --> red state’pred(yellow) -->green state’succ(yellow) -->red short’pred(0) --> -1short’leftof(0) --> -1 backward’pred(0) -->backward’succ(0) --> state’succ(red) --> error

Attributes Array attributes: size, range, index a‘left, a’right, a‘low, a.high, a’range, a‘reverse_length, a’length Example: signal up: std_logic_vector (0 to 3); signal down: std_logic_vector(3 downto 0); up’left --> 0down’left --> 3 up’right --> 3down’right --> 0 up’low --> 0down’low --> 0 up’high --> 3down’high --> 3 sign <= down(down’left);

Attributes Example: signal a: std_logic_vector (3 downto 0); signal b: std_logic_vector(a’range); signal c: std_logic_vector (a’reverse_range); signal c: bit_vector (13 to 24); signal d: bit_vector(c’length-1 downto 0); d <= c;