VHDL allows the user to define own data types.

1 user-defined integer types  

-- This is indeed the pre-defined type integer
type integer is range - to +; -- indeed the pre-defined type natural
type natural is range to +; -- user-defined subset of integers
type my_integer is range - to ; -- user-defined subset of integers or naturals
type student_grade is range to ;

2 user-defined enumerated types

-- This is indeed the pre-defined type BIT
type bit is ('0','1'); -- user-defined subset of std_logic
type my_logic is ('','','Z'); -- indeed the pre-defined type of BIT_VECTOR
-- range <> is used to indicate that the range is unconstrained
-- NATURAL range <> indicate the range must fall within the NATURAL range
type BIT_VECTOR is array (NATURAL range <>) of BIT; -- an enumerated data type, typical of finte state machines
type state is (idle, forward, backward, stop); -- another enumerated data type
type color is (red, green, blue, white)

  The encoding of enumerated types is done sequentially and automatically. For example, for the type color above, two bits are necessary (there are four states), being ‘‘00’’ assigned to the first state (red), ‘‘01’’ to the second (green), ‘‘10’’ to the next (blue), and finally ‘‘11’’ to the last state (white).

VHDL之User-defined data types的更多相关文章

  1. ExtJS笔记 Ext.data.Types

    This is a static class containing the system-supplied data types which may be given to a Field. Type ...

  2. Data Types in the Kernel &lt;LDD3 学习笔记&gt;

    Data Types in the Kernel Use of Standard C Types /* * datasize.c -- print the size of common data it ...

  3. Data Types

    原地址: Home / Database / Oracle Database Online Documentation 11g Release 2 (11.2) / Database Administ ...

  4. Primitive Data Types

    Primitive Data Types (The Java™ Tutorials > Learning the Java Language > Language Basics) http ...

  5. Oracle Schema Objects——Tables——Oracle Data Types

    Oracle Schema Objects Oracle Data Types 数据类型 Data Type Description NUMBER(P,S) Number value having a ...

  6. NetCore + Mysql + EF:No coercion operator is defined between types 'System.Int16' and 'System.Boolean',

    总结三种解决办法: 1.Mysql升级到7 2.Nuget安装Pomelo.EntityFrameworkCore.MySql 2.2.0替代MySql.Data.EntityFrameworkCor ...

  7. C and SQL data types for ODBC and CLI

    C and SQL data types for ODBC and CLI   This topic lists the C and SQL data types for ODBC and CLI a ...

  8. allow zero datetime=true导致datetime转换失败:MySql.Data.Types.MySqlDateTime”的对象无法转换为类型“System.Nullable`1[System.DateTime]

    allow zero datetime=true导致datetime转换失败:MySql.Data.Types.MySqlDateTime”的对象无法转换为类型“System.Nullable`1[S ...

  9. "SQL Server does not handle comparison of NText, Text, Xml, or Image data types."

    "SQL Server does not handle comparison of NText, Text, Xml, or Image data types." sql2000 ...

随机推荐

  1. css3 background-clip和background-origin 区别

    在css3中,background-clip和background-origin它们2个的功能大致相同,但又有些细微差别. 1.background-clip:规定背景的绘制区域,当背景是纯颜色时与图 ...

  2. Laradock 快速搭建PHP开发环境

    可能你并不清楚 Docker 是什么,更不了解 Laradock是什么,送上语句自己特别喜欢的一句话 Use Docker First And Learn About It Later 大概意思就是 ...

  3. bupt summer training for 16 #1 ——简单题目

    D.What a Mess 给n个数,求其中能满足 a[i] % a[j] == 0 的数对之和 n = 1W,max_ai = 100W 不是很大,所以就直接筛就可以了 计算可得最高复杂度 < ...

  4. Maven学习总结(28)——Maven+Nexus+Myeclipse集成

    Maven简介 Maven 是一个基于项目对象模型(POM)的,提倡约定优于配置(ConventionOver Configuration)的,跨平台的项目管理和构建自动化工具. 首先它是一个优秀的构 ...

  5. 清北学堂模拟赛d1t4 一道图论好题(graph)

    题目描述 LYK有一张无向图G={V,E},这张无向图有n个点m条边组成.并且这是一张带权图,不仅有边权还有点权. LYK给出了一个子图的定义,一张图G’={V’,E’}被称作G的子图,当且仅当 ·G ...

  6. Configuration must specify a spooling directory

    启动spooling源时报错: 原因:spooling配置文件有误 a1.sources.r1.type = spooldir a1.sources.r1.spooldir = /usr/local/ ...

  7. MVC.Net:添加第三方类库的bundles引用

    以jQuery Mobile为例.当我们用nuget添加jQuery Mobile的package后,需要在项目中引用jQuery Mobile.传统的做法是在html页面上添加 <link h ...

  8. Win8.1下COCOS2D-X 3.4环境搭建

     Cocos2dx_3.4开发环境搭建,并编译成APK 第一步:须要下载的:(windows64位系统下环境搭建) Ant   apache-ant-1.9.4-bin.zip NDK   and ...

  9. Top10Servlet

    <span style="font-size:18px;">/** * Top10 * author:杨鑫 */ package servlet; import jav ...

  10. 关于MySQL错误 2005 - Unknown MySQL server host 'localhost' (0) 原因及解决方法

    今天在外面开navicat for mysql的时候,怎么也连不上自己本机上的数据库,一直显示2005 - Unknown MySQL server host 'localhost' (0): 错误代 ...